Showing posts with label Hello World. Show all posts
Showing posts with label Hello World. Show all posts

Monday, May 21, 2018

Hello, World!

If you have ever learned a programming language, it is highly likely that you have come across "Hello, World!" Its ubiquity as the first program taught in any programming textbook derives from its use as an example program in the book "The C Programming Language" (without the exclamation).

To me, whenever I have come across a "standard" practice that has existed for a long time (for 40 years in this case), I always ask the following two questions:


  • Why did this become the standard practice in the first place?
  • Are those reasons still relevant? In other words, would it make sense for us to consider replacing the standard practice?

Why did "Hello, World" become the standard "first" program of a new language?

The general idea is clear - give the learner something tangible that can demonstrate the usability of the programming language with minimal effort - most programming languages require less than 10 lines to generate this text and it gets the learner to quickly engage with the interface/compiler etc. Here's what "Hello, World!" looks like in C:

#include <stdio.h>

void main()
{
           printf("Hello, World!\n")

But there is a secondary reason why this was beneficial as a teaching tool - it has a text output. Until very recently, there were a lot of useful programs whose end result was a text output. Even when graphical user interfaces (GUIs) started taking over, the output of many programs was still a text box with text. So, learning to interact with text as a medium was a critical building block in one's programming skills. 

Needless to say, the words "Hello, World!" themselves have no special significance and were used just because they gained traction in a couple of seminal books.

Should we consider replacing "Hello, World!"?

Since I have no strong opinion on this, here are some possible questions to ponder over: Considering that text is not the only (or even the primary) way we interact with technology in this day and age, should we consider having the first program manipulate videos, images and/or sound instead of text? Is the manipulation of multimedia a more useful programming building block? Would the younger generation be more likely to relate with programs that relate to multimedia? Would the growing importance of machine learning further upend our "primary" building block?