Hacker News new | past | comments | ask | show | jobs | submit login
Rails creator, DHH, on Java and the other 'junk' (infoworld.com)
24 points by nickb on Sept 2, 2007 | hide | past | favorite | 23 comments



Title is a bit misleading. The 'junk' DHH refers to is the baggage of enterprise apps generally (which everyone knows), not a specific diss against Java.


Programming in latest greatest language = bad.

Time is an investment in your future, when you take the time to learn a language, you have invested in yourself. If you pick some new on the block language like Ruby on Rails is that a good investment?


The language is Ruby. "Ruby on Rails" could be considered a domain-specific language, but most think of it as a web application framework built on Ruby. Learning a language that exposes you to new ways of programming is a good thing (tm). Learning a language that broadens your mind AND makes you more productive is even better. Is it a good investment for you? Depends on what you already know. If you already have good knowledge of a reasonable language + framework (e.g., Python/Django), then you might just want to go off and build your business. If all you know is PHP and you've been hand-coding spaghetti web apps, then learning RoR is a good investment, if at least to expose you to some reasonable programming patterns.


That is it, I had not heard of Ruby until I started seeing a lot of postings about Ruby on Rails.

I never got past the part where you have to make a configuration file or something to generate the code for your page. That just seems to me a bad idea. I realize now that is just the RoR part to make getting into Ruby easier.


You probably know this already, but I'd like to clarify for future readers:

The one configuration file you have to set up when you first start a Rails project is database.yml. It tells Rails how to talk to your database. There are two fields for you to fill in, "database" and "password". The rest of the fields are filled in automatically.

Here's an example database.yml file. Notice that it has three environments (development, production, and test), and that different databases are used for each. If you're developing your application, you're using yourapp_dev. Rails uses yourapp_test during unit testing:

 common: &common
    adapter: mysql
    host: localhost
    username: root
    password: somepassword
 
 development:
    database: yourapp_dev
    <<: *common

 production:
    database: yourapp_prod
    <<: *common

 test:
    database: yourapp_test
    <<: *common


Correct me if I'm wrong, but isn't Ruby still an OOP language? so in a way, there is no "new ways" of programming so to speak. Just that Ruby is dynamic whereas C-based family languages aren't.


Ruby's main advantage is that they've nailed the syntax sugar in all the right places. For example, given function foo:

 foo()
is equivilant to

 foo
Also, code blocks are specified outside the function argument list. Something that looks like this in javascript:

  foo(a,b,c,d,function() {
    console.log("some callback")
  })
would look like this in Ruby:

  foo(a,b,c,d) do 
    puts "some callback"
  end
or even just:

  foo(a,b,c,d) { puts "some callback" }
That last one isn't a function definition.. it's a function call equivalent to the example before it.

It's mostly the fact that it -looks- cleaner in all the right places that makes it appealing. That and the massively powerful web framework built on top of it.


But Ruby is still OOP right? And these syntatic sugars don't really change the way people program in a hardcore way no?

Basically this is another way to make your loop looks nicer but nothing more.

You could argue this case if the language in the topic is something like LISP or Haskell compare to the C-based languages.


There's more to a language than whether it's object-oriented or not. It sounds like you are saying, well it's just OOP so it's not any different than C++. It's almost like saying "CLOS is still OOP, right?"

Yes, Ruby is dynamic. It's so dynamic that you have open classes so you can dynamically insert methods. It has deep introspection. It has closures. It has #method_missing which lets you do some interesting things. Basically, Ruby is just powerful enough, just over that tipping point, so programmers wind up doing metaprogramming (programs that write programs) more than they would in other languages. I'm sure Paul Graham has an article or two on the power of languages (smiley face here), and in at least one of them, he suggests that some people might mistake Ruby for a dialect of LISP.

See why_the_lucky_stiff's tutorial on D&D metaprogramming (Dwemthy's Array section at http://qa.poignantguide.net/chapter-6.html) and Rich Kilmer's use of Ruby for an aircraft management DSL (you'll have to google for that example). It's not that metaprogramming is impossible in C/C++ because you could always build a whole mechanism from the ground-up. (In other words, at some point you can claim that all these languages are Turing equivalent if I remember correctly.) The point is that some languages make interesting ways of programming easier, and when you hang out among the practioners of that language, you begin to see different ways of coding. This is why I've got Erlang on my TODO list, if I can squeeze it in my schedule.


But.. Erm.. making a program nicer is the sole purpose of all high level programming languages. Programmers read a lot more than they code. The nicer it makes your program, the more powerful it is.


As pretty as it may be, picking a language is an important choice, the oldest web application I have designed has already been online for 7 years and I expect it to last more or less forever. So making a choice of language is important, jumping on the bandwagon of the latest and greatest (and it does sound pretty good) might be a problem later on. My point was more about making a long term decision.


This is a calculation that depends entirely on your circumstances. As a startup, you want to get the best product out to as many people as fast as possible, 7 years in the future be damned. Other circumstances (such as being a big corporation) demand more attention to other aspects such as maintainability.


" foo()

is equivalent to

foo "

Man, I hate that 'feature' of Ruby. In Python, foo is the function, foo() the result of calling it. So much cleaner.


'C-based family languages"?

Objective C is fully dynamic. Typing is entirely optional. If you give every type declaration the type 'id', it's effectively the same as using 'var' in e.g. javascript.

I'm not sure what you mean by C-based, but I'm guessing ObjC would fall in your definition.


Yes.

The time investment to learn a new language isn't linear.. It seems logarithmic. Learning the basic syntax details does take a little time, but then you can start thinking in that new language.

The learning curve only gets gentler as you learn more languages.


If you are a consultant then definitely, Rails consulting is paying 2-4x what most PHP developers are getting at current market rates.


are PHP programmers only making ten dollars an hour?


are rails consultants only getting 20 an hour?


Actual Cost vs Benefit calculation = not simple.


So what are you using, vb6?


Wow, just say "Java is junk" and you get 20 points of karma?


Well, many people (myself included) honestly believe so.

I think DHH nails it in the article when he likens Java's failure to input from "multiple special interest groups".

Java is design of a platform/language by committee, and is a PITA because of it. I'd rather use classic ASP and trim my app's purpose than use Java/J2EE and implement the monstrosity.


Hm, and ASP was not designed by committee? I thought it is a Microsoft thing, which hardly lends much hacker credibility.

Contrary to what many people think, Java is actually often the coders choice in the companies that adapt Java. It is not only a management decision - in smaller companies, the coders actually have a say...




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: