Slashdot Log In
Rolling With Ruby On Rails
Posted by
michael
on Fri Jan 21, 2005 12:10 PM
from the keep-those-doggies-rolling-rawhide dept.
from the keep-those-doggies-rolling-rawhide dept.
Bart Braem writes "The Ruby community is abuzz about Rails, a web application framework that makes database-backed apps dead simple. What's the fuss? Is it worth the hype? Curt Hibbs shows off Rails at ONLamp, building a simple application that even non-Rubyists can follow."
This discussion has been archived.
No new comments can be posted.
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
Played with it (Score:5, Informative)
Ruby has already inspired a few efforts to duplicate the technology in Java and in
The usual warnings apply. Implicit code is easier 90% of the time, but that other 10% is painful to debug. With large projects you can prototype fast, but maintaining may be much more difficult.
Re:Played with it (Score:5, Informative)
Once you get used to the idea of passing blocks of code around, you'll love it, and won't be able to go back to Python... er... I mean, won't be able to go without it.
The canonical example is the iterator. Given an array pets containing ["dog", "cat", "fish"]:
Will return
dog
cat
fish
If you want to print out the uppercase versions
Or if you want to add some text:
Big deal, right? Not much different from a for loop. But blocks are amazing when dealing with things like a database. You can put all the setup, teardown and error-handling code in a method that's hidden from the user, and all they have to do is pass in the block they want the DB object to execute:
Unfortunately, slashdot eats my indentation, but fortunately, Ruby not being as picky about whitespace as *some languages*, that doesn't matter. Note that all that code is wrapped in a DBI.connect() call, which connects before it starts executing the block, and disconnects after. There's no "close" call required, it's all wrapped up for you.
Parent
Useful Ruby Online Resources (categorized) (Score:5, Informative)
http://www.rubygarden.org/ruby?RubyOnTheNet [rubygarden.org]
Interactive ruby resources:
irc://irc.freenode.net/ruby-lang - the #ruby-lang channel is popular. More info at RubyOnIRC
http://www.ruby-forum.org/bb/ - a forum for ruby novices to ask questions
news://comp.lang.ruby - the ruby newsgroup
Ruby websites:
http://www.ruby-lang.org/ - ruby home
http://www.ruby-doc.org/ - ruby docs and online reference
http://www.rubyforge.org/ - rubyforge ruby projects
http://raa.ruby-lang.org/ - ruby application archive
Ruby Code Examples and Snippets:
http://pleac.sourceforge.net/pleac_ruby/ - ruby pleac
http://www.rubygarden.org/ruby?RubyOnlineCookbo
Popular ruby and ruby-related projects:
http://rubyinstaller.rubyforge.org/wiki/wiki.pl - ruby installer for Windows
http://rubyforge.org/projects/rubygems/ - rubygems ruby package manager
http://www.yaml.org/ - ruby 1.8 includes built-in yaml support
http://www.rubyonrails.com/ - web framework in ruby
http://rubyforge.org/projects/instiki/ - wiki in ruby
Code, Snort, Code, Snort (Score:3, Funny)
Ruby still needs ISP support (Score:5, Interesting)
I given it a testdrive, and RubyOnRails is an amazingly fast and powerful way to develop webapps, but even so, it's been around for a while and still 99% of webhosts only stick to tomcat & PHP/MySQL, so that's what I code for. Even Python w/o Rails has more ISP support.
My question is: When will RubyOnRails get "popular enough" to make inroads? I'm looking forward to it, because it means I can be way more productive and get a head start on all the other PHP "solution providers" out there.
Re:Ruby still needs ISP support (Score:4, Informative)
Fantastic tech support, lots of support for opensource projects, a full ruby on rails implementation. These cats kick ass.
Lurk on the forums [textdrive.com] for a day or so to get a feel for things, it's not a bad place to call ~/
Parent
Re:Ruby still needs ISP support (Score:3, Informative)
It's just a pity (Score:5, Funny)
I develop webpages with LAMR - imagine saying something like that
Rails is just the tip of the iceberg (Score:5, Informative)
Ruby is full of incredible libraries and frameworks like this, especially where text processing and web development are concerned. It's because Ruby has such a rich set of features.
Anyone who likes Rails should dig deeper. Heck, Ruby's standard library comes with some amazing things. Ruby also has a framework called RubyGems [rubyforge.org],
which is very much like Perl's CPAN integration or CommonLisp's ASDF framework.
Rails is awesome (Score:5, Interesting)
In PHP or other related language, probably would've taken me about 80 hours or so to develop the site. In Rails, I've spent maybe 15 hours or so total on it. And I'm charging $8k for the site. Admittedly, that doesn't include time working on the graphics or design of the site, just the backend, search, etc.
So if you look at it from one perspective, I went from making $100 an hour to $533 an hour using Rails!
TMTOWDI (Score:5, Insightful)
These systems all demo well because the developer gets to decide what functionality to demo, and it not coincidentally happens to be the functionality the framework was designed to easily support. The real test of the system comes when you want to do something the designer did not anticipate, and you find out how flexible the system is and how sensible the designer's instincts are.
With these environments I think time will tell, with most developers watching the few willing to take the risk of investing the time needed to learn the framework and how to customize it extensively.
weird directory structure (Score:5, Informative)
why can't someone build a decent framework that follows the simple "directories are directories and files are pages" model used by asp, php, cgi, etc.
and what's with the database naming conventions? the author kind of brushes it off at the end with this statement: "Even if you have to use a legacy database that does not use the Rails naming conventions, you don't have to give up the productivity advantages of using Rails--there is still a way to tell Rails explicitly what table and column names to use." personally I would not use those conventions no matter what database i was using, nor would any decent database developer or administrator i have ever known.
at any rate, at work i program in whatever language they tell me- currently asp+jscript, before that php. for personal projects, my current favorite is perl's HTML::Mason. all the benefits of php (and then some) without the awful language conventions.
Re:Good for "recipe" queries but little else (Score:4, Informative)
You might want to tell that to Basecamp [basecamphq.com], 43 Things [43things.com], and Tada Lists [tadalist.com], since they obviously have no idea that Rails isn't good for anything of that magnitude. Might also mention it to all the thousands of people that use those sites, daily, and to the handful of developers who built and deployed those sites in a fraction of the time and cost of other web solutions.
Then again, maybe you shouldn't...
Parent
Re:Good for "recipe" queries but little else (Score:3, Informative)
Have you ever programmed a web app before? (Score:5, Informative)
It's extremely cool to watch someone set up a working webapp that fast.
But I have to take issue with:
Half of the darn article is setting up MySql and installing Ruby and Rails from scratch on a windows machine. Do you have any idea how much harder this crap is to write in other frameworks? You'd have to write at least 2x as much code. No one has an Active Record class as good as Rails'. You'd double the code count just doing the SQL linkage!It's one thing to be unimpressed, but it's another to know jack shit about the domain and say it's all worthless. Anyone who's ever made a web application will appreciate it.
Parent
Re:Good for "recipe" queries but little else (Score:3, Insightful)
This is not insightful. If you want to see how well it scales look all all [basecamphq.com] the [43things.com] production [tadalist.com] grade [hieraki.org] applications [leetsoft.com] out there. The source to hieraki [hieraki.org] is freely accessible.
Rails is NOT your run the mill proof of concept framework. Its the next level of programming environment right now and here. Available for you to download under MIT license. The people who use it make applications magnitudes faster than the people who aren't. Single people can be as productive as whole teams.
There hasn't been an improvement
But... But... There's IIS! (Score:4, Funny)
"If you are using Windows though, looks like this could be very useful."
Only if it can match the stability and security of IIS that we've come to depend on. Otherwise it's just another shoddy product built by communists for communists.
Parent
Re:Nice framework... (Score:4, Interesting)
If we want to link it to Rails, we'd use the following code:
Yeah. That's really it. And you can specify relations with a simple micro-language in the class declaration (that's based out of ruby syntax). Once you've done this, you can write code like this:And Rails makes the action mappings just as simple. I'd eat my old shoes before I'd believe that there is some lurking JSP/Servlet framework that has evaded my sight (and everyone's sight, really) that can do better. I know Java's limitations pretty well.Parent
Re:Nice framework... (Score:3, Insightful)
Thats a great concept as long as everything goes as planned. But wait until it 'dynamically finds' the wrong thing. Try debugging that nightmare. (Think VB Script + Option Explicit).
It's not so bad, Rails is unit tested very well (Score:5, Informative)
Secondly, the author knows that ActiveRecord could be a source of problems, which is why it's got dozens of unit tests, covering nearly every line of code.
Thirdly, even with all that bugs can and will sneak through, which is why ActiveRecord can, upon command, write a detailed log of its attempt to dynamically bind and create the classes you want. The logging is at the message-passing level of Ruby, which is nearly as atomic as you can get (you could hack the interpreter to go further, but that'd be pointless).
The dark ages of hideous bugs in dynamic code are gone my friend. We have the tools and techniques to make code of this type both safe and maintainable. Don't be afraid of it.
Parent
Re:Nice framework... (Score:4, Insightful)
Learning Python or Ruby and using it will pay off in mere weeks vs. Java, C++, Visual Basic, and most other things like that. Pay off might be a month for C#, but only if you use C# like an expert to start with. (Also, if you use C++ like a mega-expert, but even then, to use it that way you lose with the staggering quantity of typing that takes... and I mean keypresses, not object typing!)
Ruby and Python have done everything they can short of directly downloading themselves into your brain. You have to expect to exert some effort to reap the benefits. And like I said, it pays off in mere weeks, so opportunity-cost-wise, you lose big for delaying it.
(Note "you" here may be your company, if you only program professionally. In that case, you personally may not have any choice, but the company is still losing big.)
Parent
Re:Nice framework... (Score:4, Insightful)
Um, yes and no. If your point is that there is a certain amount of abstract thinking required before you write any code, then yes, they will share a comon process. But, after coding in a language for a while, you tend to start thinking in the terms and abstractions the language facilitates.
So, in perhaps the common case, Java designers will soon be thinking in terms of factories and adaptors and filters and all sort of entities that are often required in Java but which are extraneous in an agile language.
And the time spent on those extranous objects is not time spent adressing the actual problem, but time wasted working around or through the demands of Java.
Parent
Re:Okay, so what else does it do? (Score:5, Informative)
http://ar.rubyonrails.org/
You can automatically retrieve data from the database in the form of an object, do manipulations or calculations, display it, modify it, then do a save() method on the object and it'll go right back into the database.
Parent
FlexGrid? (Score:5, Funny)
FlexGrid? FLEXGRID?!?!
Implementation of FlexGrids is responsible for extreme stress, male pattern baldness, genital warts, dry heaves, infertility, webbed toes, seeing spots, loss of super powers, carpal tunnel syndrome, diarrhea, dandruff, dispepsia, gas, fingernail rot, yellowy wax buildup, stink foot, Plantars warts, incontinence, communism, crusty boogers, arthritis, bursitis and and cooties. The only treatment is 500mg of Dammitol, fiftytwo times a day.
You, sir, are a maniac.
Parent
Re:How does this compare to other stacks? (Score:4, Informative)
Parent