So I think it is time to blog about things again. Been too long. Well well. mrjabba is busy writing a Rails app that manages soccer leagues. You can find the source on github.
I am not sure that I want to keep this blog in its current form anymore. Now that I have so many more deployment options, I'm considering using something like jekyll then I think I could combine that with a rails or sinatra app as the base for anything dynamic? Sound good? We'll see.
Showing posts with label rails. Show all posts
Showing posts with label rails. Show all posts
Friday, October 15, 2010
Wednesday, June 18, 2008
I love me some Ruby
So, I'm learning Ruby and Rails at home, and I'm absolutely loving it.
I love the little idiomatic stuff that make typing in it so concise.
Let's say that I have a list called mylist. I want to add an object to the list, foo.
In Java, I'd have to go something like this.
In Ruby, it's just this:
It's not earth shattering, but there are a dozen examples like this that I really like. If you understand the symbols and operators of the language, it actually reads just fine. Maybe I'm getting cranky in my old age and not wanting to type out all that stuff as much anymore.
Another perhaps bigger example was the "attr_accessor" convenience method.
What just happened here? For me, the critical part was the getter/setter bits. In Java, I'd have to select a menu option in Eclipse to generate the getter's and setter's for this class. Imagine a class with 10 fields in Java. You are NOT gonna type out those methods.
In the Ruby case, it's just 1 line of code. And, you can add more fields to the same line. "attr_accessor" tells us that what are our accessor methods. Nice!
See also attr_reader and attr_writer which do as you would expect, allowing only read or only write methods.
I love the little idiomatic stuff that make typing in it so concise.
Let's say that I have a list called mylist. I want to add an object to the list, foo.
In Java, I'd have to go something like this.
In Ruby, it's just this:
It's not earth shattering, but there are a dozen examples like this that I really like. If you understand the symbols and operators of the language, it actually reads just fine. Maybe I'm getting cranky in my old age and not wanting to type out all that stuff as much anymore.
Another perhaps bigger example was the "attr_accessor" convenience method.
What just happened here? For me, the critical part was the getter/setter bits. In Java, I'd have to select a menu option in Eclipse to generate the getter's and setter's for this class. Imagine a class with 10 fields in Java. You are NOT gonna type out those methods.
In the Ruby case, it's just 1 line of code. And, you can add more fields to the same line. "attr_accessor" tells us that what are our accessor methods. Nice!
See also attr_reader and attr_writer which do as you would expect, allowing only read or only write methods.
Friday, April 25, 2008
SQL's brain-lock on the development community....
I was reading this blog post by Tim Bray on the subway this morning. It seems so spot on to me. So, I'll link to it now and maybe comment on it later.
By the way, Tim was one of the co-founders of OpenText back in the day.
Tim Bray: Multi-Inflection-Point Alert. The comments are quite insightful as well.
By the way, Tim was one of the co-founders of OpenText back in the day.
Tim Bray: Multi-Inflection-Point Alert. The comments are quite insightful as well.
Subscribe to:
Posts (Atom)