Good exercises for beginner

S

Sam Haskins

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?
 
C

Chris Lowis

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...1?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
 
D

David A. Black

Hi --

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?

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 += 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

--
Rails training from David A. Black and Ruby Power and Light:
Intro to Ruby on Rails July 21-24 Edison, NJ
* Advancing With Rails August 18-21 Edison, NJ
* Co-taught by D.A. Black and Erik Kastner
See http://www.rubypal.com for details and updates!
 
M

Martin DeMello

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 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
 
T

Todd Benson

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
 
S

Siep Korteling

Sam said:
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
 
M

Marc Heiler

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 :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top