Main Content

But the language supports it

About the Talk

May 29, 2011 10:00 AM

Discussing language constructs with fellow developers in the context of solving a particular problem is something we do routinely. While most such conversations are productive and useful, a fair portion degenerate into angry brawls. A pattern we've observed in the latter situation is that a surprising number of times the argument is that "Why shouldn't I use language feature X to achieve objective Y- after all, the language supports X."

In this talk we will cover various features provided by Ruby that, while awesome, should be used with caution. We will cover:

  • The appropriate situation where a certain language construct should be used
  • Situations where I've seen it misused
  • The underlying principles that will guide you as to how to use it best.
  • Alternative approaches that achieve the same effect

Here's a brief list of language constructs I will cover: 1. if and switch-case 2. return 3. raise (exceptions) 4. private/protected methods 5. variable method arity (includes ActiveRecord style constructors that take any number of arguments tunnelled through a hash) 6. Class methods 7. Inheritance 8. Custom instance allocators as factories (overriding Class#new) 9. Re-opening classes, especially classes from the core libs 10. eval

Ratings and Recommendations

This Talk hasn't been rated yet. Sign In to rate Talks.

comments powered by Disqus