Comparisons

Rust C Java python
single-line comments
// this is a comment
// this is a comment
//this is a comment
# this is a comment
Multi-line comments
/*
    this is a comment
    on multiple lines
*/
                
/*
    this is a comment
    on multiple lines
*/
                
/*
    this is a comment
    on multiple lines
*/
                
'''
    this is a comment
    on multiple lines
'''
                
initializing variables
const var_name: i32 = 1015;
let var_name = 1_015_u16;
int var_name = 1015;
int var_name = 1015;
var_name = 1015
loops
let mut i = 0u32;
let result = loop { //infinite loop
    i += 1;
    if i == 4 {continue;}
    if i == 5 {break i;}
};

'outer: loop {
    'inner: loop {
        break 'outer;
    }
}

while i < 10 {
    i += 1;
    println!("{}", i);
}

for n in 1..10 { // (inclusive)..(exclusive), (inc)..=(inc), in arr.iter()
    println!("{}", n);
}
int i = 0;
while(i < 10) {
    i++;
    printf("%d", i);
}

for(int n = 0; n < 10; n++) {
    printf("%d", n);
}
                
int i = 0;
while(i < 10) {
    i++;
    System.out.println(i);
}

for(int n = 0; n < 10; n++) {
    System.out.println(n);
}
                
i = 0
while i < 10:
    i += 1
    print(i)

for n in range(0, 10):
    print(n)
}
                
interpreted or compiled compiled compiled compiled interpreted
typing static static static dynamic