Idiom #1 Print Hello World
Print a literal string on standard output
Idiom #55 Convert integer to string
Create the string representation s (in radix 10) of the integer value i.
Idiom #2 Print Hello 10 times
Loop to execute some code a constant number of times
- Ada
- C
- Caml
- Clojure
- Cobol
- C++
- C#
- C#
- C#
- D
- D
- Dart
- Dart
- Elixir
- Erlang
- Fortran
- Go
- Go
- Go
- Groovy
- Haskell
- JS
- JS
- JS
- JS
- Java
- Java
- Java
- Kotlin
- Kotlin
- Kotlin
- Lisp
- Lua
- Lua
- Lua
- Lua
- Obj-C
- PHP
- PHP
- Pascal
- Perl
- Perl
- Perl
- Prolog
- Python
- Python
- Python
- Ruby
- Ruby
- Ruby
- Rust
- Rust
- Scala
- Scala
- Scheme
- Scheme
- Scheme
- Smalltalk
- VB
Idiom #6 Iterate over list values
Do something with each item x of the list (or array) items, regardless indexes.
Idiom #8 Create a map (associative array)
Create a new map object x, and provide some (key, value) pairs as initial content.
Idiom #22 Convert string to integer
Extract the integer value i from its string representation s (in radix 10)
Idiom #50 Make an infinite loop
Write a loop that has no end clause.
Idiom #59 Write to standard error stream
Print the message "x is negative" to standard error (stderr), with integer x value substitution (e.g. "-2 is negative").
Idiom #123 Assert condition
Verify that predicate isConsistent returns true, otherwise report assertion violation.
Explain if the assertion is executed even in production environment or not.
Idiom #169 String length
Assign to the integer n the number of characters of the string s.
Make sure that multibyte characters are properly handled.
n can be different from the number of bytes of s.
Idiom #3 Create a procedure
Like a function which doesn't return any value, thus has only side effects (e.g. Print to standard output)
Idiom #4 Create a function
Create a function which returns the square of an integer
Idiom #5 Create a 2D Point data structure
Declare a container type for two floating-point numbers x and y