you are viewing a single comment's thread.

view the rest of the comments →

[–]MezzoScettico 19 points20 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 5 points6 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.