Exceptions.
Exercises, examples and other material relating to training module R111. This topic is presented on public courses
Learning to program in Ruby,
Ruby Programming
Ruby Programming - A Modern, Object Oriented, Portable Scripting language.
This quickly moving course covers the fundamentals
of the Ruby language for ... http://www.wellho.net/course/rpfull.html [course] |
Learning to Program in Ruby - A Modern, Object Oriented, Portable Scripting language.
Ruby is very much an object oriented language, and we concentrate ... http://www.wellho.net/course/rlfull.html [course] |
It s said that between a half and 95% of a program will be given over to error checking. Indeed some of the web based programs on this site are little ... http://www.wellho.net/solutions/general- ... tions.html [longer article] |
How do you check for run time errors in your program? You'll include tests with if statements in almost every program you write, to ensure that user ... http://www.wellho.net/mouth/1875_Wha ... nswer.html [short article] |
From yesterday's Ruby course - a whole set of new examples on Ruby collections - arrays (which are ordered lists) and hashes (which are unordered). In ... http://www.wellho.net/mouth/2621_Rub ... mples.html [short article] |
Rather than writing getters and setters, in many Object Oriented languages you can access the variables within an object directly. That can be dangerous ... http://www.wellho.net/mouth/2620_Dir ... -Ruby.html [short article] |
"I can't answer that question in the way you expect" ... that's something that may be said to you occasionally - you ask someone what suit a playing card ... http://www.wellho.net/mouth/2622_Han ... tions.html [short article] |
You can check for some, but not all, errors. It's
sometimes necessary (and often preferable even if not
necessary) to write clean code that assumes correct
operation, and provide rescue blocks telling Ruby what
to do in the event of a failure.
This topic is presented on public courses
Learning to program in Ruby,
Ruby Programming
Examples from our training material
| bmi.rb | BMI (Body Mass Index) calculator |
| catcher | Converting String to Integer and handling errors |
| fsta.rb | File Reporter - assumes all is OK |
| fstb.rb | File Reporter - handle problems with open |
| fstc.rb | File Reporter - handle multiple problems and re prompt |
| mc | Catching user errors - a short demonstration |
| mighty.rb | Passing exceptions back to calling code |
Background information
Some modules are
available for download as a sample of our material or under an
Open Training Notes License for free download from
http://www.training-notes.co.uk.
Topics covered in this module
begin and end (and a mention of BEGIN and END).
Raise and rescue.
Throw and catch.
Complete learning
If you are looking for a complete course and not just a information on a single subject, visit our
Listing and schedule page.
Well House Consultants specialise in training courses in
Python,
Perl,
PHP, and
MySQL. We run
Private Courses throughout the UK (and beyond for longer courses), and
Public Courses at our training centre in Melksham, Wiltshire, England.
It's surprisingly cost effective to come on our public courses -
even if
you live in a different
country or continent to us.
We have a technical library of over 700 books on the subjects on which we teach.
These books are available for reference at our training centre. Also
available is the Opentalk
Forum for discussion of technical questions.