Ask HN: What do you code when you're learning a new language?
Hello there!
preface: CS student here, not working right now.
As many of you, I learn by doing.
But I am in a strange situation: I would like to learn a new language, but I don't have any itches to scratch, I don't need a particularly non-existant piece of software.
So I was wondering: have you ever felt like this ?
What would you code when you want to learn a language but you don't have something to code?
It just came to my mind that maybe I should just prepare a set of algorithms and just rewrite them every time i have to learn a new language. But this doesn't feel like the ``right'' solution.
HN, what's your advice ?
17 comments
[ 3.0 ms ] story [ 69.1 ms ] threadHits a lot of typical language features but without being a huge time waster on any one. Database access, both stateful and AJAX GUI elements, users, email delivery, and with expansion if you so wish (e.g. hashtags, clickable usernames, tweeting at someone else, and so on).
Big enough to be interesting and feel like you accomplished something but simple enough so you won't spend weeks on it with little to show at the end.
At home, I do stuff like taking labs from stanford cs courses and translating to another language.
So, for example, I like doing a simple 2D vector math library--I am pretty familiar with the topic matter so I don't think about it much and can focus on how the language or whatever feels. I also can easily tell if the implementation is borked and can benchmark it as I try different things.
A simple entity system with messaging is another example of something that is simple and bounded but lets you try out different parts of the language.
A game of breakout is a really good one as well--combines both of the above, and lets you play with graphics and input and whatnot.
Then again, picking a problem domain that is deliberately outside what the language's sweet spot is not usually helpful--doing the math library in, say, awk or SQL might not show me anything those languages are good at. Doing Web content scraping in C would get me distracted with implementation details of the language instead of what it's good at.
When I started learning Groovy and Grails I just started building a Reddit-like app that would become the first project of what would become Fogbeam Labs.
Now, I'm working on learning to use Angular, so I've decided to start on a product management dashboard thing I wanted to build for internal use here at Fogbeam.
So, advice? Just pick something. You say you don't have an "itch to scratch", well OK... if you don't have something new you want to create, just pick an existing $WHATEVER and port it to your chosen language. Pick something you use regularly so you'll know and understand the domain, and start coding.
It doesn't really matter if you finish it or not, or how good it is. The goal, remember, is to learn the $NEWLANGUAGE not to build a better $WHATEVER. But who knows, maybe the $WHATEVER project will turn out great, and you can wind up actually using it or making a business around it. But if not, it still served it's purpose.
When I'm learning a new language and don't feel any kind of "itch to scratch," grabbing the nearest roleplaying handbook is quite a nice saver. You pretty much have a full spec sitting right there for you to implement.
2. Read ( parse ) JSON and Print JSON
3. Database connectivity.
4. REST API, with full CURD
5. Process Images
Etc
That how I am learning Golang.
There are many civic and non-profit projects that could use your help (even though you're just learning the language...every little bit helps!!). Check out codeforamerica.org, there are many affiliated groups that hold hack nights and such (like meetup.com/OpenOakland).
Taking on a little piece of a meaningful project might help keep you motivated to learn more and more about about the language.