Ask HN: Which programming games helped you become a better programmer?

84 points by gpa ↗ HN
There are numerous programming games available that claim to teach you how to code. However, I couldn't find any posts on HN that confirmed or denied their usefulness. Except this one, but it's from 5 years ago: https://news.ycombinator.com/item?id=13566247

1. Are there any good beginner programming games in widely used programming languages (like C, C++, C#, Java, JavaScript, Python, PHP)?

2. Are there any programming games that have helped you become a more advanced programmer (or a better programmer)?

I am interested in games that are not just fun, but also teach you programming useful in the real world (maybe not directly, since it's a game, but still).

89 comments

[ 3.6 ms ] story [ 154 ms ] thread
If you're willing to be charitible of where exactly programming comes in while playing a game - I would say creating cheats or bots for video games.

These days, you will most likely have your account restricted and banned from an entire ecosystem of games if you try this, but back in the days where flash was dominant you could do lots of fun things with little risk. Many fun times in Runescape making dollars off my bots that ran air runecrafting bots, or Fist of Guthix bots in F2P and selling the GP I got for the rewards. Does not need to be very complicated either IMO.

For a direct answer, I think Minecraft has a lot of options for learning programming without really learning programming. I have never played it but I have seen what others have done in what I believe is creative/builder mode.

2 games come to mind...

- Turing complete: helped me understand how a computer works, how binary works and what the instructions and operations look like at the hardware level

- Factorio: helped me understand broader aspects like availability, fault tolerance, decoupling, team management, prioritization.

leetcode.com is an interesting puzzle game and is language agnostic.
Goretek and the Microchips, but y'all probably a little young for that. :-D
Check out flexbox froggy. There are good games about git too. I tried the Twilio games but I think those are better for young kids. It takes too long.
Maybe not an exact answer to the question being asked, but when flexbox was first introduced a few years back, I remember being quite overwhelmed by it, but the game that helped me "grok" it was Flexbox Froggy: https://flexboxfroggy.com/

Even now, when I am working with frontend designs, I sometimes am mentally picturing my elements as frogs that need to be placed in the right place :D

I learned flexbox from a game too! I think it was Flexbox Tower Defense.
I think some of the Zachtronics games may be helpful to learn about Assembly.
Factorio.

Factorio doesn’t exactly have code. However, it’s very much a game about systems, and how to efficiently build and manage them.

In fact, Shopify expensed the game for their employees [1]

1: https://twitter.com/tobi/status/1294330081452666882

I think of Factorio as a circuit board designing game more than programming. Still fun as heck though.
Dunno, I think it captures several of the skills needed in programming, not the actual writing code, but both refactoring and optimization are translated fairly accurately.
Meh, lol. From my spaghetti factory you would never have guessed i was a software dev by day.
I had a revelation when I realised the problems I had when building a base in Factorio were basically the same I had when programming, just visualised in a more intuitive way.

Translating the solutions of my Factorio problems into my real world problems worked like a charm.

Whenever I play this, for days afterwards I’m in a state of mind looking for anything in my life to automate.
I learned Forth thanks to Minecraft RedPower2 mod. Whether it actually made me a better programmer can be disputed.

I don't think any game will make you a better programmer. It can get you interested, sure, but becoming a better programmer is only so much related to having in-game fun, and is often a matter of more self-discipline.

Well, I've enjoyed these games as for fun, but they did provide an intellectual challenge: TIS-100 https://store.steampowered.com/app/370360/TIS100/ SHENZEN I/O https://store.steampowered.com/app/504210/SHENZHEN_IO/ Hacknet https://store.steampowered.com/app/365450/Hacknet/ Uplink https://store.steampowered.com/app/1510/Uplink/

As for becoming a better programmer, it's all about practice. CodeWars might be what you're looking for: https://www.codewars.com/

> all about practice

and communication, and writing simple readable code

for a lot of programmers solving "tricky" algorithmic questions are more the exception then the norm

In turn while it's a must have skill for senior programmers for mid level programmers improving skills around communication, writing simple easy to read and understand code often is much more useful.

Edit: and being able to abstract properly/see beyond the marketing (especially for web).

Codewars is a poor recommendation for becoming a better programmer, the solutions are sorted by popularity and so generally "cool" solutions are at the top. I've yet to see a clear/good python solution anywhere near the top.

I suppose you could just do the tasks and ignore the website itself.

I got more confident in my Assembly skills after playing a lot of TIS-100.
I'll reply mostly on 2. - most of these were already mentioned in the previous thread - [0] Grasshopper, [1] SpaceChem (awhile ago), [2] 7 billion humans (haven't finished it yet, and haven't played for a while), [3] Human Resource Machine and [4] TIS-100. They mostly help to build habits, and persistency, not just being fun.

The "real world" always provides much more interesting "gameplay", but it is sometimes with a too steep learning curve. :)

Edit: And I've been ninja'd by another user, but just remembered that there is another in my wishlist - [5] Baba is you (haven't played it, though)

[0] https://grasshopper.app/ [1] https://zachtronics.com/spacechem/ [2] https://tomorrowcorporation.com/7billionhumans [3] https://tomorrowcorporation.com/humanresourcemachine [4] https://zachtronics.com/tis-100/ [5] https://www.hempuli.com/baba/

Adding to the Zachtronics' game TIS-100, there's also EXAPUNKS which is a fun programming puzzle game. You write programs for one or more bots which can then spawn more and communicate with each other. I haven't finished the game because I just play it on random occasions, but the challenges are interesting. There are also some head-to-head challenges with other players that fit a bit into the Core War vein, trying to maintain control of a television broadcast or similar things with points given for how long your video plays and points deducted for things like killing your opponent's process outright (versus just more clever and faster programs).
the game of having bills to pay.
To the list of Zachtronics games, I'll add Opus Magnum, which is the one that I found most rewarding.
Opus Magnum is the Zachtronics game that resonated most with me. It's visual, like SpaceChem, but I also like the setting and find the solutions to be very satisfying.
Kids these days...

Go read a book!

It doesn’t seem to exactly fit your description but Python Challenge (http://www.pythonchallenge.com/) has been incredibly fun and rewarding for me back in the day.

It’s a series of riddles that are meant to be solved using the python language. It’s really old now but I’m hoping that some library specific riddles are still relevant. Apart from those few, most of them should be language agnostic as well.

I’ve always wanted to create a similar thing to replicate the experience in JS but never gotten around to it.

Edit: oh also completely agree with most of the recommendations here. Particularly with TIS-100, Factorio and Human Resource Machine.

Okay, I've been nerd-sniped, there goes my Sunday night.

Counter-snipe: https://challenge.synacor.com

I can second the Synacor challenge. After writing the VM and completing the challenge, I ended up writing my own assembler and small compiler for it. Very fun.
Does Advent of Code count?
It seems that it counts by reading the description: "small programming puzzles for a variety of skill sets and skill levels that can be solved in any programming language you like. People use them as a speed contest, interview prep, company training, university coursework, practice problems, or to challenge each other." But since I haven't used it, you or someone else can have the final say. I was thinking of an addictive game with progressive complexity and time-limited challenges that make you feel like you didn't waste time because of the knowledge you've gained.
(comment deleted)
Any game that supports extension via modding is a potential to learn more about programming. I think when programming is the game, it’s kinda boring and feels too much like work.
OverTheWire wargames. I played first 10 levels, it's kinda fun, kinda frustrating but it made me read manuals of 'grep' and 'find' commands on bash. So it made me a better programmer for sure. https://overthewire.org/wargames/
If you want to learn assembly or how computers work at a lower level, play TIS-100 by Zachtronics.
I've already mentioned it in another comment, but (being unable to edit my question already) this is what I was thinking when I asked the question: an addictive game with progressive complexity and (possibly) time-limited challenges that make you feel like you didn't waste (hours of) time because of the knowledge (skills) you've gained.

I guess, I have to try some of the games that everyone has mentioned.