[CPL-02] ── The Most Overrated Line of Code

Everything starts with a greeting, except C starts with a #include

Is “Hello World” a Universal Constant?

So, “Hello, World”—this little phrase is like the secret handshake of our programming community. It feels like we’re all part of a hidden club that recognizes this phrase but never really talks about it. And since no one has claimed to be the current leader of this world, I guess I’ll be its hello, or something like that.

By now, you’ve probably heard, read, or even seen this phrase a million times. All those tutorials start with it to show you how to print something to the screen: “Hello, World,” in our case.

But let’s think about it for a second. Have you ever wondered how long it takes an author to write this famous phrase in their tutorial? We could calculate it as a couple of lines divided by the time it takes to write each line.

Quick Math

Let:

Then, we can express the relationship as follows:

T = N \cdot t

If we want to express the average time taken per line in terms of the total time and the number of lines, we can rearrange the equation:

t = \frac{T}{N}

I am just joking; this was all to test how LaTeX works on my site. I am not that obsessed with “Hello, World.”

So, whether you’ve read it, heard it, or even tried to eat it (not recommended!), “Hello, World” is still a big deal in our journey through the programming world.

Our First Program

This might or might not (hopefully not) be your first encounter with C, but no worries—we will see it together, and it’s easy!

#include <stdio.h>

int main(void) {
  printf("%s\n", (char *)&(long long int){0x6E6576616D6E6973}); return 0;
}

// output: sinmaven

Looks hard? Pretty much it is at first glance, but it’s pretty cool to look at it and try to figure it out. For example:

You might be wondering why I skipped the (char *)&(long long int){0x6E6576616D6E6973} part. Well, it’s up to you to try to figure out what it is, because this is not just a tutorial for you to read, but to encourage your research along with me. I won’t be spoon-feeding you, at least not for free.