Welcome to my attempt of sharing what goes on in my head. To some extend a lot of what I will be recording here will be for my own record but feel free to comment and contribute. I am a lot things ( Husband, Developer, Entrepreneur ammongst others) but the thing I love being most is a developer and since this is my first post on my new blog I’m going to do the traditional hello word thing.
During my time as a developer / entrepreneur I have dabbled in many programming languages and as many of you know the traditional way of learning a new programming language is to write a Hello Word program. Here follows the wickass hello world collection.
[one type=”separate”]
Hello php
<?php
Print "Hello, World!";
?>
OR
[/one]
<?php
Echo "Hello, World!";
?>
[one type=”separate”]
Hello Javascript
<script type="text/javascript">
document.write('<b>Hello World</b>');
</script>
OR
<html> <head> <title></title> <script type="text/javascript"> function HelloWorld() { myname = "Joe"; alert(myname); } </script> </head> <body> <a href="javascript:HelloWorld()">Hello</a> </body> </html>
[/one]
[one type=”separate”]
Hello Python
# Using the interpreter
print "Hello World!" # Note that the "\n" is automagic after each print.
# As a function
def hello():
print "Hello World!"
return # This is optional, since you aren't returning anything.
# Using the commandline (
import os
os.popen("python -c \"print 'Hello World!'\"")
# Just python -c "print 'hello world!'" at the commandline.
[/one]
[one type=”separate”]
Hello C#
// Hello1.cs public class Hello1 { public static void Main() { System.Console.WriteLine("Hello, World!"); } }
OR
// Hello2.cs using System; public class Hello2 { public static void Main() { Console.WriteLine("Hello, World!"); } }
[/one]
[one type=”separate”]
Hello Ruby
class HelloWorld
def initialize(name)
@name = name.capitalize
end
def sayHi
puts "Hello #{@name}!"
end
end
hello = HelloWorld.new("World")
hello.sayHi
[/one]