Live data from Hacker News

Ask HN: What do you code when you're learning a new language?

news.ycombinator.com

1–10 of 18 posts

Ask HN: What do you code when you're learning a new language?

#1
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 ?

Re: Ask HN: What do you code when you're learning a new language?

#3
Twitter.

Hits 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.

Re: Ask HN: What do you code when you're learning a new language?

#6
For me, whenever I'm working on a meta-issue (laerning a new language, learning a new software pipeline, learning a new documentation/testing style), I like to pick a simple library in a problem domain I'm familiar with.

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.

Re: Ask HN: What do you code when you're learning a new language?

#7
I don't have one "stock" project that I always use for learning new languages... I just do whatever I happen to be thinking about at the time. Long ago, that meant an AD&D (2nd Ed) character generator. Then it was a training database for the volunteer fire department I was with. Later it was an (aborted) attempt to build a decentralized /federated social-network (something like Diaspora, IOW).

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.

Post reply on HN