Programing exercises for the weak?
May 22, 2007 6:20 PM   Subscribe

Somewhat of a budding programing looking for programing exercises. I'm kind of middle ground between not knowing anything and what you might call a novice. So really I know just enough to be dangerous and have ideas too big for my skills. What are some good exercises (mostly thinking C# [mono] here) that will help me develop into at least a novice? More after the break.

I've developed a few applications for myself in the past. All in Visual Basic 6 and they were nothing too great but also nothing to scoff at either (a time clock where the users would clock in/out with a RFID tag read though a RFID reader connected via USB with the information being stored in a database, a custom slide show screen saver with a built in pong clock clone for a home made digital picture fame, as well as some odd programs here and there).
I'd like to start working with C# [via mono]. I'm very famillar with the C style syntax so that's not a problem. I work with PHP a fair bit. I've also read many many books on C, C++, and C# but the problem was I just read them I never did anything in them. I understand the basics of OOP (an object is both data and functions) but I'd like to really understand it.
So I'm looking for exercises that will keep me interested yet at the same time not start with a simple hello world application nor expect me to understand OOP totally or even some of the more advanced C#. I know the best exercises are the programs you yourself need to fit some problem but right now I don't have any of those.
Also please keep in mind that even though I have a windows 2000 box with a copy of C# 2005 express edition on it. I'd like to do all this with the cross platform version mono. I know that shouldn't be too much of a problem but I thought I should point it out.
Also I don't know if I made it sound like I've never worked with C# before, I have and have made a few simple, simple programs the biggest one would copy the mp3 files that are downloaded via Pandora rename them with the artist and track title and copy them to a directory of my choice.
posted by blackout to Computers & Internet (11 answers total) 12 users marked this as a favorite
 
Best answer: Here are a few tips off the top of my head:

- Implement an existing protocol: write an IRC client or an FTP or HTTP server. This has the benefit that you know where you're going with it and you get immediate reinforcement that you've done it right when it works with other software. A stateful protocol like IRC is perfect for OOP, since a connection is basically an object.

- Do something cool: like your Pandora program, the most satisfying code is the code that ties into something cooler than itself. Use Google or other online APIs to visualize data in an interesting way. Get your hands on an interesting piece of hardware and make it computer-controlled. Point a webcam at your coffee maker and publish its status online.

- Start coding fast: don't spend a lot of time on initial design, since you can get trapped there and never end up programming. If you write careful, concise code, you can review your design and improve your program's structure ("refactor") as you go.

- Knock something off: I wrote a couple of different variations on "tower defense" games, just for fun; there's nothing special about them, but they were still fun and educational to write. Don't worry about reinventing the wheel or copying someone else. If your program won't be distributed, feel free to grab graphics, sounds, concepts, and gameplay.
posted by pocams at 6:44 PM on May 22, 2007 [2 favorites]


If you are looking for interesting problems, try googling for programming contests and just going through their archives until something grabs your attention.
posted by Loto at 6:46 PM on May 22, 2007


Stroustrup's The C++ Programming Language has exercises at the end of every chapter, rated (on a log scale) by difficulty. Recommended.
posted by orthogonality at 6:51 PM on May 22, 2007 [1 favorite]


Like pocams, try working on something that'll benefit you in the end.

- Something like Lucene.NET... Easy to follow API, simple objects make it easy to create a powerful indexer for their search solution you can use to search just about anything.. Then implement it on your blog/site/etc...
posted by 4months at 7:06 PM on May 22, 2007


You should totally work on Lucene .NET. I was going to leverage it for my last project, but it's still in "incubation" and from what I can tell, doesn't have much of a community yet.

Quite a shame, that - it seems like something that will be really cool someday.
posted by Afroblanco at 8:55 PM on May 22, 2007


Read the source of an open source application you use. Make modifications and experiment with that application. Maybe consider contributing patches, etc.
posted by Matt Oneiros at 9:38 PM on May 22, 2007


Write a ray tracer. Particularly if you like math/geometry, its a fun project, easy to get something up and working, and plenty of options to implement.
posted by jpdoane at 10:53 PM on May 22, 2007


If you like games, write a solver for a simple game, or a game with a computer opponent you can play against. Tic-tac-toe is a nice simple one to start with. (Look up "alpha-beta pruning".)

Also, seconding the programming contest idea. The ACM programming contests have lots of nice problems that aren't too difficult; for a greater challenge, check out the ICFP contests, especially last year's, which is among the most kick-ass things ever.
posted by equalpants at 1:28 AM on May 23, 2007


Best answer: For things that you can blow through in half an hour but are still fun, try the Code Kata series. It has some great thought questions, and actual coding questions for things you wouldn't have thought of.
posted by cschneid at 9:06 AM on May 23, 2007


I had the same problem, so I invented projects where I thought the result would be fun / useful. A few examples...

Level 1: write a word count analyzer (in a given text, 'the' appears 100 times, 'and' appears 80, etc.)
Level 2: write a disk usage analyzer (sorted list of directories and their sizes) (like du)
Level 3: write Tetris in .NET. The logic is simple and the end result is kind of gratifying.
Level 4: write a program to draw the Mandelbrot set, so that you can zoom in arbitrarily. How fast can you make it run? Can you make it multi-threaded?
Level 5: write a Scrabble solver: given a Scrabble board and a set of tiles, what's the best move to make? (deceptively hard)

Of course, the projects you pick depend on what areas you want to practice: do you want to learn Windows forms development? Web services? Databases?
posted by molybdenum at 10:45 AM on May 23, 2007


Response by poster: cschneid code kata seems to be very much what I'm looking for. Short problems to solve.
Molybdenum: I'm looking to develop desktop applications, as well as learn some database work in C#. I use PHP for my website programing and work with MYSQL just fine in it.
Thanks for the gets answers!
posted by blackout at 12:48 PM on May 23, 2007


« Older How can I mail books cheaply in Canada?   |   How Many People Will Watch Tomorrow's Champions... Newer »
This thread is closed to new comments.