Programming Windows: Hello, World (Premium)

The C programming language was created in the early 1970s by Dennis Ritchie, an engineer at Bell Labs who was looking for a more efficient way to write Unix utilities. As a low-level and loosely typed procedural programming language, C proved to be so useful and so popular that it was later used to reimplement the Unix kernel.
(Fun aside. The C programming language was so named because it was based on an earlier Dennis Ritchie (and Ken Thompson) effort called B, which was itself derived from something called BCPL. B was originally type-less, but Ritchie evolved it to support data typing, first with “New B” and then finally with C. Ritchie also co-designed Unix, in case you were worried about his technical bona fides.)
Of course, developers needed to learn how to use the then-new language. So, another Bell Labs engineer named Brian Kernighan created the first C tutorial and then expanded that into a book that would become The C Programming Language. He enlisted Ritchie as his coauthor, making the book the authoritative reference for the language.

The first edition of The C Programming Language was published in 1978, but the second---and still most current---edition was released in 1988 to address C’s ANSI standardization, which was made official in 1989.

If you’re familiar with the Windows timeline, you know that the first version of Windows was released in 1985, well before this standardization. So, the Microsoft C compilers used by early Windows developers used pre-ANSI---or “K&R,” for Kernighan and Ritchie---implementations of the C language.

In any event, among The C Programming Language’s many influences is the use of a simple introductory program that shows off some key aspects of the language. It’s called hello, world and this is how it appears in the second (ANSI-compliant) edition of The C Programming Language:
#include <stdio.h>

main()
{
   printf("hello, world\n");
}
Even non-programmers should deduce that this program prints the words hello, world to the screen. The screen, in this case, being the text-only monitors that were common in that day.

Virtually every programming tutorial or book ever written includes some variant of hello, world, and as this series of articles progresses, I’ll demonstrate what that looks like in environments like Win16/Win32, MFC/C++, .NET, WinForms, WPF, UWP, and so on.

But what’s interesting about hello, world here in 2019 is that it still works exactly as it did in 1988. That is, with the free Visual Studio 2019 Community Edition installed and configured with the “Desktop development with C++” workload, one can type in the above program, compile it (with the C++ compiler, which also knows how to process straight C), and create an executable that, sure enough, prints the words hello, world to the screen. Or, I should say, to the command prompt.\

To do so, create a file named hello.c with Notepad (you’ll need to change the “Save as type...

Gain unlimited access to Premium articles.

With technology shaping our everyday lives, how could we not dig deeper?

Thurrott Premium delivers an honest and thorough perspective about the technologies we use and rely on everyday. Discover deeper content as a Premium member.

Tagged with

Share post

Please check our Community Guidelines before commenting

Windows Intelligence In Your Inbox

Sign up for our new free newsletter to get three time-saving tips each Friday

"*" indicates required fields

This field is for validation purposes and should be left unchanged.

Thurrott © 2024 Thurrott LLC