On programming and Ruby

After registering my wordpress blog(s) I saw it fit to look through what other wordpressers had to say about programming, API design and choice of language. What I found was very articulate with respect to the aspects Ruby programmers notice (or sense) about ideal Ruby code; but rarely explicitly describe as these aspects are very abstract.

  • The Plan A: A good API must
    All very good points on API design which can be seen in action within most popular Ruby projects. The point on good APIs being “Easy to use, even w/o doc” gives weight towards creating fluent-interfaces. “Easy to read and maintain code that uses it” definitely reminds me of the benefits to code-readability that DSL(-like) APIs yield.
  • 41 technologies: Shooting yourself in the leg with a bazooka
    A bit of an extreme title, but equally good points on common design mistakes that we’ve all either seen in the wild or were once guilty of. The point on “Overcomplicated Design” reminds me a lot of some Java code out there, where the programmer went wild with OOP. All beginner Ruby programmers coming from other languages should read the warning about “Writing too much code”. Writing too much code is un-necessary thanks to Ruby’s closures and meta-programming abilities. Finally the point on “Reinventing the wheel” is a good one, chances are “the wheel” one requires is probably already written and in the form of a ruby-gem ready to be installed.
  • My Half-Life2: Language war: real stuff
    Still having language wars amongst your friends? Well don’t get too bent up over it, “Language war: real stuff” points out that languages-wars serve as a collective debate over the designs of current languages, highlighting their successes and areas that need improvement. Language Wars also help introduce people to new languages and programming paradigms. The post also links to other fascinating discussions on the pros/cons of the various programming languages of our times.

These points shouldn’t be ignored and will save huge amounts of time and effort that go into Ruby projects. Learn how to fully utilize closures (blocks), meta-programming techniques, and DSL design then programming in Ruby will become easy and fun. These techniques are not just advanced tricks that will make one’s code difficult to use by beginner programmers, but will in fact reduce the amount of work needed to create and use the code.


About this entry