BIRT 3.7
Written by: Michael Williams
Featured Refcardz: Top Refcardz:
  1. Scrum
  2. Apache Maven 2
  3. Essential MySQL
  4. Node.js
  5. Groovy
  1. jQuery Selectors
  2. Ajax
  3. Java
  4. Spring Config.
  5. Java Concurrency

Link Details

Link 287729 thumbnail
User 410289 avatar

By CodeJustin
via zef.me
Published: Nov 12 2009 / 02:57

For the past years there has been a lot of hype around Ruby on Rails. It’s a modern web framework built on the dynamically typed Ruby language. It makes heavy use of Ruby’s meta-programming abilities to essentially create an internal domain-specific language for building web applications. People love Rails and rightfully so but it’s not perfect. An often overlooked problem is debugging; what if programmers make mistakes Sure real programmers don’t make mistakes especially ruby on rails programmers but let’s say they do for argument’s sake. What happens then Is the bug easy to track down or do we get buried in stack traces that only DHH understands To test this out I followed Rails’ "Getting Started" guide and made "accidental" mistakes along the way to see how the system would react.
  • 24
  • 6
  • 3260
  • 0

Comments

Add your comment
User 335891 avatar

onno.solin.eu replied ago:

0 votes Vote down Vote up Reply

The author claims that it's very hard to debug your mistakes in Rails.

The examples of "mistakes" are contrived (mostly typos which are easily solvable with a global search on your code base), but the point is valid: frameworks based on dynamically typed languages can be tough to debug.

On the other hand, from what I understand from e.g. the Java-based frameworks, most of the examples the author gives would take place in configuration files, which cannot be statically type checked either.

To prevent more serious, non-trivial errors you should always use unit testing.

Onno

User 191902 avatar

jcblitz replied ago:

2 votes Vote down Vote up Reply

How do you do a global search for a typo? Seems logically impossible.

User 335891 avatar

onno.solin.eu replied ago:

0 votes Vote down Vote up Reply

Well, that's the author's point, kind of.

But you usually get alerted by an error message (or you inspect the top of the stack trace). If, by then, you're still unaware of the exact location (i.e. line number) of the offending code, you copy the keyword out of the error message and perform a global search.

User 209172 avatar

mcnaz replied ago:

1 votes Vote down Vote up Reply

"To prevent more serious, non-trivial errors you should always use unit testing. "

The above summarises it best. Rails provides unit and functional testing (plus integration testing) that can trivially catch such coding/typo errors.

Downvoted for "ZOMG!!11one Rails can't read my mind and fix my typos = FAIL" when in fact sufficient detail was provided by Rails to quickly find and fix these errors.

Add your comment


Html tags not supported. Reply is editable for 5 minutes. Use [code lang="java|ruby|sql|css|xml"][/code] to post code snippets.