Hacker News new | comments | ask | show | jobs | submit login
Ask HN: What do you code when you're learning a new language?
24 points by VtFJAewwDh on Oct 2, 2014 | hide | past | web | favorite | 17 comments
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 ?




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.


A fully tested cms. Doesn't have to be a web interface based thing. Can even be command line based. Teaches crud, tests, objects if necessary and again, tests. The requirements are as simple as they get, but it touches every necessary part of the basics of the language.


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.


I guess I am not alone with my collection of half-implemented D&D character generators in half a dozen different languages.

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.


Heh, good point. Yeah, character generators are good learning projects, IMO. Maybe somebody should start cataloging them in various languages / frameworks, ala todomvc.com? :-)


Seems like a great time to give back! (doing so will also look great on your CV when you graduate)

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.


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.


Usually I decide to learn a new language or framework because I've researched that it will be the best tool for the job for the project I'm currently working on. In my opinion the most useful way to go ahead is to start by developing stripped down, simple versions of the selected components of the project. Then I build, read documentation / code and refactor until the problem is solved in a good way. By then I usually have a good grasp on how to use the language properly and can go on.


IRC bots. Being a system administrator I don't generally have a need for UI coding. IRC bots cover networking, just about any sort of text processing you could need. Add in a standard complement of "tools/utils" and you can also add in "plugins/modules" to also toss in database handling, fetching and storing of data, etc.



I'm currently working through Project Euler problems using Rust.


At work, I refactor components with the new language.

At home, I do stuff like taking labs from stanford cs courses and translating to another language.


Write a piece of software that you already use. For example, Hacker News.


I like to write chatbots - either IRC or XMPP(HipChat).


1. Hello world.

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.


A simple IRC client.


Pacman.




Applications are open for YC Summer 2019

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact

Search: