Ask HN: Hello, World

1 points by joaogui1 ↗ HN
People always talk about coding "Hello, World!" as a rite of initiation in a new programming language, but some folks have more elaborate programs/algorithms that they implement when learning a new language as a benchmark for their language learning (https://www.xavierllora.net/2014/03/22/yet-another-cga-implementation-now-in-haskell./) What is the program you always code in a new language to test how much you've learned?

3 comments

[ 3.6 ms ] story [ 19.2 ms ] thread
The program "Hello World" isn't anything to do with learning the language, it's about:

* How do I create a program?

* How do I store a program?

* How do I run a program?

* How do I get the program to output something?

So your first statement seems to miss the mark.

To answer your question, if I'm learning a new language it's usually because I have a specific problem to solve, so I write "Hello World", and then start to grow the program into what I need. I don't have a toy problem to implement as a test.

Probably not the answer you wanted.

* How do I create a program (in this language)?

* How do I store a program?

* How do I run a program (in this language)?

* How do I get the program to output something (in this language)? You don't run C programs by calling python a.c, you run them by first compiling and then running the result. And yeah, I put the link there to illustrate what I was talking about, and it's not about why and how you learn a new programming language.

It's usually either: arbitrary like Advent of Code or Project Euler to see what it's like using the new language for sorts of things I know how I'd do in ones I normally use; or start/port my latest project idea. Most often the back-end to some web app that does something specific or perhaps a library to see how far a bad type system can go (e.g. typesafe SQL queries in Java vs Kotlin or F#).