views:

1653

answers:

13

When you are learning a new programming language, what are some good projects that can be done across a spectrum of languages?

I'm familiar with programming puzzles and read the other related question, but as I think about how I learn a language, I go through stages. First, I learn the basic syntax, then I learn the more advanced (and often language specific features), finally I learn how to manage a project in that language. Programming puzzles are OK for learning the basic syntax and, from my experience, very good for learning the more advanced features of the language, I'm looking for ideas that go from the very basics of the language to the most advanced aspects.

+12  A: 

I like to write rip-offs of existing programs or web-sites. I don't make them publicly available but I occasionally come up with something I like enough to use myself.

When I wanted to learn Python, I wrote a single-user del.icio.us knock-off (which I still use regularly). From there, I attempted a Flickr imitation which was a fun exercise but never worked very well.

Mark Biek
The main reason the Flickr rip-off was no good was that creating different sizes for all of the images took too long. I was doing system calls to convert and it was slooooow. If I were doing it again, I'd probably want to investigate native image manipulation in Python and see if that's any faster, although a beefier server would probably help too.
Mark Biek
+1  A: 

Volunteer on an open source project. The learning curve is steep, but you get to deal with every part you just mentioned.

Will
A: 

@Mark Biek: Ripoffs actually sound like a good idea, especially if it's a very popular type of app and you can find people familiar with both the app you are "cloning" and the language you are using to get help for both aspects.

@Will: That too sounds like a good idea, although only for more mainstream languages.

Thomas Owens
+7  A: 

Years ago while in my undergrad learning Pascal, I wrote an application to manage my cassette tape (and some CDs) library. Since then, I've rewritten it in C, C++, Perl, Java, Visual Basic 5.0, 6.0, .Net, and C#. I'm looking to rewrite it again in Python and Ruby.

Each time, I try to take advantage of as many language features as possible. I don't simply "port" the code, I completely rewrite it each time, even adding new features.

I feel this gives me a great platform for learning the new language.

Geoff
+1  A: 
Jacob Proffitt
+1  A: 

I typically feel pretty dry when learning a new language, and I'll attempt to start a few projects that typically fail. Things typically don't start moving until I'm sitting at the computer wishing that I had a tool for something. Then I build it in my language du jour.

The downside of this is that it isn't a very organized or structured way to go about learning anything. The upside, however, is that I always ended up (eventually!) with a project in which I am thoroughly interested in seeing through to completion. I usually end up learning a ton.

Brian Warshaw
+1  A: 

I would recommend doing something useful and practical for your immediate needs. For instance now I am trying to learn to use the (considerable) power of DevExpress components and my project of choice is a personal finance manager to track income and expenses and generate assorted reports.

Conrad
+4  A: 

I think converting an existing application or implementing a familiar concept is the best way to learn a new language. I usually start out by writing utilities and demo applications that I already know how to implement in other languages. I think this is a good way to learn because it lets you focus on the various language aspects rather than how an algorithm is implemented or how to solve a given domain problem. I don't recommend approaching a new and unknown problem or domain as a first task in a new language. Even if it can be exiting at first, chances are you will spend more time solving the initial problem than learning how to use the new language.

I also think it's important to select a project that you are motivated for and actually want to do. There is really no point in forcing yourself to follow tutorials you find boring or implement example code you have no interest in. After all, programming should be fun, and in my experience, if I am excited about doing something, learning the language features required to do so will follow almost automatically.

Anders Sandvig
+1  A: 

I've just been considering the same question.

I've noodled around with a simple classified-app before, but it is, frankly, boring :)

I've started using a mini-wiki, or even micro-wiki: Just a little project that allows multiple users to create and edit pages. You can leave out almost all "fancy" features like markup to get it down to a small, manageable but satisfying core.

At that size, it's an easy enough project that it can be done quickly, but exercises enough of a language or framework to make it worthwhile.

Christian
+9  A: 

I find implementing a simple game to be quite worthwhile because

  • you get to use pretty much all elements of the language
  • you touch many different parts of the libraries (files, keyboard, mouse, graphics, sound, etc.)
  • it gets you something you can play and have some fun with (keeps the motivation up when things get tough)
  • at the end, you have something to show for your effort, and a sense of accomplishment
Galghamon
games are one of the few things non-programmers will find cool. Show them a command line XML parser and they probably won't flip, but pong, now that's something they can relate to. :D (only if you care about what other people think of course, which is never a necessity) :D
CrazyJugglerDrummer
A: 

Personally, I find it really hard to put the cart before the horse. By that I mean: without a real goal, I may go through the motions, but only later discover that what I thought I had "learned" hadn't really stuck.

So a goal is critical. But goals can be engineered. I think you can consider three types of goal:

  1. External Delivery Goal (aka "real" goal) As in, you really do have a project in mind that needs to get done, and other people are watching and waiting for you to do it. Serendipity provides the opportunity to apply a new tool or language that you want to learn to the problem. This is the best kind of learning, as the project goal will force you to address the gaps in your learning. A bit like having a personal trainer hollering in you ear to do another rep.

  2. Internal Delivery Goal Self-imposed delivery goals. Still real problems to be solved - like a new templating engine that will make your development 100% faster. But you have to be your own customer, which for some people - myself included - can be a bit of a problem!

  3. Substitute Goal This I consider to be like manufacturing a goal. The goal wouldn't exist for you unless you had the learning in the back of your mind.

    • In this class I put using websites that challenge your knowledge - achieving 100+ questions on projecteuler, or getting over 3000 rep on stackoverflow.
    • And also blogging. When learning something new, I'll often set my goal to be "learn this well enough to write an interesting, useful and cogent blog post about it".

So the "best" answer to your question is, I think, unanswerable! "External Delivery Goals" are best of all, and it matters little just what the project is. What is important is that you have an external motivator for your learning.

tardate
+1  A: 

The most important thing when your learning a new language is, as Hanselman's being banging on about, Read More Code! Take a cut of reasonably widely accepted open source program written in the language you're trying to learn and try make some changes. Don't try fixing bugs cus that's a bit boring but maybe add a new feature and take your learning from that.

I've always found that the best way since you get the bonus of learning the patterns and conventions too!

Stimul8d
+1  A: 

When I learn a new language, I have a habit of writing a small program when the class is over to help solidify the learning in my memory. My favorite is what I call 'dirsize'. Dirsize recursively traverses the directory structure and produces the sum of the sizes of all files below a given starting place. The starting place is usually hard coded at first. When it is working, it can be changed to use an argument to the program or to provide some user interface to select the starting directory.

A side benefit of programming 'dirsize' is you come to appreciate recursion and understand that a directory is not just a special type of file.

Kelly French