Live data from Hacker News

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

news.ycombinator.com

11–20 of 73 posts

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

#12
I write a bittorrent node. It goes over many topics I'm interested in: potrntially low-level networking, storage, bits and bytes fiddling, concurrency. The protocol is shockingly simple, and the end result is both easily testable and actually useful.

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

#13
I work through a good portion of the Crafting Interpreters tutorial (you create an interpreter for the toy Lox programming language). https://craftinginterpreters.com/contents.html

Gives me a chance to learn the new language with a project that's decent in size, without it being debilitating. Plus, it is fun writing an interpreter.

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

#14
I commonly build a name generator based on travesties or Markov chains. I can write a simple version of it in a few minutes in a familiar language, but it exercises file IO, some simple data structures, string operations, and some randomization. Gives me a good first general idea of what it will be like to work with a new language.

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

#16
I want an official certification of 140 IQ and your comp sci degree from everyone posting here. Otherwise do fizz buzz and go do some easy level problems on code wars. Much more makes little sense when you don't even know the array initialization syntax yet.

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

#18
I use Advent of Code every year to improve my understanding/facility with some language that isn't a strength of mine. The benefit of doing that is that it's well-paced and interesting to me. The downside is that at least 35% of AoC is algorithmic and once you discover the "trick", redoing that AoC puzzle in a new language is less interesting (though it will still drive understanding of the new language).

If you wanted smaller exercises, you could take some of the leetcode exercises and grind through them on your own (outside of the leetcode framework if your language isn't represented there; if it is represented there, the Leetcode easy and medium are pretty good and there's loads of them).

Post reply on HN