3 ms·
Unrelated, but I often wonder why people insist on a program that prints a string to the screen as the universal best first program. It's very practical, but it
by tel 16y ago
Unrelated, but I often wonder why people insist on a program that prints a string to the screen as the universal best first program. It's very practical, but it's also so tangential to what programming is.
Just delay compilation until the third week and you'll be able to start the dialogue at objects, "is a", "has a", actions, properties. This is the language we use to deal with the world already and though it's got funny syntax attached, it's not a foreign concept to anyone. Talk about the runtime system and it's expectations later.
(Edit: I think this is also why a lot of people hate the IO monad in Haskell so much. Side effects are actually an advanced topic in pure FP so much of the literature on IO is based around flaky metaphors and "don't worry about how this works" just to get people printing things ASAP. If you just use the REPL and don't worry about implementing it then you can build up to understanding the interaction between IO and the RTS in a sensible way.)
- endtime 16y ago>Unrelated, but I often wonder why people insist on a program that prints a string to the screen as the universal best first program. It's very practical, but it's also so tangential to what programming is. The point is that the first step is getting your environment set up so that you can write[, compile,] and execute code. Printing a string is just a conveniently trivial program.
- tel 16y agoIt's true that that's the first step to programming as a craft, but it's hardly the first step to programming as a way of thinking, managing complexity, and building abstraction. That's like saying the first step to flying an airplane is turning the ignition. Yes, that's true, but without a firm idea of what's going to be happening after that point you're only going to hurt yourself by turning that key. It's something that comes to head when learning to fly a plane/program.
- Avshalom 16y agoIt's true that that's the first step to programming as a craft, but it's hardly the first step to programming as a way of thinking, managing complexity, and building abstraction. But programming is a craft, so how is the first step tangential.
- endtime 16y ago>It's true that that's the first step to programming as a craft, but it's hardly the first step to programming as a way of thinking, managing complexity, and building abstraction. It's the first step when learning a new language, which is exactly when Hello World programs are customary.
- dkarl 16y agoIt goes straight to self-expression and provides a program that is customizable in a way as unlimited as language itself. A beginner can put in a string that no one else would ever say and then have the satisfaction of seeing a program that no one else could have written. It instantly illustrates how programming enables individuality, self-expression, and control. Also, for environments where saving code in an editor doesn't instantly cause a change in behavior (compiled languages, web programming, working with a running Lisp image) it gives beginners an easy way to learn and troubleshoot the process of deploying their code.
- kalid 16y agoI think the main benefit of the "Hello, World!" programs isn't the action it accomplishes, but the infrastructure needed to get it up and running. It's the minimum viable program which produces something that the beginner can tell "it worked". You need to have your text file, download & install the compiler, figure out how to compile, and finally execute the output -- all of which are non-trivial steps for a first timer. Once you get the plumbing set up, you can then introduce other things about the language.
- jablan 16y agoQuite the opposite, unless you are a born plumber, somehow ended up learning programming. Downloading and installing the compiler, and learning how to compile just to get things going is to programming what putting on a condom is to a... you know...