Ask HN: What is the coding exercise you use to explore a new language?
21–30 of 73 posts
Re: Ask HN: What is the coding exercise you use to explore a new language?
#22John Carmack re-implementing Wolfenstein 3D to learn Haskell comes to mind.
Re: Ask HN: What is the coding exercise you use to explore a new language?
#23I also recommend this same exercise to others through the book "The Ray Tracer Challenge" [1] by Jamis Buck, because it describes an entire implementation of a raytracer in pseudocode. Beginners mostly just need to plug-in their language of choice & still end up with a satisfying visual result. Experienced programmers can extend it by adding the ability to load non-trivial .obj models, which will necessarily motivate adding concurrency, bounding volumes, & other general performance improvements.
I'm planning on tackling it again in Elixir soon, which should be fun & interesting.
EDIT: Almost forgot to mention the free bonus chapters [2] that get you started on bounding volumes (AABB), soft area lights, and texture mapping.
[1] https://pragprog.com/titles/jbtracer/the-ray-tracer-challeng...
Re: Ask HN: What is the coding exercise you use to explore a new language?
#24Re: Ask HN: What is the coding exercise you use to explore a new language?
#25It covers sockets, string handling, and byte handling.
Re: Ask HN: What is the coding exercise you use to explore a new language?
#26I typically write a raytracer while attempting to stick to a small set of "best-practices" for the language I'm trying to learn. I also use this exercise from time-to-time to test new language features (for example C++20 ranges/coroutines recently). I also recommend this same exercise to others through the book "The Ray Tracer Challenge" [1] by Jamis Buck, because it describes an entire implementation of a raytracer…
Re: Ask HN: What is the coding exercise you use to explore a new language?
#27Python has been stuff like Pi hats with sensors, or using Pandas to analyze VAERS or Kaggle data. I assume this is similar for other scripting or backend languages/projects.
UI could be something like using Angular to build a simple site, or Android to build a simple app.
Basically find something that's simple and functionally similar to what you think you want to achieve with the language. At least for me, I want to learn a language to use it on a project, not just learn it for the sake of learning it.
Re: Ask HN: What is the coding exercise you use to explore a new language?
#28I 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?
#29This way I can see how to input data, display it and how I can operate with the database.
It's simple.
Sadly for Rust and MongoDB I tried that 5 times and never got to the point that it compiles. It just wasn't intuitive and the error messages didn't make sense. For Rust also I went through the tutorial, because I really wanted to like it and switch to it, but compared to Go it was just too complicated. I didn't understand the game, boxes ownership move unpack... it all didn't make sense . I digress but yeah, a guestbook is usually my 1st application.
Re: Ask HN: What is the coding exercise you use to explore a new language?
#30- Simple scope, easily expendable. - Stack as a simple data model. - State machine for number entry.