Archive for September, 2006
September 29, 2006 at 5:09 pm · Filed under General, Ruby and Rails

So I finally have some time to handle a series of posts on Ruby and Ruby on Rails.
I’ve been playing with Rails for a while, at least over 1 year. I like it and I wouldn’t consider using anything else. The framework is well designed. For example, the form editing pattern is just so smart. The code looks simple, but only because the infrastructure was the result of some thoughtful debates. No other framework seems to get this right, out of the box. (In the same way programming languages love to demo the fibonacci code, yet falls apart in a real-world application)
Here are two other observations. The most popular observation is that people are just more productive in this system over any other system. This is a result of the language, the framework, and the best practices for the development environment. One personal observation is that I’m productive when changing older code in the system. The system is easy to navigate and consistent. It doesn’t take long to figure out what the intention was.
Overall, I would highly recommend this environment and will not expound any more on this. Try it out.
Also, although I’ve been productive in Rails and Ruby… I haven’t really known the language. Just recently I broke down and got the book. I know that may sound a bit odd, but the reality is that I could be productive in Rails and with Ruby in a project without really understanding Ruby. This says something about the language.
So, after doing some more generic projects in Ruby, I’ve come around to liking the language. I can be just as productive in that language as I can in Python now. It will be the first choice for any project.
Two other interesting points.
I’ve been getting a bit of flack from some people about the whole being CTO and still doing the coding thing.
IMHO, if you have a CTO that can’t code something real and useful, they are too disconnected from reality to be effective.
I’m going to get some of the code I’ve worked on available as open source. It is time to give back to the Ruby and Rails communities.
September 20, 2006 at 8:35 am · Filed under General
I think the following article/blog post at GigaOm is great news for the game industry.
Greg Costikyan’s Gaming Manifesto
Update: Greg’s blog is a great read to, just check this post
September 19, 2006 at 12:32 pm · Filed under General
“Of all races in an advanced stage of civilization, the American is the least accessible to long views… Always and everywhere in a hurry to get rich, he does not give a thought to remote consequences; he sees only present advantages… He does not remember, he does not feel, he lives in a materialist dream.”
—Moiseide Ostrogorski (1902, 302-303)
September 16, 2006 at 5:32 pm · Filed under General
As I get more and more into the Rails Ruby thing, I’ve thought of a bunch of comments.
One that recently pushed me to the ‘blog about this’ limit is the discussion of Domain Specific Languages or DSLs.
There appears to be a lot of interest in building DSLs in Ruby. When you read some of the papers, it becomes quite obvious why Python is going to miss this boat. It also explains some of the difficulty as to why some DSLs that I did in Python didn’t take too well…. The whitespace indentation. If you are open-minded and you can get over that hump, you will eventually appreciate Python’s take on the problem.
But how many open minded people… or programmers are out there? By my count… not a lot. Everybody, including me, has blinders on. It’s provable as well. You hear some new programmers gush about Ruby as such a great language. Yet the language is 10 years old. Why is the phenomenon so recent? It is because programmers tend to be into fashion (surprise) just like everybody else.
So, how does this get back to the DSL problem? Simple. Python is the only reasonably successful language to attempt the whitespace is ‘really’ significant tack. Yet, this is a major piece of friction for newcomers, religious non-python programmers, and even python people who are working with other programmers (read TABS). It is also a huge piece of friction when it comes to implementing a DSL. Every attempt at doing a templating language for HTML, for example, has ended up looking a lot like something that isn’t Python. When I used the clever ‘eval’ trick to have Python become my configuration file language… the users hated it. This is a real problem for Python.
Ruby, on the other hand, is easy to use as a DSL platform. You don’t get burned by whitespace. This is one of the key reasons that Rails succeeds with Ruby. All files use Ruby. Even the templating language RHTML, Ruby. It works well…. really well.
So where does this leave Python? It leaves it with less energy and momentum for the future. Ruby is so similar to Python in many respects, yet with better features (ie. lower friction). Ruby will be used in more and more projects. Ideas from the Python world will drift over to the Ruby camp. Look what it is doing to the Java community as well. Perl? PHP?
Someone once exclaimed to me ’syntax doesn’t Matter!’. Oh how wrong they were!
Sidenote: Humor
Ok, so if the era of the ‘P’ languages has passed, and we are in the new era of ‘R’… will we end up with ‘S’malltalk?
September 15, 2006 at 12:45 pm · Filed under General
Microsoft announces the Zune… finally.
As I travel to http://www.zune.com/ I am greeted with an all-black ‘UNDER CONSTRUCTION’ page. Apparently, Microsoft didn’t acquire the domain name before the announcement. I have a feeling that the owner, GATE MARKET RESEARCH LIMITED has a smile a mile wide. I’ll bet Microsoft is prepared to pay 7 figures right now for the domain!
September 13, 2006 at 10:55 pm · Filed under General
The field name type is a dangerous name for a field.
The ‘type’ method in Ruby became deprecated.
It is also considered a “Magic Field” name. Specifically, it is used for Single Table Inheritance.
So save 15 minutes of your life by considering the field names for the objects in your database.
September 13, 2006 at 12:31 pm · Filed under General
If you are developing more than one rails web application at a time, it may be convenient to have more than one webbrick running. In order to prevent them from colliding with each other, they have to be run (bound) to different TCP ports.
Typically, you could do this by hand by running: script/server –port=3030
This, however, requires you to remember something that you probably won’t change that often. I searched for an environment variable that would affect this option on Webrick, but I couldn’t find one.
Here is a super tiny recipe that I use for changing the port in the server script.
Just change your ’server’ script to the following.
!/usr/bin/env ruby
if ! ARGV.find { |e| e.include? “–port=” }
ARGV < < “–port=3001″
end
require File.dirname(FILE) + ‘/../config/boot’
require ‘commands/server’
September 13, 2006 at 11:41 am · Filed under General
Over the last year or so, I’ve been using Ruby on Rails. For my latest gig, we have a shipping a Ruby on Rails app that is critical to the success of our service.
Although I could expound on the Ruby on Rails framework right now, I won’t. I will do that later. For now I just wanted to mention that you may see more and more blog posts from me that are essentially rails recipes or tidbits. This adheres to the origininal intent of this blog. It was meant to be a public source of helpful information for anybody on the internet.
Ok, so now for some tips…
« Previous entries ·
Next entries »