Why this Hello World writing?
Well, for at least a few reasons.
One, to help others understand the diversity of different
programming languages in one of it’s simplest terms to humans.
Two, at a glance to compare the languages.
Three, just to see what is available and for the curious and fun.
Oh, and a gentle reminder on how to start the first step, and which.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In Ruby:
p ‘Hello World’
Transcript show: 'Hello, world!'.
print(‘Hello World’)
print "Hello World\n";
<?php echo ’<p>Hello World</p>’; ?>
package main
import “fmt”
func main() {
fmt.Println(“Hello, 世界”)
}
1: <script type="text/javascript">
2: <!-- to hide script contents from old browsers
3: document.write("Hello World!")
4: // end hiding contents from old browsers -->
5: </script>
In ActionScript
package {
import flash.display.*;
import flash.text.*;
public class HelloWorld extends Sprite {
private var greeting:TextField = new TextField();
public function HelloWorld() {
greeting.text = "Hello World!";
greeting.x = 100;
greeting.y = 100;
addChild(greeting);
}
}
}
<%@ Page Language="VB" %> <html> <head> <title>ASP.NET Hello World</title> </head> <body bgcolor="#FFFFFF"> <p><%= "Hello World!" %></p> </body> </html>
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
MessageBox.Show("Hello, World")
End Sub
End Class
PRINT "Hello, World!"
#include <iostream>
int main()
{
std::cout << "Hello World!" << std::endl;
return 0;
}
In C Programming
main( ) {
printf("hello, world");
}
class myfirstjavaprog {
public static void main(String args[]) {
System.out.println("Hello World!");
}
}
program HelloWorld;
begin
writeln('Hello World');
end.
(print "Hello World")
In COBOL
000100 IDENTIFICATION DIVISION. 000200 PROGRAM-ID. HELLOWORLD. 000300 000400* 000500 ENVIRONMENT DIVISION. 000600 CONFIGURATION SECTION. 000700 SOURCE-COMPUTER. RM-COBOL. 000800 OBJECT-COMPUTER. RM-COBOL. 000900 001000 DATA DIVISION. 001100 FILE SECTION. 001200 100000 PROCEDURE DIVISION. 100100 100200 MAIN-LOGIC SECTION. 100300 BEGIN. 100400 DISPLAY " " LINE 1 POSITION 1 ERASE EOS. 100500 DISPLAY "Hello world!" LINE 15 POSITION 10. 100600 STOP RUN. 100700 MAIN-LOGIC-EXIT. 100800 EXIT.
title Hello World Program (hello.asm)
; This program displays "Hello, World!"
dosseg
.model small
.stack 100h
.data
hello_message db 'Hello, World!',0dh,0ah,'$'
.code
main proc
mov ax,@data
mov ds,ax
mov ah,9
mov dx,offset hello_message
int 21h
mov ax,4C00h
int 21h
main endp
end main
#!/bin/bash echo Hello world
PS> 'hello, world!'.ToUpper()
Above may be some of the more popular ones, but there are
easily more than a hundred Programming Languages around the world,
and mor comparisons here. Wait, there’s more, how about Hello World in Markup Languages?
<html>
<head>
<title>Tutorial: HelloWorld</title>
</head>
<body>
<h1>HelloWorld Tutorial</h1>
</body>
</html>
In XML <?xml version="1.0" encoding="UTF-8"?> <text> <para>hello world</para> </text>
Hello World in Web Application Frameworks?
-
$ rails hello -
$ cd hello -
$ rails generate controller hello - Open the file config/routes.rb. Almost at the bottom (line #57) is this line:
# match ':controller(/:action(/:id(.:format)))'Remove the # in front so the line looks like:
match ':controller(/:action(/:id(.:format)))' - Create a file named index.html.erb in app/views/hello containing the text ‘Hello world’.
-
$ rails server
What about Hello World in a Web Visual Rapid Application Development platform?
Just click and drag, change the caption to Hello World! 15 secs screenshot below.
Thank you and credit to all codes authors with links.
Advertisement










