Good exercises for beginner

Hello all,

I am an unexperienced programer, and though things like why’s guide
and other tutorials do a good job of explaining syntax, I am trying to
develop experience in making real projects. I have tried to do the
ruby quizzes, but they are a bit too hard; I don’t yet have a great
feel for the best way to approach problems, and so I ended up having
to consult how other people solved the quizzes to get over stuck points.

Are there simpler exercises out there that would be good for a noob
like me, or do you think that reading code for a while might do better
for familiarizing me with technique?

I have tried to do the
ruby quizzes, but they are a bit too hard;

There’s some discussion on recommended “easier” ruby quizzes here:

http://groups.google.com/group/comp.lang.ruby/browse_thread/thread/56715eaf2f9a657/5739f21adceca0d1?lnk=gst&q=easier+ruby+quiz#5739f21adceca0d1

I don’t think there’s any shame in looking at “the answers” after
you’ve given the quiz a good try yourself – on the contrary, reading
other peoples code is an excellent way to learn. Ruby quiz solutions
can be small enough to understand in their entirety, unlike the code-
base of a large open source project, for example.

Good luck,

Chris

Hi –

On Wed, 23 Jul 2008, Sam H. wrote:

or do you think that reading code for a while might do better for
familiarizing me with technique?

A very good source of exercises is to try to (re)implement some of
Ruby’s core methods in Ruby. For example, you could implement
Array#each like this:

class Array
def my_each
i = 0
until i == size
yield self[i]
i += 1
end
self
end
end

and similarly (though a bit more complexly) with other methods like
select and map. Sometimes this takes you into a more “low-level” style
of programming than you might use normally (like, maintaining an
explicit counter rather than just using an iterator), but it’s very
good practice and a good way to learn.

David

On Wed, Jul 23, 2008 at 4:38 AM, Sam H. [email protected]
wrote:

or do you think that reading code for a while might do better for
familiarizing me with technique?

I wrote http://zem.novylen.net/ruby/tutorial/arithmetic-quiz/arith.html
to be a good learning project. It’s intended as a followup to Chris
Pine’s excellent http://pine.fm/LearnToProgram/, so if you haven’t
done that one already go through it first.

martin

On Wed, Jul 23, 2008 at 6:38 AM, Sam H. [email protected]
wrote:

I have tried to do the ruby quizzes, but
they are a bit too hard; I don’t yet have a great feel for the best way to
approach problems, and so I ended up having to consult how other people
solved the quizzes to get over stuck points.

Try the quizes and make extensive use of irb. Best education, ever.
One thing you should try to avoid is what I used to do, that being
trying to make it perfect on the first try.

Todd

Sam H. wrote:

Hello all,

I am an unexperienced programer, and though things like why’s guide
and other tutorials do a good job of explaining syntax, I am trying to
develop experience in making real projects.

http://www.projecteuler.net starts with some easy stuff. When you solve
one, you can see how others did it, in all kinds of languages.

Regards,

Siep

I have tried to do the ruby quizzes, but they are
a bit too hard

I could recommend one of these:

  • write a simple IRC bot in ruby (hehehe that was my first task)
  • write a simple 2 players game (but a bit more complex than “guess a
    number”, maybe name the capitals of some countries, and store that in a
    yaml file)

Or, if you feel adventureous you could try to write a single .rb file
which teaches you ruby. While writing this .rb file, you could write
ruby code.

No kidding btw, this is how I have collected my local FAQ. It is quite
large by now :slight_smile:

Sam H. wrote in post #706081:

Hello all,

I am an unexperienced programer, and though things like why’s guide
and other tutorials do a good job of explaining syntax, I am trying to
develop experience in making real projects. I have tried to do the
ruby quizzes, but they are a bit too hard; I don’t yet have a great
feel for the best way to approach problems, and so I ended up having
to consult how other people solved the quizzes to get over stuck points.

Are there simpler exercises out there that would be good for a noob
like me, or do you think that reading code for a while might do better
for familiarizing me with technique?

Keep watching the below page for quiz.

https://projecteuler.net/ is a great place for challenges, especially
math related.

http://www.codeeval.com/ has lots of challenges with the goal of getting
jobs at various tech companies, but you can of course ignore that part
if you’d like.

I created a website called CodeQuizzes that has good
beginner/intermediate Ruby questions: http://www.codequizzes.com

http://rubymonk.com and http://tryruby.org are also useful resources for
beginners.

I haven’t tried the Codecademy Ruby questions yet, but they look
promising: Ruby Courses & Tutorials | Codecademy