Interviews: Ask Ruby on Rails Creator David Heinemeier Hansson a Question 109
David Heinemeier Hansson created the Ruby on Rails open-source web framework in 2003. David is also the founder and CTO of Basecamp, a project management tool that's been used by more than 15 million people. In addition, David is the best-selling author of REWORK, a book about starting and running businesses a better way. David has agreed to take some time to answer some of your questions.
Ask as many questions as you'd like, but please, one per comment. (And feel free to also leave your suggestions for who Slashdot should interview next.) We'll pick the very best questions -- and forward them on to David Heinemeier Hansson himself.
Ask as many questions as you'd like, but please, one per comment. (And feel free to also leave your suggestions for who Slashdot should interview next.) We'll pick the very best questions -- and forward them on to David Heinemeier Hansson himself.
Naming (Score:3)
"Ruby on Rails" ? Is there a good reason for the name, or were you watching too many old western train movies?
Re: (Score:2)
The creator of Ruby (the language) was named as an honour to Perl, which Ruby borrows some (but not all) ideas from.
Source: http://ruby-doc.org/docs/ruby-... [ruby-doc.org]
Re: (Score:2)
"Ruby on Rails" ? Is there a good reason for the name, or were you watching too many old western train movies?
Here [ruby-forum.com] has a discussion of the name in RoR's early time (2007). Also, it seems that many people do not even know what Ruby on Rails [rubyonrails.org] is. My company is still using it and I am the only person develop and maintain the application... Not a bad web frame work at all.
Re: (Score:2)
Re: (Score:2)
Re: (Score:2)
ASP was a fad, too. In fact, the vast majority of things in computing are fads.
^^^ AMEN. Preach it! :-)
And even those things that aren't fads disappear even though they're still useful. Zip drives, CDs, boot floppies for those times that nothing else works, all sorts of software that has been re-written and does a worse job than before, all the software that would still work just fine except the OS can't run it, ...
Re: (Score:2)
But as you point out, you're the only one still developing and maintaining a single application using it. Both Ruby and RoR were fads. Nice to see them continuing their steady decline to irrelevance.
First, I don't know why you are attacking me. I've been working with it because our company is using it. I'm not the "person" who made the decision to use it. Second, my company has several applications using it (internal use). RoR is best for small companies with small to medium database size. Last, the framework becomes fad (in opinion of many people like you) because many others didn't use it properly. They jumped on the band wagon right away, and as a results, they found out later that the framework doe
Re: (Score:2)
So, pointing out the truth is now attacking someone? Okay, maybe it is in this case, for you trying to justify continuing to go along with a stupid decision made by someone else that will become unmaintainable once you leave/get hit by a truck/develop dementia.
An outsider could argue that you prefer it that way because it gives you job security, not because it's the best tool for the job (which it isn't going forward).
Attacking ruby and ruby on rails does not mean someone is a bitter person. Just means th
Re: (Score:2)
Who said anything about linux? Ruby on Rails is definitely falling out of favor.
It is now official. Netcraft has confirmed: Ruby and ruby on rails are dying
One more crippling bombshell hit the already beleaguered Ruby and ruby on rails communities when IDC confirmed that Ruby and ruby on rails market share has dropped yet again, now down to less than a fraction of 0.01 percent of all projects. Coming on the heels of a recent Netcraft survey which plainly states that Ruby and ruby on rails jave lost more market share, this news serves to reinforce what we've known all along.
Elixir and Phoenix (Score:1)
Life after your 15 minutes of fame. (Score:3)
Ruby On rails had a huge spike in popularity a decade ago. Then the traditional forms of development had taken over. How do you plan on keeping the language up to date on the current trends?
Re: (Score:1)
Rename it "RoR.node.nosql.js++"
Why? (Score:2, Troll)
What in god's name possessed you to create this monstrosity?
Why not Python? (Score:5, Interesting)
You ended up with something that reads almost as the same as Python, which has a much larger audience and library set. Couldn't you have just started with Python?
Re: (Score:2)
Ruby On Rails != Ruby
(the guy being interviewed didn't write Ruby)
Re: (Score:1)
Re: (Score:2)
To the people who modded me troll, I really what to know why, given the substantial similarities, he chose to create Yet Another Language which only minor changes to an existing one, and created an entire other community which fractures the industry into yet another shard again. There is an existing plethora of OOP languages. I just want to know why he felt his was the right course of action.
On a personal level I think it's immoral from an industry perspective to fracture the community (and the productivit
Re: (Score:1)
Is it still a troll post if it's true?
/me ducks
Re: (Score:2)
Python is awful but its popular. Its less awful than javascript or ruby though.
Re: (Score:2)
A little over 10 years ago I wrote an article for Lxer about the Snakes and Rubies talk [lxer.com] given by David Heinemeier Hansson and Adrian Holovaty (co-creator of Django) at DePaul University in Chicago.
It was quite a talk. Opened up quite a few opportunities for me over the following years. I don't think people even begin to realize what a profound effect efforts like RoR and Django had on the industry. Enterprise level web development was extremely painful with frameworks existing at the time. Getting well ma
Influences? (Score:3)
Re: (Score:2)
Eggs well done.
Bacon is not just for bacon and eggs any more.
Abstractions (Score:4, Informative)
I worked on a project around 2007 that used Ruby on Rails. That was my first experience with Ruby and my first experience with a real web product. I liked Ruby and Rails, but it was easy to get bitten by some of the abstractions. I remember the site bogged down really bad whenever we searched for a record in a large database table. The problem was that the database was hidden behind ActiveRecord, so it was easy to forget we were using a database at all. Writing a for loop to search for a record that matched some criteria felt natural, because our interface was with objects, not the underlying tables. However, behind the scenes, each iteration was a separate query. The result was thousands and thousands of queries, instead of just a single query with a simple WHERE clause. We were essentially doing in Ruby what we could have done much more efficiently in SQL. Once we realized the problem, we rewrote that kind of code so it used more or less raw SQL. The result was much faster, but we lost the readability of the abstraction. Everyone on the team was new to Ruby and Rails (grad students who shuffled in and out each semester), so it's possible that we were just doing things completely wrong. Still, it feels like it shouldn't have been that easy to shoot ourselves in the foot. Have things improved since then? How do you balance nice abstractions like ActiveRecord with performance? How do you make it clear to novices what's going on internally, so they can avoid the mistakes that we made?
Re: (Score:1)
Aren't abstractions supposed to hide the need for specialized knowledge? One should only have to ask it to "save", and the details of how to talk to the database should then be hidden away from the abstraction user.
Re: (Score:2)
Aren't abstractions supposed to hide the need for specialized knowledge?
Not all abstractions are correct. You cannot abstract the reality of remote resources. And your abstractions should be related to your domain model, not on treating remote resources as if they were a local array of things. I suggest you google "Fallacies of Distributed Computing".
One should only have to ask it to "save",
This level of abstraction is correct (but only if the abstraction has been developed properly).
and the details of how to talk to the database should then be hidden away from the abstraction user.
Define "talk". If the abstraction lets you iterate a set of remote resources as if they were a local array without regard to bandwidth o
Re: (Score:1)
Do you have an example or scenario?
The internal guts of an access coordinator could "watch" the timing of requests to know to batch operators together, for example.
Also, one could tell the abstraction how important "recency" is, such as whether it's okay to delay actual writes or not. Perhaps a delay threshold in seconds can be given.
In other words, the abstraction can "ask" one to rank the relative importance of performance-related factors so as to selec
Re: (Score:2)
Do you have an example or scenario?
The internal guts of an access coordinator could "watch" the timing of requests to know to batch operators together, for example.
Also, one could tell the abstraction how important "recency" is, such as whether it's okay to delay actual writes or not. Perhaps a delay threshold in seconds can be given.
In other words, the abstraction can "ask" one to rank the relative importance of performance-related factors so as to select the best internal or vendor-specific implementation choices to fit the trade-off profile given to it.
That may be difficult or impractical to fully implement, but not necessarily impossible in terms of abstracting away details.
Sometimes a DBA will ask me whether to optimize a database or table for quick writing or quick querying, or an in-between balance. I usually don't have to really know how the DBA does that, only give him/her my or my boss's preference.
Perhaps the existence of performance trade-offs cannot be hidden away, but the implementation of those choices largely can.
You are providing counter-examples that are very constrained by nature. I'm referring to general cases of remote resources.
In particular we are referring to the case of executing a predicate on a sequence of remote resources (specifically a sequence of database rows matching some criteria.)
I didn't think I have to make it clearer, but I guess I have to. Very specifically I was referring to general abstractions. Why? Because executing a predicate on a sequence of remote resources is, typically very spec
Re: (Score:1)
I'm still asking for a specific example/scenario/use-case to illustrate your point. You are talking in generalities. Take an example from a university grade tracking system or airline reservation system or something from everyday life to construct a specific scenario. Make a quick and dirty schema for your example, and walk through the scenario steps.
Re: (Score:2)
As I said, this was a long time ago, so maybe I'm not remembering the exact performance problem we hit. My larger point still stands: we were burned by an abstraction, possibly made worse by our own lack of expertise. In our defense, we weren't there to build a website. Or research was in a totally unrelated area, not even really within the realm of computer science, and none of us had expertise building websites that scaled. The website was just the thing we used to collect data and do experiments. We
Re: (Score:2)
I think this is where optimization really kicks in.
AR is great for getting stuff out the door quick, and for most products its fine (After all its cheaper to add hardware than it is to add developers). However there are some problems where "throw hardware at it" wont solve fundamental problems. This is the point where you look at the profiler and realise AR is messing up performance and drop back to SQL.
Re: (Score:2)
I worked on a project around 2007 that used Ruby on Rails. That was my first experience with Ruby and my first experience with a real web product. I liked Ruby and Rails, but it was easy to get bitten by some of the abstractions. I remember the site bogged down really bad whenever we searched for a record in a large database table. The problem was that the database was hidden behind ActiveRecord, so it was easy to forget we were using a database at all. Writing a for loop to search for a record that matched some criteria felt natural, because our interface was with objects, not the underlying tables. However, behind the scenes, each iteration was a separate query. The result was thousands and thousands of queries, instead of just a single query with a simple WHERE clause. We were essentially doing in Ruby what we could have done much more efficiently in SQL. Once we realized the problem, we rewrote that kind of code so it used more or less raw SQL. The result was much faster, but we lost the readability of the abstraction. Everyone on the team was new to Ruby and Rails (grad students who shuffled in and out each semester), so it's possible that we were just doing things completely wrong. Still, it feels like it shouldn't have been that easy to shoot ourselves in the foot. Have things improved since then? How do you balance nice abstractions like ActiveRecord with performance? How do you make it clear to novices what's going on internally, so they can avoid the mistakes that we made?
I agree with what you said that the frame work makes things much easier to deal with database. As a result, one wouldn't know how to optimize it. If I remember correctly, they put in some optimization ways to deal with SQL (such as include, select, etc) starting in either version 1.2 or a little later (can't remember). What it does is to improve SQL in order to make 1 call instead of 100 calls for 100 records. However, it is extremely difficult to be as perfect as SQL language, so you would have to decide
Fallacies of Distributed Computing (Score:1)
The problem was that the database was hidden behind ActiveRecord, so it was easy to forget we were using a database at all. Writing a for loop to search for a record that matched some criteria felt natural, because our interface was with objects, not the underlying tables.
Object-Relational Impendance Mismatch [wikipedia.org]
Law of Leaky Abstractions [joelonsoftware.com]
This problem is not unique to Ruby on Rails usage of the ActiveRecord pattern. People blindly using Hibernate and other ORMs run into the same thing, and it is, in general, what happens when people fall for one or more of the fallacies of distributed computing ("latency is zero" and "bandwidth is infinite".)
ActiveRecord pattern provides a theoretically pleasing abstraction, that is OK when accessing one row out of a relation. Trying to
Re: (Score:2)
Eager loading might have helped.
Using something other than ruby on rails would have definitely helped.
Using the fad of the day will almost always bite you in the arse.
JS Frameworks (Score:2)
Are you in the mindset of embracing Angular, React, Ember, etc, or is your vision focused solely on Turbolinks as the future of Rails?
Thebole hindsight is 20-20 (Score:2)
Using the power of hindsight what would you have done differently if you were to start Rails again from scratch?
Why is ROR so SLOW? (Score:1)
Here's my question: Why is ROR so bloody SLOW?
And while we're on the subject, why is it sooooo hard to do anything outside the "approved" way of doing stuff in ROR?
What are your thoughts on the MEAN stack? (Score:1)
Holy Cow (Score:3)
I can't believe I just read all this crap from these whining beaches. It's like Slashdot gulped a keg of Red Bull while doing an 8-Ball off a teenage hookers ass listening to Nickelback's entire catalog on shuffle repeat.
I guess I don't understand the hate, since I still use Rails almost daily. I work efficiently, my clients pay me well, and because I have enough experience I guess, I don't ever run up against the platform's "performance issues". Granted, I am not building applications that have millions of users per month. Neither are most of the rest of these people. I guess it all boils down to- Haters gonna hate.
On to the questions. I'm going to ask a few, because so many other people threw their questions away already:
1. What's next for Rails 6 (or whatever is beyond Rails 5)?
2. I do notice that people are still talking about performance like it's 2005, and a few programmers I respect have already moved on to Elixir or React. Have you played around with either? Any good ideas we can steal? Better integration opportunities?
3. I feel like I'm always finding out about better "Rails Way" design patterns too late. For instance, when you explained your controllers setup/philosophy on Full Stack Radio. That was a situation where I'd kind of been doing that, but because I never really labeled it or gave it enough thought, it was more like I sometimes got lucky and made good decisions. Sometimes I didn't. Where, in the Rails community, is a resource to pick up on those more advanced patterns? Real world solutions that aren't necessarily a rails default, but are a good idea that will make life easier for developers at all stages of their careers?
Thanks for doing this. I don't know why you would have picked Slashdot for a Q&A though. It's like Reddit's garbage disposal in here.
Ramp-Up Time (Score:3)
I tried to "get" the philosophy of RoR, but ultimate failed. It seems RoR has a steep learning curve; but once mastered, one is allegedly more productive. Some use the analogy of becoming a medical doctor: a long slog through medical school, but big benefits (such as money) await you in the end. Do you agree with this alleged trade-off profile of RoR?
And, how can this approach work for decentralized departmental groups with lots of coder turn-over, especially if the bureaucracy makes it difficult to hire such that coders from other platforms are to be retrained? The ramp-up time for re-training seems hard to justify under such an environment without a RoR-only edict from on high. Would you agree RoR may not fit certain organizational environments? Thank You.
what still makes you excited about Rails? (Score:3)
First of all, thank you for Rails, it helped me to convince my former employer to look beyond Java for web application development and now about half of the projects I do is helping teams of smart people who've painted themselves into a corner using the platform. What a beautiful statefull mess we living in!
I personally feel your contribution to web application development in general is not Rails but the explosion of batteries included web frameworks we are seeing around us now. Things got shaken up 10+ years ago and they are still stirring. Yes, the github is full of failed frameworks withering away but also some really cool stuff spawned in the ripples Rails caused.
My question: now that things have cooled down a bit regarding Ruby on Rails (merb and arel have been assimilated, framework upgrades are almost doable, most have settled on minitest, etc) what still makes you excited about this project or are you secretly migrating basecamp to phoenix and assimilate that into Rails too?
cross-pollination with racing? (Score:2)
More generally, do the abstractions that help you learn to race assist you in understanding parts of your web & technology systems?
How do you have so much time for development? (Score:4)
Ruby vs Python (Score:1)
Python has gained what could be called a critical mass of popularity and works at a similar level of abstraction to Ruby. If you were creating Rails today, would you still choose Ruby? What are its advantages?
Re: (Score:2)
That'd be Django, which is basically python on rails with a less broken ORM. (And also a godlike admin system which I truly wish rails had. Having come from the django world to rails via my new job thats one thing I genuinely miss about django)
Re: (Score:1)
Django was started in 2003. Rails was released in 2004. The ideas behind both , MVC and ORMs preceded both frameworks considerably. They both arose out of internal projects where the creators had figured that all the enterprise nonsense that came with Java (or the unstructured spagetti involved with PHP,ASP and
What would you do differently? (Score:2)
You are quite famous for being loudly dismissive of Rails critics.
But do you ever get the urge to learn from your experience (and mistakes) and build a new framework that's different from Rails?
In other words, if you could burn Rails to the ground and start over without the need to maintain any sort of backwards compatibility, what would you do differently?
In a Javascript world (Score:2)
With the rise of Javascript front-end frameworks (Ember, Angular, etc.), is there really a serious place for large opinionated server-side frameworks any more?
Is Rails destined to be a framework for writing APIs to feed front-end frameworks? And if so, is that enough?
Activerecord shortcomings (Score:3)
As far as I can tell, by default ActiveRecord does not enforce referential integrity at the database level. Is there a reason for this omission? Also is there any plan to introduce parameterized queries for raw SQL queries. I still keep seeing people on stack-overflow recomending inerpolation as an alternative, and this seems rather dangerous.
Just stopping by to say: Thanks! (Score:1)
Re: (Score:1)
Talking about Danish devs.... (Score:2)