Warning: Creating default object from empty value in /home/patricknevindwyer/digilutionary.com/wp-includes/functions.php on line 292
digilutionary.com
Patrick Dwyer

Comparative Programming : Echo

in News, Comparative Programming by patrick


Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/patricknevindwyer/digilutionary.com/wp-includes/functions-formatting.php on line 76

Every programmer has their favorite string, saying, quote, or characters that they use when writing a Hello, World example program. The Hello, World is fairly straight forward, and the only outlet of personal style is in what your program says to the world. This comparative programming example bypasses the process of choosing the perfect Hello, World string. In this example each program needs to echo back whatever is on the command line when the program is started, effectively an open ended Hello, World.

These examples were written on OS X, so a full complement of Unix style tools and compilers were available. Where extra steps were needed to use a language or toolset, the details are provided. All of the programs here are easily compiled and run from the command line.

Example input:

[program] Hello world!

Expected output

Hello world![newline]

Our examples:

Java
Perl
Python
C
C++
C#
Objective-C
Ruby
OCaml