4 ms·
Can anyone recommend exercises for learning a new language. For example, something like "implement a class with these methods", or implement a function that doe
by tsomctl 8y ago
Can anyone recommend exercises for learning a new language. For example, something like "implement a class with these methods", or implement a function that does this. Something that is realistic, should only take an hour or two to implement for a competent programmer, requires you to learn more complicated features of a language, yet I can finish before getting bored or frustrated?
- bambataa 8y agoThings like Cryptopals (https://cryptopals.com/ https://cryptopals.com/) are good. But surely it's going to depend somewhat on the language and what things are easy/hard to do in that language?
- pauldix 8y agoFor Rust I've seen people reference Rust Koans (https://github.com/crazymykl/rust-koans https://github.com/crazymykl/rust-koans), but I haven't looked at that myself. I wanted a project that was sizeable enough to force me to use a good number of language features (but not all). I think the interpreter was a pretty good balance there, but it definitely took a time investment.
- tomjakubowski 8y agoI'd also like to hear what others do to learn languages. I like to write a little RPN calculator. The program's interface might vary depending on the language: to learn browser JS, you might do a DOM-based UI; for Rust it might be a CLI; for Go or Erlang maybe a line-oriented network service. Depending on the interface, this tends to exercise language and runtime features like: string handling and parsing, event handling, conditionals / pattern matching, etc. "Calculator" is also a big enough problem space that you can come back to it to try out more interesting language features (e.g. using Rust enums to model your calculator's operations).
- djhworld 8y agoI usually write data structures like Linked Lists when learning a new programming language. This was a critical mistake for me when learning Rust and led to many, many stumbling blocks
- dsego 8y agohttps://exercism.io https://exercism.io
- enitihas 8y agoI think you can find koans for a lot of languages (mostly pre written tests, where you write code to make those tests pass. Some examples: 1. Kotlin Koans (https://play.kotlinlang.org/koans/overview https://play.kotlinlang.org/koans/overview) 2. Ruby koans (http://rubykoans.com/ http://rubykoans.com/)
- the8472 8y agoMaybe replace something you would write as a shell/perl/python script for automation with a rust binary.
- wst_ 8y agoAdvent of Code[1] - A set of 50 tasks, released annually, with increasing difficulty. Each task is a short, Christmas related, funny story which makes it easier to follow and complete. You can track your progress so it'll give a sense of completion and satisfaction. The drawback may be that challenges are language agnostic so they aren't crafted for learning specific features of any language. [1] https://adventofcode.com/2017/events https://adventofcode.com/2017/events (3 editions has been released so far)
- deleted 8y ago[deleted]
- ZeWaren 8y agoRosalind is a good platform to learn a new language. Not the best to discover the most advanced features, but enough to ensure you know your structures and algorithms. http://rosalind.info/ http://rosalind.info/
- 2nlinked 8y agoPeter Norvig has a repo of such problems / solutions (he solves them in Python, and calls them "pytudes" = "python" + "etudes", although they should be solvable in any language) https://github.com/norvig/pytudes https://github.com/norvig/pytudes Rosetta code also has a great selection of problems / solutions in various languages: http://rosettacode.org/wiki/Category:Programming_Tasks http://rosettacode.org/wiki/Category:Programming_Tasks