HNHacker News
TopNewBestAskShowJobs

nkallen

265 karma · joined November 7, 2007

submissionscomments
nkallen··on Why I love everything you hate about Java
Yes but you still need to inject the Factory. My point is not that Java is better than Ruby but that this style, which is commonly associated with Java, is better in any language.
nkallen··on Why I love everything you hate about Java
Since you don't control the code that manufactures instances of MyClass.new, you don't have an opportunity to manipulate the metaclass/singleton class of instances of MyClass. So this technique doesn't work.
nkallen··on A New Declarative Caching Library for Rails
It could be extended to work with DataMapper in a straightforward way.
nkallen··on Haskell-style monad do-notation for Ruby
clever
nkallen··on Ask YC: Django vs Ruby on Rails
So I can't really comment about Django. I have some Python experience and very extensive Ruby and Rails experience. My advice: choose based on language not on framework.

It's fair to say that Python is a more "general purpose" language in that it has more extensive libraries and is faster.

It's also fair to say that for people who are language nerds, those who enjoy the power and elegance of particular languages, the kind of people who dick around in Scheme, Haskell, Factor, etc., Ruby is the better language. It has more interesting ideas (expressional syntax, open classes, the best case statement of any language ever) and significantly more powerful metaprogramming and DSL capabilities.

Both languages have blemishes, let's call that a wash.

There are certain features, that really come down to personal preference. Ruby has mutable strings, python doesn't. Ruby has a complex grammar, and there are usually several (readable) ways to express the same thing: for exmaple:

  unless smelly?
    eat!
  end
and also,

  eat! unless smelly?
Python is very minimalist grammatically. Python has significant whitespace, Ruby doesn't. The grammatical maximalism/minimalism is the most contentious issue. I used to be a minimalist and I feel like I have seen the light, but I respect those who disagree.

Now when it comes down to web frameworks, I don't think it matters so much... What is Rails? It's an ORM, a powerful Routing layer, a bunch of helper libraries for doing views, and a mostly useless controller layer. As a very advanced Rails user, I use very few of the view helpers anymore. I kinda like the way Django does forms better than Rails, though I've never really used it. Rails does REST really well. To be honest, the best framework out there right now is Merb.

nkallen··on Screw.Unit: Behavior-driven Testing in JavaScript
murrayh -- i'm an author of screw.unit. Can you provide more detail of the kind of real-world example you'd like to see?
nkallen··on Making Rails Wicked Fast: Pagecaching Highly Personalized Web Pages
Many highly personalized pages don't have security or admin bits--e.g., when reading an article, it differs based on whether you've favorited it, are the author, etc. Sometimes there are admin bits but they're trivial--a link to delete content, but this link is secured using authorization during the write operation.

Pagecaching can hit 4000 reqs per second on commodity hardware--it's way better than the best you can get with db caching (100 reqs per second if you're an optimization god). Finally, pagecaching individual pages per user is mostly useless since your cache hit ratio is so low (i.e., it takes very little load off your Rails app).

Pagecaching does not kill the point of Rails--Rails is about getting apps done quickly and beautifully. You still use Rails to render pages, and you still use Rails to do all write operations. Caching just means rails doesn't have to constantly recompute data that doesn't change!

(disclosure: I'm the author)

← PreviousPage 2 of 2