Mike Polan

Home

Hello World!

Published Sep 12, 2020

Fittingly, I thought that my first entry on this site would be a “hello world” post. I’ve been learning many different programming languages over the years, most of which started with simple code to print the famous Hello, world! string to console. I haven’t really thought much about it, but in retrospect, I must have written a whole slew of these toy programs to get myself bootstrapped on whatever language I was studying. In the vast majority of cases, I found this to be enough of a starting point to at minimum get my developer environment set up, and required tooling configured, and have a working sample to build up from.

Funny enough, this got me thinking: my very first “hello, world” was actually anything but simple. I can still recall a code snippet I was trying back when I tried learning C++. Keep in mind, this was in the early 2000s, and also my first attempt at any programming language whatsoever.

#include <iostream>

void main() {
  std::cout << "Hello, world!" << std::endl;
}

Notice something off about that code? That’s right, a main with a void return type. I can fondly recall scratching my head as a newly minted, self-taught programmer when I typed this example out from a book I was using at the time, only for the compiler to immediately reject it.

Of course, it wasn’t until later that I realized the book I was learning from was significantly out of date. It may seem trivial, but for someone who never touched code before, it was certainly a baffling experience to try and decipher what was going on without the help of the easily accessible Internet we have today. In a way, I suppose this made me appreciate the fact that nowadays one could easily copy/paste an error message into (insert_your_favorite_search_engine_here) and there’s a good chance someone will have already run into the issue. It’s not always that black and white, but it certainly helps to not have to thumb through dusty old books with obsolete syntax.

That’s it for now, cheers!