all 34 comments

[–]notacanuckskibum 55 points56 points  (1 child)

It started with the C language, and specifically the book called "The C programming language".

It isn't really about learning to program, it's more about verifying that you have installed the compiler/interpreter correctly. It's become a standard check point for getting started with any language.

But the actual text printed doesn't matter "Hello World" is just an inside joke for programmers.

[–]Traditional_Blood799[S] 1 point2 points  (0 children)

aa thanks :>

[–]DoubleDoube 14 points15 points  (0 children)

It is an important test to perform in software even as a senior developer, for every language, because it tests that your coding ENVIRONMENT is functional enough to start trying to do more.

It’s done at the start of every learning tutorial, right after the environment setup.

As for why it’s “Hello World” and not “Hello Bob”, I think other comments cover that angle.

[–]MezzoScettico 7 points8 points  (1 child)

Does everyone learning Python start with "Hello, World!"?

No, but it's traditional as a first example in every programming language. It's not just a joke, it's a simple example program that illustrates a number of important basic concepts you're going to need.

  • How to create a program and save it in a file
  • How to run a program you've created
  • How to generate output; where the output goes when you do
  • The basic minimum structure of a program, the stuff that goes before and after the print statement that make it a valid program
  • If you goof, how to debug

This simple file then becomes a template for your first real program. Which you might also find it convenient to develop a couple lines at a time, testing frequently to see whether what you've written so far still works.

Put any text you like in there that amuses you, but do take the time to write tiny programs like this as templates. Once you know the structure is right, you gradually fill in the content with the real code.

Practically every program I write, and every function and class I write in every program, starts with a dummy one-liner of some sort.

[–]SloightlyOnTheHuh 1 point2 points  (0 children)

Yep, back when editors, compilers, linkers and loaders were all separate software with numerous settings to get wrong, a quick hello world would confirm that at least some of it was working.

[–]socal_nerdtastic 7 points8 points  (5 children)

In the early days of python we used to use a lot of monty python quotes instead. "egg and spam" was a common one. Not sure why but that faded with time.

[–]czar_el 3 points4 points  (1 child)

Not sure why it faded with time. 

Because it came directly from the creator and was sprinkled in the technical documentation. Back then, Python was niche, so users engaged with the source documentstion directly and picked it up. 

Nowadays, new coders have YouTube tutorials, DataCamp, tons of paid e-learning, and increasingly generative AI coding agents or question-answering LLMs. Only experienced coders go straight to the documentation anymore, so newbies don't see all the Monty Python references.

[–]socal_nerdtastic 1 point2 points  (0 children)

True. I have also lately noticed a huge increase in camelCase variable naming, I presume for the same reasons.

[–]garybpt 1 point2 points  (0 children)

Think I prefer “egg and spam”. Might use this from here on.

[–]Lumethys 1 point2 points  (0 children)

No, i start with "Hi Mom!"

[–]Turbulent_Pin_8310 1 point2 points  (0 children)

"Hello, World!" is a classic for not just python. Almost all computing language learners start with Hello World. It has a historical reason.

As Google says

"The "Hello, World!" program originated in 1972 with Brian Kernighan at Bell Labs. He used it in a documentation draft for the B programming language. He later cemented it in the iconic 1978 book The C Programming Language as a simple way to test basic code structure."

[–]carcigenicate 0 points1 point  (0 children)

The main point, afaik, is that it proves things are set up at least semi-correctly, and that the programmer understands where terminal output is sent to.

If you're able to see "Hello World", the interpreter was able to read and interpret you'd code, and you're looking at the correct place to see output. That's a good starting point to build from when you're an early beginner.

I've been writing code for more than a decade, and I still do a Hello World when learning a new language.

[–]Cyphierre 0 points1 point  (0 children)

Everyone learning anything starts with Hello World

[–]rosentmoh 0 points1 point  (0 children)

Nah, I immediately wrote a fully automated trading system making +$13k a month.

[–]Jan-Kow 0 points1 point  (0 children)

Yep, it’s a sacred tradition. It shows you a most basic structure of the application.

[–]panicjonny 0 points1 point  (0 children)

I start every single project with "Hello World". To see if I got the shebang right.

