Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Ask HN: Beginner code projects?
15 points by whackedspinach on June 10, 2011 | hide | past | favorite | 8 comments
I'm looking for code projects (think small application size) that are somewhere between Google Code Jam/Project Euler and really big codebases. I'm trying to teach myself programming, but I can only learn so much by reading and doing the book's exercises. I have a intermediate knowledge of Python and I am halfway through K&R (although that book has good hard exercises). Does anyone have suggestions or know of sites that have good project ideas that would force me to experience different aspects of programming? One idea I have, for example, is an IM client to understand network protocols.


Good question. I'll speak to what I'm familiar with.

For networking, a command-line TFTP client/server is a good exercise. Pay close attention to how to handle the corner cases that crop up, and try your code against a few implementations. If you're interested in protocols, you could use libpcap to read raw packets and write a simple protocol analyzer to read packets on your home network.

If you want to focus on software architecture (e.g. how do I build a system that is maintainable as it gets bigger) you should pick a pet project, follow through, and iterate on it mercilessly until you think you hit a maximum of readability and low coupling. Then show someone who's better than you, and talk about it. I did that with an IM client and learned an awful lot.

Also, dabble in metaprogramming and concurrency. They'll pay off eventually, even if they seem esoteric right now.


If you're interested in C, one project could be developing GUI for some unix commands. At school we did a project once where we built a GTK app for creating logins on linux. There's many things you get to deal with like file handling and executing commands from code and so on.

One fun thing for learning hacking is trying to implement linux commands such as ls or ps. You get a little more intimate knowledge about the OS and you don't have to come up with specs because you already know what it's supposed to do :)


I second the idea of implementing small utilities. It's also good when you're an experienced programmer and are learning a new language.

OP, besides that I suggest you try and write a simple, text-based chat program before trying to write an IM. For instance, start with a 2-way chat, add error handling, then start adding support for multiple users, chat rooms and irc-like commands.


the K&R book is a really good starting point, and if you can do most of the hard programming exercises, you're already reasonably good.

if you're looking to venture out, and want to deal with networking, then an IM client may actually be quite good to work with. you'll want to look at sockets in UNIX (although windows sockets are very similar, if that's your sort of thing), and use that as a starting point for communications.

it depends exactly what you want to get out of programming though. do you want to stick with C and the low level stuff? making tools/programs from scratch is very rewarding, and imparts a very complete understanding of the subject matter.

i didn't feel like i was a "real" programmer until i started making GUI (so, qt/cocoa/.net) applications, at which point i realised i could really do pretty much whatever i wanted (and have since realised that such a standard for being a "real" programmer was rubbish).

most of the programs you'll make will rely heavily on libraries, or external tools, which you might not have access to. so i recommend, whatever it is you do, that you include something you didn't create.

aside from that, i don't really have much to suggest, other than keep going, keep pushing yourself, and keep learning.

good luck.


I cannot recommend K&R enough. Right at the end of the first chapter, you are asked to write a C syntax checker. It was a very tough albeit interesting exercise for me.


The networking stuff might be a good exercise but doesn't seem exceedingly practical. Build a shopping cart, Reddit clone, blog, forums or other big category web app in a framework like Web2py. Doa payment integration, Facebook integration, Oauth, NoSQL DB, GAE, etc. Make sure to use version control and try using Fabric or some other deployment tool.


I second this. I've learned a lot by cloning functionality and then adding on my own. In the end you end up with a cluster-fuck of complex crap, that when you look over it, you cringe at how bad it is. Good programmers will always look over previous work and go "WTF!" -- it means you've learned something since then. That's when you do a rewrite. :)


Until you finally realize rewrites don't work and learn to refactor :)




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

Search: