Tell me more ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

Possible Duplicate:
TODO list to play with a new programming language/framework/platform

I love learning new programming languages but I often have a hard time coming up with exercises and project ideas to put what I read and learn into practice. There are plenty of simple "Hello World" exercises as well as overly academic/math based exercises but what I really want is some a bit more practical. Any ideas?

share|improve this question
This is the same question programmers.stackexchange.com/questions/14570/… – Henry Dec 26 '10 at 9:47

marked as duplicate by Mark Trapp Feb 12 '12 at 22:20

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

7 Answers

up vote 5 down vote accepted

Very easy: a sudoku; Average: Game Of Life.

Then, you might want to check out facebook's engineering puzzles (http://www.facebook.com/careers/puzzles.php): they have the great advantage to tell you immediately whether your solution is accepted.

I wouldn't go for text adventures, instead: the procedures to apply are four, and you'll have to apply them over and over. You actually learn to program by solving new problems, instead.

share|improve this answer
thanks for recommending that facebook puzzle. any other company have the same thing? – jpartogi Apr 21 '11 at 10:08
That link is pretty cool, however, it is worth noting for those who haven't clicked on it that the languages supported are only C, C++, Erlang, GHC Haskell, Java, OCaml, Perl, PHP, Python and Ruby. – Jetti Apr 21 '11 at 11:53

Implementing a text adventure game is a great exercise. It helps you learn about the language's data structures, I/O and string handling. It is easily extendable, and if you want, you can make it graphical later on.

If you just want to learn GUI work in the language, make a graphical calculator. You can make it as complex as you like. You can't really do 3d or game type work on it of course, but it's a good project to familiarize yourself with the basic GUI operations - creating elements and interacting with them.

share|improve this answer
+1 Great suggestions, fun too. I think I learnt most of my early languages via text adventure game writing. Some languages have poor I/O though, so a non-I/O example might be of use too. – Orbling Dec 23 '10 at 17:19
What do you mean by poor I/O? like Awk, that's meant for reading files, or something else? – Michael K Dec 23 '10 at 17:20

Games.

Depending on the kind of game and it's complexity, you will certainly explore the greatest part of the language features just by making one complete, from the compilation to the display manipulation to the input management etc. Even if it's a text game.

What's even better is that most little games developpements will easily motivate you to do more because building something fun is a positive feedback.

share|improve this answer
I think the best game to make as a starter for a GUI with OOP is Minesweeper. It teaches good layout, event handling and state maintenance, the rules are simple and there is plenty of scope for OOP principles because of the tile types and the alternating handling dependent on that. Plus, there is no substitute for fun in initial language learning to make it more pleasurable. – Orbling Dec 23 '10 at 17:21
Well personally I would have say a shoot-them-up because it allow you to do some input management, having to write yourself the event handling system (or use one provided by the language), having to manage display etc. It's more low level and don't require GUI as most languages out there don't even provide a standard GUI library... – Klaim Dec 24 '10 at 11:44

I feel it is a language-dependant question:

Ruby: Ruby Koans and Rails for Zombies.

Python: Python Challenge??? Also "Thinking in Python" (jump-starts you into explaining that the python paradigm is different)

General answer, I would give one of the many programming challenges sites, but those will not get you into the specific language's mentality. I worked a bit with Astalavista Hacking Challenges (here) with the language that I wanted to learn at that given point.

share|improve this answer
+1 for the Python challenge. I had never heard of that before. It's great! – John Dec 23 '10 at 17:31
I agree that the nature of good programming exercises depends on the language, even if said exercises are language-agnostic. For example, I started learning Haskell by using it in Google Code Jam. But now I'm less interested in using C# for algorithmic challenges when I can tear up most of them in a few lines of Haskell. – Joey Adams Dec 23 '10 at 17:35
@John: It you google around there is a wiki like page with solutions and explanation. There is also a place where there is discussion on solving them with Groovy – dimitris mistriotis Dec 23 '10 at 18:01
Great thanks! – John Dec 23 '10 at 18:20

Some nice exercises can be found at:

http://codingdojo.org/cgi-bin/wiki.pl?KataCatalogue

I also usually start with implementing various sorting algorithms.

share|improve this answer

Taken from this programming project ideas blog.

Let's say you want to learn the programming language called "prolang". Find a software library in another language such that there is no existing library for "prolang" that provides this functionality. Then port this library to "prolang". This will be something constructive and useful to others as well.

Link to the actual idea.

share|improve this answer

I find that taking old course work, or work I've done in another language and refactoring the code into the new language. This helps because the logic for 90% of whatever i'm working on takes the most time. Refactoring something I've already done removes a large part of the logic and allows me to focus on the language itself.

As well -- each time your write that project it keeps getting better and better! I think I've rewritten my Blackjack game (originally written in Java) about 4 or 5 times now! (c++, php/ajax, c, and c#)!

Out of curiosity what language are you now trying to learn?

share|improve this answer
if you enjoy code refactoring or just like to get more practice I highly recommending checking this proposal out. You get to tell other people why their code sucks ass and what they can do to make it suck less. Can it get any more awesome than that? ;) – greatwolf Jan 18 '11 at 8:28
@victor T. No... it actually does not get any better! Now... just have to harness my weekly rage moments for this thread to open :D – cdnicoll Jan 18 '11 at 16:35

Not the answer you're looking for? Browse other questions tagged or ask your own question.