Hacker News new | past | comments | ask | show | jobs | submit login

The first missing part: A language with a sane syntax. For some examples of the multitude of ways in which Ruby syntax is awful, see [1].

The second missing part: Ruby is Rails. Trying to learn Ruby at the same time as a modern web framework with all its moving parts? Forget it.

The third missing part: Tutorials. Okay, I haven't done a rant on this. Google rails tutorial. The first helpful result I get [2], I scroll down. The first meat is "Setting the application home page". I see this:

    Blog::Application.routes.draw do
      get "welcome/index"
Huh? "This is your application's routing file which holds entries in a special DSL (domain-specific language) that tells Rails how to connect incoming requests to controllers and actions." So it's not even Ruby or some recognized Web glue language like HTML or CSS; it's some domain-specific language? Okay, I totally don't get it, so as suggested, for more details, I should refer to "Rails Routing from the Outside In" [3].

This is even more confusing. It says you should do something like this:

    get '/patients/:id', to: 'patients#show'
Huh? What's the deal with the colons and octothorpe? I can guess colon is the signifier for an ID in the URL, but why the pound sign for #show?

    get '/patients/:id', to: 'patients#show', as: 'patient'
And what's the deal with the colons?

I could go on and on. I'm sure that with a few hours of pain and frustration, I would be able to figure out exactly all the oddities of Ruby syntax, or the template language, or the DSL whatever, and understand this example well enough to extend it.

But that's not the point. The point is that, because I have to spend those hours, it means that Ruby/Rails is poorly designed. In Django, by contrast, things are almost always simple and obvious.

[1] https://news.ycombinator.com/item?id=5872899

[2] http://guides.rubyonrails.org/getting_started.html

[3] http://guides.rubyonrails.org/routing.html




Ruby has a sane syntax. It probably seems a little foreign if you're new.

'#' is the standard notation used throughout the Ruby language for instance methods.

Think of it like this:

  Blog::Application.routes.draw do |implicit_self|
    implicit_self.get( '/patients/:id', { to: 'patients#show', as: 'patient' } )
  end




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

Search: