Archive for January, 2006

Reporter Guido van Rossum at Google Base

January 15, 2006

Interesting news from reporter Guido van Rossum at Google Base:

Python is big at Google.

And did I mention that I get to spend 50% of my time on Python?

If it uses two-space indents, it’s corporate code; if it uses four-space indents, it’s open source. (If it uses tabs, I didn’t write it! :-))

Read for yourself: Python Status Update

What is wrong with the MVCs I see?

January 11, 2006

Some minutes hours ago, in a phone conversation with a dear friend, who also happens to be a decent programmer, I expressed my feeling about the Model View Controller pattern Rails is claiming to adhere to. Something feels wrong. And not only MVC in Rails.

Say I have a bunch of recipes, all nicely assigned to a smaller subset of categories. (Does that sound familiar?)
In Rails, if I would want to show all recipes on the recipe index page.

My controller class would look like this:
class RecipeController < ApplicationController
model(:recipe)

def index()
@recipes = Recipe.find_all()
end
end

With an accompanying model:
class Recipe < ActiveRecord::Base
belongs_to(:category)
end

What disturbs me is the find_all() method in Recipe.
Yes, I understand that Recipe subclasses ActiveRecord. But I would not expect the Recipe class to know about all its kin:


Richard.find_all()
paraphrased
"Say Richard, pass me a reference to all people on earth, will you?"

Would it make sense to have some other class that would know about Products and supply the controller with data?

Another thing that bothers me is the php’ish way of having Ruby code in templates.

<% @recipes.each do |recipe| %>
<%= recipe.name %>
<% end %>

Aren’t that model instances we’re massaging in our view? Doesn’t that make our view partly a controller too?

Looking for answers I found an in-depth article (MVC and web apps: oil and water) by Harry Fuecks on MVC and its applicability in web applications. Take your time to read the articles he links to too.

Please let me know what you think.

Pay attention. I’m not bashing Rails. Beautiful apps have been written in that framework. I’m a paying Basecamp user, for example.

I’m just searching for the truth.
the truth is out there
And the truth is out there.

Antipasta versus Pasta

January 10, 2006

A Pattern is a form of solution intended to address a problem. The problem for Pattern readers has always been to identify when and how a Pattern should be used.

An AntiPattern is defined as “a commonly occurring solution to a problem that generates decidedly negative consequences;”
in other words, an AntiPattern is generally a commonly repeated practice in industry that is flawed in some manner and causes symptoms that are more undesirable than whatever positive results were sought.

AntiPatterns and Patterns

Found on The Servlet Framework Antipattern

antipasta antipattern

Ruby on Rails starter II / II

January 8, 2006

Ok, after quite some hours of work I got a grasp of both Ruby and Rails’ basics. In addition to the links I already mentioned, I found the RubyOnRails API also very useful.

Some results:

reviewer ruby on rails app

reviewer ruby on rails comment

I took an extra 20 minutes to add the logo. Only because I was making screen shots for my blog :)

I’m really tired, so some quick notes.

  • Yes I like the quick way of working with Ruby on Rails
  • No I do not like the freedom Ruby gives. I’m coming from Python and really find the Python coding guidelines very valuable. But let’s not go into that.
  • I’m positive about the framework. It did what it promised. But the ‘perly’ way of indicating variables really held me back: ‘product’, ‘:product’, ‘@product’ and ‘#{product}’ can all reference some product, depending on the context.
  • Before deciding on wether I really want to dig deep into RoR, I want to evaluate Subway, a framework insprired by Rails. It’s written in Python, which gives it a large advantage over Ruby on Rails. Sorry about that ;)

    Update 2006-01-09 23:01h: Colleagues pointed me to TurboGears. Another python framework “much like Rails”. My todo list is growing…

    Ruby on Rails starter I / II

    January 7, 2006

    As a weekend excercise, I’ve started spending time on Ruby and Ruby on Rails. Three Six valuable links:

    • Ruby Tutorial by Daniel Carrera.
      Getting the basics.
    • Instant Rails by Curt Hibbs
      Ruby, Rails, MySQL, Apache. All in one app! It can even run from your USB memory stick. 2 thumbs up.
    • ONLamp Ruby on Rails example: part I and part II.

    My aim for this weekend is to build a personal wine review blog, for me and my woman. If I manage to create something, I’ll post screenshots. Or better, a working site! (Nah, don’t bet your money on it)

    As well the content, as the level of humour require two extra links, both from Amy Hoy’s (24)slash7.com weblog:

    Update 23:54h: Screenshots of my premature ‘reviewer’ product. Time for bed.

  • List of all products
  • ruby on rails list items

  • Show a single product
  • ruby on rails show item

  • Edit a product
  • ruby on rails edit item

    Aardvark’d: 12 Weeks with Geeks

    January 4, 2006

    Bought the movie, felt the disappointment…

    I couldn’t have reviewed it better than Mike did.

    “This is a documentatary for sure, though it is NOT much of a documentary on the software development process or turning out a software product.”

    “The balance of the film is just plain unexciting and more a documentary of ‘how we spent our summer vacations.'”

    “Joel reviews his own movie and compares it to Code Rush and Startup.com and says those movies ‘totally pale in comparison.'”

    It was Joel’s own review that made me think I was ordering a movie on software development. Not a happy story of 4 geeks spending their summer vacation in the city.

    Aardvark’d is not a bad documentary. It’s just that it did not meet my expectations.


    Follow

    Get every new post delivered to your Inbox.