Hi all! I've been reading an excelent book on C# called Illustrated C# 2010 and I feel like I this book covers a lot of the topics I need in order to learn how to program. However, it isn't a textbook so there are no exercises for me to practice what I'm reading. While I may retain some of what I'm reading, I find it imperative that I actually sit down and write code in order to learn it. So my problem here is a lack of exercises.
Can anyone suggest a website, or a book that has a suffient amount of exercises that will help me learn the material I am reading? I've checked out sites like projectelure and spoj, but those sites seem like they are geared for people that understand the syntax of programming languages already and just need to learn how to create algorithms. What I'm looking for is a resource that has exercises on how to apply what I've read (for example: Write a program that uses delegates to do this... or Write a program that uses Interfaces to do x...)?
Does this make sense to you guys? I feel like I just wrote a lot of stuff to ask what everyone else will think is a simple question.
Programming doesn't really lend itself to exercises.
1.1 Write a program to read a serial port carrying ASCII data and print the data in two columns.
Hmmm... How would anyone score the widely varying results in a classroom, let alone a book? When it comes to defining software solutions, there are just too many degrees of freedom. A classroom instructor can assign such problems, then take the time to work through all the individual solutions - one for each student - to find which work and which don't. A textbook author can't do that. Instead, they usually (the better ones, at least) provide lots of real world examples to demonstrate the concepts and how they apply to different challenges.
I'd suggest that you grab a good book with lots of sample code, then as you go through the material, set yourself a challenge to write code that does what the chapter is about. Then compare your solution to the worked out examples given by the author(s). The comparison will teach you a lot. One book I found tonight, which I just ordered for myself, by the way, is from Wrox Press. I've owned a number of Wrox books, and never found one that wasn't excellent. You can view it here[^].
Wrox books generally are very well written, easy to understand, and give you access to loads of downloadable code to study and try out.
Just an update... got my copy Monday, skimmed over it, and it looks excellent. It covers a lot of topics that previous books I've used didn't, some basic things I didn't know, and I learned a few new things in the first 50 pages. But it's got to go back on the pile for a few weeks, at least until I finish this Statistics course... darn.
Yeah I got mine Monday also. I've read about the first 100 or so pages and done all the exercises. Haven't learned anything new so far, but I'm reading it in conjunction with PRO C# and .NET 2010 which is explaining a whole lot of things I never even new existed.
LINQPad is great. I use it all the time for testing small snippets, one-time mini-programs, and just playing around to figure out how to use a .NET feature. The Dump() method is particularly useful for getting a feel for the structure of an object you're not familiar with.
The shout of progress is not "Eureka!" it's "Strange... that's not what i expected". - peterchen
Just a tip, but I found that many (not all of them) sample code in books where wrong in some way or another. Sometimes it was a type-o, sometimes they use a function that doesn't work or often they have a wrong logic, sometimes you need to have done something else and they forgot to mention. Most problems are small, in a rare occasion it is totally wrong.
I suspect more or less it is done on purpose to let you think and figure out for yourself, but it could be frustrating if you don't expect errors in samples.
Not sure why this was downvoted, gave it a 4 to compensate.
Textbooks with exercises seem to be out of fashion these days. K&R (the classic C language guide) has them at the end of every chapter, and that was a good idea (even if I didn't actually do most of them!). But it is a good suggestion to read the description of a problem or a language feature, stop before you get to their worked example, and try to solve it/make use of it yourself, then look at what they prepared.
Unfortunately it's so long since I needed non-programmers' introductions that I can't really offer any meaningful advice because my source material is not relevant any more.
I had a great textbook for learning introductory algorithms like binary searches and stuff like that, and it had exercises at the end of each chapter we read. That helped me learn the material because I was having to create a program based off the exercise that didn't exactly match the samples in the book.