wooyay wrote the following on 23.03.2007 17:45 :
At Lambda the Ultimate there is an entry about Lift, a new java servlet
based web framework that claims to kick some asses. Has anyone taken a
look at it?
Article:
Lift homepage:
From the Lift homepage :
"[…] lift code is as clean and brief as Rails […]"
followed by these examples :
User.find(ByField(User.email, ))
User.find(ByField(User.id, 20))
Hum, does it look as clean and brief than:
User.find_by_email User.find 20
to you?
Next thing:
“the LoC for lift tests is about 60% compared to Rails because
there’s no need
to write tests for type-related issues”
I don’t think this statement is accurate. I’ve never coded any test to
check for type-related issues. Either the code works as intended or
not. Why should anyone care if it’s because of a mistake in an
algorithm, a typo in a value or an exception caused by an unitialised
variable? We are not interested in the source of the error (with the
exception of the content of the test output on failure which should be
as detailed as possible).
So-called Rails-like frameworks all miss the same thing in my
experience: the increased readability and efficiency brought by
meta-programming… Funny their developpers don’t get it and still
present their frameworks as Rails-wannabees.
Lionel.
From the Lift homepage :
/"[...] lift/ code is as clean and brief as Rails [...]"
followed by these examples :
User.find(ByField(User.email, "f...@bar.com"))
User.find(ByField(User.id, 20))
Hum, does it look as clean and brief than:
User.find_by_email "f...@bar.com"
Yep. Rails saves you 15 characters (did I count that right?) It also
gets ugly when:
User.find_all_by_state_and_city_and_gender("MA", "Boston", "M")
Because one loses the association between the field and the parameter.
User.find 20
User.find(20) is also a valid construct in lift.
to you?
Next thing:
"the LoC for /lift/ tests is about 60% compared to Rails because there's
no need to write tests for type-related issues"
I don't think this statement is accurate. I've never coded any test to
check for type-related issues. Either the code works as intended or not.
Why should anyone care if it's because of a mistake in an algorithm, a
typo in a value or an exception caused by an unitialised variable?
Because in a strongly typed language, the compiler takes care of
finding those defects and there's no reason for a human to do the work
when the computer will.
So-called Rails-like frameworks all miss the same thing in my
experience: the increased readability and efficiency brought by
meta-programming... Funny their developpers don't get it and still
present their frameworks as Rails-wannabees.
Actually, lift is not a Rails wannabee. It's a framework that borrows
a bunch of Rails' very good ideas, borrows a bunch of Erlyweb's very
good ideas, borrows a bunch of TurboGears' very good ideas, borrows a
bunch of Seaside's very good ideas, etc. However the post was based
on the real-world example of migrating a Rails app to lift.