'Hello, World!' in the Top 10 Programming Languages
‘Hello, World!’ is an iconic statement that introduces novices to the programming world. Today, I decided to see how the statement would be represented in various programming languages. According to GeeksforGeeks, the top 10 programming languages in 2022 are:
Python
Java
JavaScript
Kotlin
R
PHP
Go
C
Swift
C#
As an aside, I was quite happy to see Python make the top of the list. I had been watching the language gain dominance over the years!
Let's jump right in and see what a 'Hello, World!' would look like:
1. Python
print("Hello, World!")
2. Java
class MyFirstClass {
public static void main(String[] args) {
System.out.println("Hello, World!");
}
}
3. JavaScript
<script>
alert( 'Hello, World!' );
</script>
4. Kotlin
MyFirstClass main(args : Array<String>) {
println("Hello, World!")
}
5. R
print("Hello, World!", quote = FALSE)
6. PHP
<?php
echo '<p>Hello, World!</p>';
?>
7. Go
import "fmt"
func main() {
fmt.Println("Hello, World!")
}
8. C
#include <stdio.h>
int main() {
printf("Hello, World!");
return 0;
}
9. Swift
print("Hello, World!")
10. C#
Console.WriteLine("Hello, World!");