How Many Ways to Say “Hello World”
So, I’ve been intending on writing this silly article for awhile, but have not got around to it until today. Anyways, every time I hear someone mention a new language and then look into it, the first thing I notice is how they print the standard “Hello World” statement to the screen. After the first few times, I just put it aside and ignored it. But then I started noticing a more annoying trend: nearly every language uses a new verb to express “Hello World” (I’m convinced developers are doing this on purpose now). So, my question is: how many ways can we say “Hello World”? For once, it would be nice if we had some consistency and languages used the same verbs for similar practices. If I had a dime for every time I picked the wrong verb because of switching to a different language, I could probably quit my job. Switching in and out of languages now is a daily part of any Software Developer’s job. No one language works for every situation. You should always pick the language to do the best job (but that’s another article for another time). Plus, printing to the screen is not the only inconsistency we have. Simple things like trimming (chop, trim, etc) or taking a substring (sub, substr, substring, etc) have several variants. It really gets annoying as you learn more and more languages. I’m not saying languages should not have their differences; obviously they should. That is what makes them unique and powerful in their own ways. All I’m saying is for things as simple and common as printing to the screen, let’s all agree on a standard verb. Please! :)
Anyways, that being said, here is my list I have been compiling. Drop me a comment if you can think of others and I will update the list accordingly. It would be interesting to see just how many ways we can truly say “Hello World”!
| Verb | Language(s) |
|---|---|
| System.out.println | Java |
| echo | PHP, Bash |
| cout | C++ |
| Perl, PHP, BeanShell, Lisp, Python | |
| Console.WriteLine | Visual C# |
| document.write | Javascript |
| println | Groovy, Scala |
| puts | Ruby, Tcl/Tk |
| printf | C, Objective-C |
| io:formar | Erlang |
| write | Fortran, Prolog |
| Writeln | Pascal |
| display | Scheme |

++++++++++[>+++++++>++++++++++>+++>+<<<++.>+.+++++++..+++.>++.<.+++.——.——–.>+.>.