Live data from Hacker News

Ask HN: What is the coding exercise you use to explore a new language?

news.ycombinator.com

71–73 of 73 posts

Re: Ask HN: What is the coding exercise you use to explore a new language?

#71
If it's a game engine, I tend to do a simple port of my Proximity game[1] to it. I don't usually finish it enough to release it, though (I probably could and should in retrospect). I've done that for Flash, C#/XNA (eventually released on Xbox Live Indie Games as "Proximity 2"), J2ME, Java/Kindle, iOS/Objective-C (eventually released, but no longer in the store), Python (just a command line ASCII version), LUA/Pico-8 (nearly done, I just need to force myself to spend a couple weekends and finish it up), PlayDate (functional, mostly a port of my Pico-8 version they are both LUA-based, but it's not pretty and I don't have my PlayDate yet for testing to feel comfortable releasing the game yet), C++ (mostly made this for my portfolio for game dev jobs), and probably a couple others I'm forgetting.

Currently working on a new version in C#/Monogame, and next version after that will probably be Unity so I can make a VR version, something that's on my bucket list. Also at some point I'm going to make a new web version again using Javascript/Phaser (already made another simple game in Phaser, so it shouldn't be too hard, just need to actually do it).

It's been going slow though since I have so much less spare time and energy nowadays, though.

[1]: https://www.newgrounds.com/portal/view/183428

Re: Ask HN: What is the coding exercise you use to explore a new language?

#73

Command line tool that ingests an arbitrary-length (but assumed finite) stream of lines, parses each line to a number, computes the Welford single-pass algorithm for mean and standard deviation, and prints the output nicely to the console. It's a good introduction to handling input and output, string manipulation, error handling, abstractions for iteration (or lack thereof), and language performance characteristics.…

FWIW, I did a straightforward impl in Nim that was ~10X faster than the Python version in your repo.
Post reply on HN