Ask HN: Beginner code projects?
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.
8 comments
[ 4.4 ms ] story [ 29.1 ms ] threadFor 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 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.
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 :)
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.