I aspire to being a Ruby & coding Jedi like James Bond character. In
reality I am more like one of the extras in Austin Powers when it
comes to programing. I think it is important that before I continue I
emphasize exactly how unskilled I am in this area.
I spent a semester coding basic PASCAL in 1997. Around 1992 I could
kind of make the most basic of basic programs using DOS Basic.
Last week I decided that I wanted to build stuff and do it with code.
So I decided to spend the weekend learning. I chose Ruby, downloaded
_why's book, watched a few videos on youtube, went through some on
line samples and wrote a simple gambling program where you bet, roll a
die against the computer and the higher die wins. And I have written
most of a rock, paper, scissors, lizard, spock program Not brilliant
but as it is the first code I've written in 15 years in a language I
didn't existed till last week I feel I am making good progress. I
intend to spend my dubious free time during the week working on
manipulating files and playing with some more functions. Now knowing
full well I have a long way to go in Ruby I've decided to jump head
first into Ruby on Reals which is where my real interest lies. And
here is where I am running into a problem.
I have very limited background in computers and most of the
documentation around rails, which I am sure is well written, reads to
me like gibberish. Not just gibberish mind you but the gibberish of
one of thise dying paleontoligical tribes in the Indian ocean whose
language has never been translated. So, my very basic and simple
question is where do I start? Is there a simple resource that will
walk me through my first couple of programs and give me an idea of
what comes next. Remember all I know about SQL is it exists, I have no
idea of how the parts move and am eager and committed to learning &
contributing back, just no idea where to start.
I am sure there have been similar posts before but I have searched for
a number of hours without finding even the beginings of a study
outline that I think would give me the push I need.
Given your minimal knowledge of programming, it's probably best if you skip all the testing parts (which take up more than half) and concentrate on coding.
Given your minimal knowledge of programming, it's probably best if you skip all the testing parts (which take up more than half) and concentrate on coding.
Wrong, testing is a vital part of the process, do not skip it.
Well, that had to come! Of course testing is vital, but when learning the basics of programming it simply gets in the way. First be comfortable with the language and system, then add testing.
This obviously refers to the integrated testing as used in much Rails development, and for good reason. Constantly testing and checking your code is absolutely vital in all programming from the very start, relying on integrated testing (a programming effort in itself) is never going to replace that. Learn one first, then the other.
Of course testing is vital, but when learning the basics of programming it simply gets in the way. First be comfortable with the language and system, then add testing.
This obviously refers to the integrated testing as used in much Rails development, and for good reason. Constantly testing and checking your code is absolutely vital in all programming from the very start, relying on integrated testing (a programming effort in itself) is never going to replace that. Learn one first, then the other.
I don't agree. railstutorial.org introduces testing in a very
accessible manner and uses it as an inherent part of developing the
code. There is no reason to skip those sections of the tutorial.
Would have to agree with Colin, I’m a newbie (I’ve only been working with Ruby on Rails for about 7 weeks now) using Rspec.
I learned the basics of testing using Hartl’s tutorial, which does a solid job of helping you understand how it should be framed and connected to an overall project. It’s helping me develop good habits.
WARNING:
If you’re using Rails everything is already “magically happening” in the beginning (because your still developing basic Ruby skills and your way around everything). I did that the 1st couple of weeks and it was really a waste of my time. I wasn’t learning anything, at all.
Don’t disillusion yourself by avoiding the testing process completely, sure you won’t write perfect tests, and sure you it may not even be all that thorough, but at least give the basics a try to get familiar
**Hey Colin/Binni, **
Can you gents recommend solid books (particularly Rspec) to deepen our skills? Or even solid links (which will probably be better)
Personally I agree with Brynjolfur.
I have 20+ years experience in coding of one sort or another - but not
much on object oriented stuff like rails.
I've been working through the Rails Tutorial and while it makes plenty
of sense - and the examples work if followed perfectly - any deviation
and it fails.
And when it doesn't - like my first none tutorial app it's a
nightmare.
Between Ruby, Rails, Webrat, Rpsec, Capyabara (for a start) as a
novice (in the environment) you don't know where to start on debugging
a problem.
In my case I've just spent 2 days trying to solve why a test was
failing. Because it wan't from a tutorial example I had no guidance
on even where to look - trial and error is a very slow way to locate a
problem.
For me with my background in C, Pascal, Fortran, Informix 4GL and
Basic (amongst others) my usual debug methods got lost in the
multitude of methods from different gems.
Personally I think there is plenty of space for a Rails Tutorial that
sticks to very basic Rails (as much as is possible). I would have
found it much easier to concentrate on the minimal Rails environment
first. Once that's understood you can move on to Rspec, Test Driven
Development, Production rollout to Heroku etc.
Maybe you multi-tasking youngsters cope better with having the whole
shebang thrown at you at the same time - us dinosaurs move slower!
Been working with rails and ruby for about 6 months now (give or take
a month) and started with Hartl's tutorial. I also started by usign
rails 3.1.x before he had developed the chapter/material for it so
there was a lot of debugging, IRC chatting, googling, and digging to
figure it out. Got through the tutorial in about a week of part time
effort and the testing helped me understand things MUCH more. gave me
more to debug and problem-solve but that's what a large part of coding
and learning new things is all about.
do the testing.
I have 20+ years of coding experience: basic, pascal, c, c++, c#, VB,
scheme, delphi, fortran, blah blah blah. I love learning and working
with new languages. this has been a huge challenge because i don't
have a lot of web dev experience so in addition to ruby and rails,
I've been learning (more) html, javascript, MVC, etc etc etc... tons
of fun!
Well, the point (as IanJ also made) is that you have to do one thing at a time. Learn the language (Ruby), learn the quirks and conventions of Rails, learn to test and debug the hard way. Then add integrated testing. It's a steep learning curve, just learning how to program. If you don't develop your basic debugging skills at that point, you never will.
I'm a bit of a dinosaur myself, having worked in all sorts of environments for a long time. Using Rails is not my choice and the more I see, the less I like it for the kinds of apps that I am developing. But it has its undoubted benefits as a proof-of-concept, quick and dirty way of setting up things really fast.
Integrated testing is for professionals doing mission-critical work. I've been there and employed a lot of programmers through the years. What makes the difference between a good and a mediocre (or even bad) programmer is the ability to find and correct his own errors. If you don't develop that ability from the ground up, no amount of integrated testing is going to save your ass.
Start with a text editor, lots of testing and debugging until you're comfortable with the art of programming. When you feel you are ready for some "real" work, where money or other people's livelihood depends on your code, that's the time to dig into integrated testing.
But then again, others may feel different, fair enough. Multitasking may be something that the younger generation is better at, no doubt, but that never beats proper understating.