5 ms·
I sort of agree, but you're coming off a little over-excited there, and I say that as a 5-year Rails developer. The thing about Rails is that it represents the
by dasil003 17y ago
I sort of agree, but you're coming off a little over-excited there, and I say that as a 5-year Rails developer.
The thing about Rails is that it represents the maturation of web development. It's not anything amazing per se, just a clever roll up of the best practices that emerged from the decade of Perl, Java, PHP development that preceded it. Ruby is the secret sauce that makes things just feel so slick.
I don't mean to minimize the initial innovation, it's just that Rails is no longer very unique. A lot of frameworks have largely caught up even if written in less flexible languages, and long term I see opportunities for new frameworks to leapfrog Rails.
The biggest liability for Rails is the Ruby runtime. Yes progress is being made here, but it's still a pretty sad state of affairs with regards to memory leaks and performance. I bang my head up against this every few months and it really hurts.
Another issue is the need to handle more complex applications. Frameworks like Seaside allow you to set up complex stateful apps in a more robust way than will probably ever be technically possible in Rails (again due to limitations with Continuations in the Ruby runtime).
A related issue is the question of what dark places we will end up in over a couple decades of large code bases running under Ruby with no warnings. I think it's pretty clear by now that Java is an unnecessary straitjacket, but do-whatever-the-fuck-you-want-with-no-warnings-whatsoever Ruby environment is not necessarily the most conducive to long term stability. I'll take it over Java any day, but I still have my doubts.
Finally, there is the issue of increased ajax-ification of apps. Rails was a leader here early on insomuch as it provided proof of concept that Ajax could be done easily without a cross-browser-DHTML-guru certification, but 5 years later the Prototype + Rails helpers paradigm is quite dated. Ajax has huge potential for simplifying back-end code and making web apps inherently more scalable and performant. This is one area where Rails could re-invent itself, but a mature framework like Rails is going to have a disadvantage against a fresh approach starting from first principles.
In short, I think the competition has openings.
- patio11 17y agoI love Rails to death and do Big Freaking Enterprise Web App Development in Java all day. A lot of what people identify as pathological is an evolutionary advantage in BFEWAD. Straight-jacketing the programmer is often a good thing because on a team of 100 programmers in three continents (you might think I exaggerate), including (by my last count) 12 programmers who have less than 3 months of professional experience, we want to make sure the damage done by the least skilled programmer on his worst day is strictly contained. I don't know if Rails scales to that sort of development, to be honest. The least skilled developer, touching one part of one class at the periphery of the project, is essentially one line of code away from blowing up the entire project. I should know: since I'm the sole Rails programmer at my business, I am by definition the least skilled programmer. And since I've managed to corrupt the results of my analytics code by making a one-line ill-considered addition to my printing code (which are kept in wildly divergent classes in different packages and namespaced from each other), just because it was not obvious I was altering the global state of the interpreter. That sort of bug has never happened to me in Java. A lot of techniques which are considered kosher in the Rails community don't scale to large distributed teams really well. Monkey patching is the obvious example -- if you have two developers who have different understandings of what Array#pack is supposed to do, you're going to run into HELLACIOUS, difficult to debug bugs. If you do not quickly clue into the fact that Array#pack was redefined in a file you've never seen before that was committed last Tuesday by your most junior developer in the Seoul office, enjoy spending the next several days going over code you swear looks right looking for the error.
- tptacek 17y agoBut who would ever monkeypatch Array#pack? I think you're generally pretty safe as long as you stay away from the core library methods. It's the attempts to transparently extend well-known methods that I think tend to blow up on people.
- patio11 17y agoa) I don't trust the least-skilled programmer in my company to tie his own shoelaces without supervision, as he might accidentally hang someone. b) You will eventually generate a namespace collision based on the birthday paradox alone, no matter whether programmers avoid the core methods or not, if they are working in the same classes. The Ruby community encourages people to have fun with String, Number, etc because it results in easy to write DSLs. c) array = [] array.methods.size => 127 require 'activesupport' => true array.methods.size => 185 Those added methods include, among others: sum, to, split, blank?, rand, load, to_xml, to_json... and numerous other things some intrepid developer might decide their own arrays could benefit from. Edit: The code sample didn't demonstrate what I wanted it to demonstrate, so I changed it to one that did, although it demonstrated something related anyhow.
- tptacek 17y agoYeah ok, you win.
- FooBarWidget 17y agoActively encourage? There are only a handful of libraries that actively monkey patch the core classes. ActiveSupport, RubyGems, extlib, and uhm.... I don't know anything else. If anything most of the Ruby blog posts on monkey patching always warn programmers that it should be done with care. If you're so afraid of incompetent developers money patching things so that they break, why aren't you afraid that they write Java* code that spawns 2 million threads, crashing the system? Or code that deletes the hard drive? There are plenty of easy ways to break a program besides monkey patching. * With "Java" I mean whatever your favorite language is that you think will prevent incompetent developers from doing stupid things.
- tptacek 17y agoThe Rails Javascript helpers are a huge blind alley, and something that should have been jettisoned a while ago --- as is RJS. I got addicted to Sinatra because it pretty much begged me to try Haml + jQ --- which is an amazing combination --- and we recently ported all our Erb's to Haml in our Rails app as well. I think it's a major design mistake to hide or abstract Javascript now that jQuery has pretty much won the JS framework war.
- marknutter 17y agoI also stopped using RJS once I switched to JQuery. I however haven't moved to HAML just yet. Something makes me nervous about not working with raw HTML (especially with all the non-rails front-end development work I do). Why is HAML + JQ an amazing combination and am I really missing out on something here?
- jshen 17y agothey have a very similar syntax, and haml reduces line noise of plain html.
- tptacek 17y agoBecause most of the day-to-day things you do in jQuery involve doing something special with an element by id or class, and Haml's syntax for special classes and id's is painless. For instance: %a.post_link.confirm_link.destructive_link{link_to(@x)} Hi mom I'm probably not selling it very well. But basically, you know the old DOM tutorials that talk about how you can do you own tags like: <box name="foo"> <item number="1" /> <item number="2" /> </box> and then convert it to <div class="box" id="foo"> <div clas="item" id="item_1" /> <div clas="item" id="item_2" /> </div> or whatever; in Haml, that's just: .box#foo .item#item_1 .item#item_2
- marknutter 17y agoIn some ways I can really see the readability gains - haml is very succinct and neat. But there's a cost involved, namely getting my eyes and brain to comfortably recognize new syntax and patterns, something that for me usually takes a long time. I also worry about creating something in HAML and having people not familiar with it not be able to dive into the project and start working right away. I'm actually on the other side of that scenario right now and it's a pain. But I do have to admit, it's a very pleasing syntax.