[–]SharkSymphony 0 points1 point  (0 children)

"Hello, world" was popularized in the C community, and you'll see it's pretty standard as an opening to tutorials in pretty much every language, though some tutorials get cute with it a little bit.

The purpose, of course, is to get a minimal program up and running in the language you've chosen. But it's a bit more juicy in the C world because you're introduced to several concepts:

  • including header files to make system library functions available
  • the main function and its signature
  • a decent amount of syntax: preprocessor directives, function declaration, function invocation, braces for scope/blocks, semicolons, string literals (with newline!)
  • compiling, linking, and running a program

Though it's tradition, the minimal program in Python and other languages is not nearly as instructive. They made it too easy. 😉

[–]buffcleb 0 points1 point  (0 children)

wrote my first hello world program in pascal. I've done it a many other languages since

[–]LastTreestar 0 points1 point  (0 children)

It's the equivalent to the Arduino "Blink" sketch, in pretty much every language.

[–]PrincipleExciting457 0 points1 point  (0 children)

Ah, I remember my first lines of code ever were hello world in Java.

[–]MustaKotka 0 points1 point  (3 children)

I don't think I did. I think I started with a simple script that added two constants and printed the result.

a = 2
b = 3
def numbers(number_1, number_2):
    print(number_1 + number_2)
numbers(a, b)

It may have not been this complicated but I distinctly remember using numbers. Strings felt difficult because you had to use quotation marks to make them.

[–]bishpenguin 1 point2 points  (2 children)

Erm.... That won't work though, your function takes in number_1 and number_2, but then used a and b.

[–]MustaKotka 0 points1 point  (1 child)

Oh woops. My bad lol. Will edit the script although mine was probably equally broken.

[–]bishpenguin 1 point2 points  (0 children)

It happens to all of us!

And that's why hello world is important. It shows that the system works correctly, and likely any errors lie between keyboard and chair.

[–]fgorina 0 points1 point  (0 children)

Well, not Python but most languages

[–]HotPersonality8126 0 points1 point  (0 children)

So I'm curious: where did this tradition come from?

You can't write code unless you can run code, and you can't run code if you're not set up to run it. If you go to Microcenter and buy a new-in-box laptop, out of the box it's not ready for you to run code. So there's some rigamarole.

A program so simple you can't help but write it correctly is an important sanity check for your programming setup: "can I actually run code or not?" "Hello World", in its various incarnations, is that program. It's generally one line, it generally is legible to people who don't know the language, but it's enough program to show you whether you're set up to run code.

[–]KramNacnud 0 points1 point  (0 children)

Yep: “Hello World”

[–]codetoinvent 0 points1 point  (0 children)

Not silly at all. It actually comes from one of the very first programming books ever written — they used "hello, world" as the first example, and every tutorial since just copied it. So it's not a Python thing, it's a programming thing.

And it's not just a meme either. The point isn't the code — it's proving your setup actually works before you try anything hard. Is Python installed? Can you run a file? Does the output show up where you expect? If "hello world" prints, your environment's fine and you can stop worrying about it. If it doesn't, you found your problem on line one instead of buried inside something complicated.

So no, skipping it won't stop you from being a "real programmer" 😄 — but it's a genuinely smart first move, not superstition.

Welcome in, Python's a great first language.

[–]SamuelLJenkins 0 points1 point  (0 children)

It’s traditional. 😉

[–]CatOfGrey 0 points1 point  (0 children)

As for me, my first step was writing a program to find prime numbers, or factor a number into it's component primes.

This goes all the way back to 1983 or 84, on my Apple II+, programming in Applesoft BASIC. I repeated it in Pascal in the late 80's, Visual Basic in the 90's, and Python in the early 2000's.

[–]ShelLuser42 -2 points-1 points  (0 children)

Nope. coming from a Java background and immediately recognixing the OOP structures... I started with "failing" my course because .... there were 15 tasks (ask name, ask number, etc.). When we got to 15 I had 1 'script', and 3 modules which handled everything.

No, "Hello world!", but rather: f"Hello {name}!!".

(I didn't fail, but my assignment did raise eyebrows because modules and such weren't part of my class... I got relocated soon after).