Rolling With Ruby On Rails
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."
Thats interesting. Never heard of Ruby before but it seems very useful especially with the DB integration.
_
Free 27" Sony WEGA TV
Ruby doesn't have FlexGrid ocx which basically makes it useless for database apps.
Looks good, nice to see some competition in the database backed web applications category for Java/PHP/Perl. However, I'm dubious about the claim that it's "ten times" faster than Java. It may be a bit faster, sure, but the amount of code doesn't look hugely less than what you might write to create a simple application using one of the many JSP/Servlet frameworks available.
And did a quick application with Ruby on Rails already. If you are confortable with Perl, you may find this easier to deal with then Python and it's love of whitespace. The object model is much more developed then either python or perl, but it still retains much of the flexability of the other two systems.
.NET. Since the core technology behind RoR is open classes, and the ability to add accessors and functionality on the fly, the other languages just don't cut it.
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.
Look all of you LAMP users... You can do the same thing using Ruby that you can do with whichever P in LAMP you prefer (PHP, Perl, or Python)! Can we change our name to onLAM{P,R} now?
Don't blame me; I'm never given mod points.
Rails is a big deal from the stand point of a world where Java frameworks are considered state of the art. However, the big breakthrough with Rails will come when a Rails-based REST web services generator presents the database schema to a client-side ECMAScript XForms/templating solution.
Seastead this.
I don't mean this as a "let's bash Windows" kind of argument. It is just that, if you aren't running Windows, you'll have to make a lot of adjustments in reading this article. Just a heads up. If you are using Windows though, looks like this could be very useful. If not, it could probably still be of use anyway.
http://mediagoblin.org/
The Ruby language home page is here, and the main reference book is the Pickaxe (from the Pragmatic Programmers)
A categorized collection of ruby links can be found here in a nicer format:
o k - ruby cookbook
http://www.rubygarden.org/ruby?RubyOnTheNet
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
Back where I am from, using rails all night to code a project can land you in trouble with the law, drain you financially and mentally, and leave you with a nosebleed. Best stay away from this nonsense.
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.
What's so bad about eating your own bugars? Everybody does it. And it's good for your immune system too because it gets to practice on the nasties that you captured in your mucus.
This framework is very nice. If your looking to get away from the sometimes mess of php web development, then this is a great choice. Ruby is a very expressive and powerful language that is very easy to read and code. And also very easy to make wrappers for c libraries. The rails framework does make it _very_ fast to develop MVC web apps with a small amount of intuitive code. And the rubyonrails mailing list is very active and friendly.
You have to pay for a front-end to MySQL ? The world's most popular open source database doesn't have a free front-end? em... sorry, I just didn't know this and am exclaiming out loud... please move along.
Take a look at this example. It's incrediblyl complicated and all it does is display a horrible little form that lets you query cookbook recipies!
Why do people get all excited about this nonsense. There's no reason for either Ruby or Rail (nice name) today.
It's not useful for anything bigger than a 'hello world' application.
now in private there is nothing wrong about doing it
I like Ruby, even before I got to know Rails. The only thing I regret is that LAMR sounds really bad.
;).
I develop webpages with LAMR - imagine saying something like that
That's great if all I want to do is maintain a database through a web interface. I don't. Most of my work involves complex modification of that data, or calculations based on it.
Does Rails help with that?
Don't get me wrong, I've got some simple PHP lying around this could replace brilliantly, but first impressions are it doesn't help with the really complex stuff.
Rails is an incredibly good framework for Ruby, that really shows off its power and makes it easy to get a web application going, but it's not all that Ruby has to offer.
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,
which is very much like Perl's CPAN integration or CommonLisp's ASDF framework.
Slashdot. It's Not For Common Sense
He ate his feces in meetings, when I knew him. Drove people nuts. This was when he was fresh out of college so he's probably mellowed since. You could always tell which laptop was his though, from the stains. Very nice guy though.
I notice Ruby's spitting out a lot of html (full forms etc.)
Does it validate as standards compliant?
wow.. the power of /.
You anounce the web link, everyone tries to hit it.. and it shows just how underpowered their database applications are (or how slow their i-net connection is)..
Don't know about you.. but the website appears to be almost /.'ed. maybe in a few more minutes it will be 100% unresponsive.
Obama = Socialism.
LAML
Seaside
Question is. What took you all so long?
"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.
As a coworker said: "Build a better LAMP: Linux Apache Middleware Postgres!" ;) [Where "middleware"
could be anything more robust than your typical php sleazeware.]
News for Geeks in Austin, TX
Yes. It makes you spend less time on other stuff, so you can spend it on the modifications and calculations.
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.
Slashdot. It's Not For Common Sense
Ruby is a relatively new programming language from Japan that is rapidly growing in popularity. In Japan it has already overtaken Python in popularity and has started to gain a loyal following in other countries.
Before year 2000, there were no English-language books about Ruby. Now we have a fast-growing English library including Ruby in a Nutshell, Programming Ruby 2nd Ed., Teach Yourself Ruby in 21 Days, and more.
The lack of English documentation was what held Ruby back in popularity. With that problem now largely addressed, it has started to gain popularity rather quickly in the USA.
Ruby was designed by Yukihiro Matsumoto, a.k.a "Matz". It is a pure OO language but has time-saving features which make it useful for one-liners like Perl. If you like being highly productive, having fun programming, and want your code to make sense a year later, then give Ruby a try.
Any comparisons to Hibernate stacks, Struts, Zope3, CherryPy etc?
Interactive Visual Medical Dictionary
If you're at all serious about your web applications you really need to understand what's under the hood.
Frameworks are helpful, esp. when they have a nice logical structure, but you should spend quite a lot of time understanding how they work, b/c you WILL need to hack it eventually. I found my own apps have gotten better over time by sticking with ONE framework I know very well and continually refining the underlying code.
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.
A feeling of having made the same mistake before: Deja Foobar
I've almost finished developing a real estate site using it. First time using Rails.
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!
This framework is absolutely incredible to code in. Of course, I'm one of the ruby-talk mailing list members, but there is no way you can't love rails. I'm generally a network/low-level programmer, but I can make a perfect intranet web app for any purpose in a matter of just a few hours. It's beautiful. And I do know Perl, Python, and various Java technologies. Ruby users choose what they love because they love it and it works, not because of industry pressures or popularity. It's addictive!
Firstly, Rails's ActiveRecord class is very simple Ruby code, so it's naturally bug-resistant.
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.
Slashdot. It's Not For Common Sense
Personally, I'd like to see SCGI deployed more widely. Then we could drop the requirement for mod_ for many apps, and make it much easier to deploy frameworks and languages on hosting providers.
I've been really impressed with SCGI for my own work (a Quixote + Python based web app).
Only harder and less user-friendly. I'm sure for java programmers this seems easy. My typical audience is Excel users who know practically nothing about programming.
Oracle HTML DB Quick Tour.
Non illegemati carborundum est!
Hibernate does take care of this nicely, but certainly not with 2 lines of code :)
Yes, the code is standards compliant. But that's not saying much, the scaffolding feature is so basic it's not saying much.
In general you do not use those scaffolds in the production app. They're placeholders for you as you program your actions, and in that regard they're very useful.
Slashdot. It's Not For Common Sense
Rabid Empire Builder (and Euro Rails, British Rails, Russian Rails, Iron Dragon, Lunar Rails, India Rails, Australia Rails, Nippon Rails, etc.) fan that I am, I saw the title and thought immediately that Ruby Rails was the next game from MayFair which would somehow bridge programming and empire building at the same time. Alas..
you rolled a 1, ha!, didn't compile!
A feeling of having made the same mistake before: Deja Foobar
See What is OpenACS for an example of a web framework that's been around for about a decade, has had millions of dollars spent on its development, and can do almost anything you want. The downside to something like OpenACS is it is more complicated and there is definitely more cruft.
1. Download the latest One-Click Ruby Installer for Windows (shown in Figure 1). As of this writing, the latest is ruby182-14.exe).
:-).
2. Double-click on the downloaded executable and follow the installation instructions. Unless you have some special needs, just press Enter to accept all of the defaults.
Believe me guys, no hype at all
Perl has its own rapid application development framework, Maypole. Here are some screenshots from a Perl.com article where Simon Cozens sets up an online sales catalog in 11 lines of code. (Here's a followup article, and the Maypole home page.)
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.
There are a lot more demos on the Ruby On Rails Website, and it's documentation section.
You're a Zope fan, which means you're a Python fan. Probably the only language that can compete with Python on even terms is Ruby, and the languages are extremely similar.
I'd highly recommend you check it out. The language should be close enough to Python to learn in a day or two, and Rails is really powerful. It's different from Zope-no doubt about it-but that doesn't mean it's bad.
Slashdot. It's Not For Common Sense
is still a whole lot easier. What could be easier than cfquery for non-technical programmers? And you can get the BlueDragon CFML parser for free, so you don't have to shell out money to Macromedia.
In this house we obey the laws of Thermodynamics!
Ruby on Rails is growing at an astounding rate right now, which is not at least due to the growing number of real-life applications that has been build upon it. Including:
Basecamp -- The original Rails application from which the framework was extracted. A hosted project management application that combines weblog, todo lists, milestones, file storage, and more to keep everyone on the same page in a project.
43 Things -- The "What do you want to do with your life?" application that lets you enter the 43 things that you're currently looking to achieve in life. You can blog about doing it, find others doing the same, and give advice to people who are doing things you've done.
Ta-da List -- The todo list component of Basecamp factored out into a free mini application. Uses XMLHttpRequest and other JS techniques to keep the interface super snappy. Sharable todo lists for every occasion.
And those are just a small sample of all the public applications out there on Rails. On top of that, there's a wide range of e-commerce, content management, business intelligence, intranet systems, and more being build inside a lot of organizations.
Exciting times!
Last time Ruby on Rails came up, someone mentioned this example showing off their object-relational mapping. I observed then that it makes way too many queries because the SQL it produces isn't very good. (And too many queries means a lot of slowness, especially when your database server and your webserver aren't on the same machine.)
It's not as obvious here because all of the queries are behind the scenes, but I suspect the same sort of crappy SQL is driving this example.
I just used my last mod point this morning. PLEASE somebody mod this post up.
The most recent release of Rails supposedly cleans up a lot of issues, including some with the SQL generation.
It also implements caching at a variety of levels, to further speed things up. The most recent releases of rails are dramatically faster than prior.
Slashdot. It's Not For Common Sense
Anyone else find it strange that the author didn't use 3 of the products in "LAMP"?
Didn't use Linux, used Windows,
Didn't use Apache, used WEBrick,
Didn't use PHP/Perl, used Ruby.
Shouldn't this article be on ONWwmr.com?
What's cool about Rails, and why this dynamic approach is so desirable, is that it can change on-the-fly.
Yeah, you heard me right. Your web app can be depolyed, and you can modify the tables. Need to add a new field? Just do it. You can also (on-the-fly) make new test actions to play with these parts of the database. Of course, deleting or renaming a column can cause a problem with existing code, but Rails still gives you more than most competitiors in this regard.
Being able to debug a web application without bringing it down or re-deploying it is a powerful feature. Code generators are all good, until you need to do something fancy which requires custom code. In Ruby, all that stuff is done dynamically (oh, and cached, of course) when it needs to be done. It's a lot more conveniant than code generation.
Slashdot. It's Not For Common Sense
Of Rails, XForms and REST web services, REST web services is probably the noisiest of the terms but it is so limited in scope that there probably isn't too much to worry about.
Seastead this.
I understand that WebObjects, J2EE, LAMP and Ruby-on-Rails are competing web application platforms. I am primarily interested in the latter pair as they are freely available.
Nevertheless, I would appreciate it if anyone with experience with two or more of these platforms could shed some insights on the strengths and weaknesses of the platforms.
For Python, I have been experimenting with CherryPy which is a fairly low level web application framework, but is easy to use for publishing web services using XML-RPC, generating dynamic HTML (it does not have a template language but works with a few Python HTML template packages), etc.
Anyway, CherryPy "seems just about right" - light weight and easy to use - definitely does not have the capability of Rails though.
This seems nice and fast, but the sad fact is Ruby doesn't have the ISP support or userbase of the "P"'s.
So, when will they create a competitor to this? Or have I missed it already . . .
"The Sage treasures Unity and measures all things by it" - Lao Tzu
We, the citizens of the planet Zorgan, have known for well over a klackon that VB.NET is the best development environment in the Plugormic sector. Your human society will be judged by what you ultimately do with this powerful VB.NET technology.
I wonder how hard it would be to get Rails to spit out XUL to the (mozilla) browser, instead of HTML?
I doubt it would be that hard, and would let you do some snappy interfaces.
That's a great under-the-hood framework. I want to draw client/server diagrams across both the presentation/logic and logic/data tiers, and compile my WWW/App/DB flowchart into HTML/Executable/SQL code.
--
make install -not war
I originally built Web Collaborator in 8,000 lines of PHP over a couple of months. In about 16 hours, I had completely rebuilt it from scratch in the Ruby on Rails framework with 1,000 lines of code.
I have since created sites like The Conjuring Cabaret and S5 Presents, both with astonishing simplicity and rapid development. Rails gives me short-cuts for almost everything I ever want to do with web development.
The hoops you have to go through to get simple SQL stuff done in Python/Perl/Ruby.
I have yet to see one of these "rapid-prototyping" languages in which SQL is as easy to use as it is in C, COBOL or PL/I. You see, in a proper language, one just writes:
EXEC SQL sql-statements
in the middle of one's code, and stuff gets done. Okay, so there are a few hoops to jump through to make sure the EXEC SQL translator knows about your variables; but it isn't difficult.
Now, a question: do PostgreSQL, MySQL et al support this, or is it still the big boys (DB2, Oracle and friends') back-yard?
Phil
I guess today is a passable day to die.
Offtopic, I spent nearly a year learning Common Lisp very carefully, and it was a wonderful experience. I learned a lot and made some fun applications.
But ultimately, Common Lisp's community is so foobar'd that it's really hard to get anything real done in it. There's cool software out there for CL, but it's all kinds of reinvent-the-wheel-each-time stuff.
I've since moved back to Ruby, and the impact a community can have on the language is astounding. It took a year with common lisp to show me that.
You might want to keep up with Ruby.
Smalltalk is great and all, but it's not so easy to write a "hello world" script in Smalltalk, at least in my limited experience. This isn't a problem with Smalltalk, it's just that the two were intended for different things.
Ruby shares its OOness with Smalltalk, but the environment and runability of it comes from Perl. It's much more of the standard "write a script, then pass the script to the interpreter" kind of a language.
Checking in as a rails user.
This thing is the best I have seen in web frameworks. The productivity is stunning. Seriously, I spend more time on site layout than I do on actual backend (and this site has quite a bit of backend). Very few of my functions are more than a few lines long and rails does a better job of discouraging coupling than any framework I've seen.
ActiveRecord is the best out there. For those criticizing it's reflection/defaults approach to configuration, be aware that everything is predictable and where it isn't right for you, all defaults can be overridden simply and easily (just pass in an options hash to your associations (or validations, or anything really), for instance)
As for hosts, I've heard good things about textdrive. Keep in mind that you can get a decent VPS for $14.95 a month...that means root access so you can install/compile anything you want. I've been with adiungo for a while now and they've been good to me. I haven't put rails up on the server yet, but it's really only a matter of time. Since I have the gcc toolchain on that server, I know that I can do it one way or another...
Go forth and check out rails!
I'm a user interface designer, and as such do a lot of HTML-based interactive prototypes or mockups for Web apps. I've been using XSLT combined with XML sample data files: The XSLT allows me to build up XML-based widgets for complex but common elements and then quickly create pages using them. For that it's great, but it can be a bit cumbersome in other respects. So I'm wondering: Is there any way to integrate RoR and XSLT? Use Ruby on Rails for some of the back-end stuff but keep my XSLT widgets for the front end? Or, alternatively, is there some equivalent platform for my XSLT widgets in RoR?
How is this easier than Zope? Zope isn't smalltalk, but it does inherit (pun intended) OOP from Python and other sources.
That also means your edit/test/debug cycle is a lot tighter because you aren't going back to the server to reconfigure your front end all the time.
I know, a lot of people are used to the idea of having to have the server do all their markup expansion, templating, etc. If they think that gives them a web application faster then they can stick with it and die professionally.
Seastead this.
If so, it seems to leave the db handle, and the cursor handle dangling. That was the main point I was making, is that when wrapped in a block, these things are cleaned up for you when you're done. Other than that though, this is basically a good Python translation of what the Ruby code was doing (although the Ruby version is database-independent, I imagine Python also has a DB abstraction layer).
Btw, how'd you get the indentation right? Manually inserting entities?
That they have created automatic mappings between objects and a relational database is nothing that shows Ruby to be superior. This feat can be done with java just as easily. That they do mappings automatically actually makes me hesistant because it does not give you the control over your objects and database that you would have, and possibly need, using OJB or Hibernate.
The time savings show in the demo are only realized when doing the most simple things. As soon as you wish to customize your views, which will definatly happen to pretty it up, you have just as much work as in other langauges.
I can't seem to find much info on the speed of this framework. I'll probably end up writing up a similar benchmark like I use with PHP DB abstractions. Just curious if anyone has looked into it.
Oh and is there a Ruby Gem like PEAR:Cache?
Sorry I'm a lil lazy today.
-- taking over the world, we are.
I wonder if Rails uses Ruby's support for continuations, to build a continuation based webserver. There are a few, like plt-scheme's webserver, and Seaside for Smalltalk.
In fact, I've compared both of those in a article on my blog (sorry for the self-promotion). It would be cool if Rails can do this too...
This web app framework uses the same "model-view-controller" paradigm that the Cocoa dev environment on OS X uses (and which has also been lauded). FYI
Python has a great low-level framework called CherryPy http://www.cherrypy.org/ and a Rails-killer called Subway http://subway.python-hosting.com/, built on top of CherryPy, Cheetah and SQLObject
Not necessary.
Besides, Ruby doesn't have real continuations. Their continuations are based of longjmp() C call, so it has some limitations that real continuations don't have.
Slashdot. It's Not For Common Sense
Ok, looking at that example I was blown away with how simple it was from a programming perspective. Now, I've done work in PHP, and I'm now starting on ASP.NET, and the simplicity of Rails is impressive. Now, I know a lot of you are poo-pooing it for a number of reasons for not being technologically robust/complex enough to deserve real geek attention/doesn't walk your dog for you, but think about this from another direction.
How much easier has building a dynamic web page become for a non-geek? MUCH. With minimal programming, and a basic knowledge of HTML, the average web builder can now do something that just a short while ago was needlessly complex and arcane.
Yes, if you're doing any production web app work, you won't rely on the default scaffolds or whatnot, you'll just use them as placeholders/test devices to later replace with more robust code. But if you want to make a quick and dirty "blog" on your web space, or make an online recipie book for mom to use, you no longer need to have a stack of manual print-outs or books telling you how to do it.
With a little more refinement, I think this will do for dynamic pages what the WYSIWYG editor did for web pages in general. (This is based on the assumption that the average user is now more technically saavy than they were 10 years ago when the WWW was blosoming)
That may also answer your PEAR::Cache deal (as I understand PEAR::Cache anyways). But Ruby doesn't need a framework to cache method calls. Making caching function calls is kind of a learning excercise. It's covered in the old, online version of Dave Thomas's "Programming Ruby" book. Specifically, in this chapter. Search for "class and module defintions" and read on. It's really quite interesting how easy it is.
Slashdot. It's Not For Common Sense
Here: http://www.textdrive.com/
They say half the fees go to the Ruby on Rails project and that:
"We have no photographs of our CEO strutting past server racks, or of women in telephone headsets ready to take your call, but we hope you'll consider joining us all the same."
Dang no women.
*click**beep**beep* Scotty, One to Mod up!
Offtopic but I'm looking for a little help here.
I've look into Ruby before (a friend said it's agood newbie language), I've read a few tutorials and get the general concept and how it works, but I lost the URLs and such for these things, so I'm asking for some help with it.
Wheres a good tutorial site? (multipule if possible)
Any books worth reading?
General resources sites?
Good community sites with help or IRC channels?
Thanks in advance to everything.
I like muppets.
From a security POV, this article scared me. I don't really expect it to teach how to harden a MySQL server, nor a WEBrick server created through this system, but didn't anyone else feel the urge to vomit when he said to leave the administrator password on the MySQL server blank?
http://www.43things.com/things/view/215 ..runs on Rails
http://bitmask.co.uk/notes/
Gawd damnit Apple! Re-release the Cocoa frameworks for WOF already!
Seeing all these copycat technologies that claim superiority through extensive frameworks is becoming quite nauseating.
Especially when they don't hold a candle to WOF/EOF Cocoa with its ObjC_WebScript, EOF Frameworks, so on and so forth. All Ruby pundits can mod me down all you want but this shit doesn't hold a candle to stuff I first learned back in 1996.
Here is to seriously hoping Apple gets focused in the Enterprise--the lack of focus is why I left a year after the merger from NeXT.
This just seems like a troubling idiom for Rails to take on, and it would have been more prudent if they had a more consistent convention than the ever changing rules of the English language.
However, I do suspect that the NeXT crew is on its way to Ruby land at some point. I think it would be a blast to build an even better framework than Tapestry in Ruby. But that's not on my current TODO list ... in fact, what is, is to build technology that better differentiates Tapestry from JSF (and Tapestry from WOF).
Howard M. Lewis Ship -- Independent J2EE / Open-Source Java Consultant -- Creator, Apache Tapestry and HiveMind
'90s: "Developer? Oh, yeah, I program in HTML."
'00s: "Developer? Oh, yeah, I program in XML."
Java is the blue pill
Choose the red pill
The original motivation for Model/View/Controller was written in the absence of OO widget-based GUI environment. In MVC, you'd have this big monolithic controller object that handles every event and through some handwaving process, transformed models to views. Note that views were strictly one-way in this model -- all program logic was done through the controller, which had to be aware of all the views being used in order to generate the right inputs. In other words the Model was the program state, the view was procedures for displaying model objects, and the controller did absolutely everything else.
How on earth this antiquated model stuck and transferred to web applications is beyond me. It shares almost nothing in common, except for a very under-specified "controller" class that has the very simple job of "doing everything except rendering". MVC is about as meaningful as "client/server" these days.
i've tried rails a little bit, and jsp before that, and wasn't particularly impressed with either. is there a reason all web frameworks require a weird directory structure? rails seems better then jsp because it doesn't require an arcane descriptor file, but it still requires you to use a funky directory structure, which means the structure of your application doesn't seem to correspond in any meaningful way with your web site structure.
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.
If I don't put anything here, will anyone recognize me anymore?
Or you can just do it the way Guido intended and pass in first class functions. You don't need special notation to pass around references to functions or even bound methods.
The radical sect of Islam would either see you dead or "reverted" to Islam.
Groovlets! Groovy, an open source scripting language based on Java, has a component called groovlets which lets you do the same kind of thing except I think groovlets would actually be quicker. Personally, I wouldn't use Rails or Groovlets for serious production work but for rapid prototyping, I'd use groovlets in a heartbeat. Here's some links:
h aus.org/Groovlets
http://groovy.codehaus.org/
http://groovy.code
Pretty slick stuff.
Any man who afflicts the human race with ideas must be prepared to see them misunderstood. -- H. L. Mencken
What do you do if your app connects to more than one database? How does Rails find the right "Clients" table?
You can overwrite the default database connection method in individual classes.
From http://rails.rubyonrails.com:
"Connection to multiple databases in different models
Connections are usually created through ActiveRecord::Base.establish_connection and retrieved by ActiveRecord::Base.connection. All classes inheriting from ActiveRecord::Base will use this connection. But you can also set a class-specific connection. For example, if Course is a ActiveRecord::Base, but resides in a different database you can just say Course.establish_connection and Course *and all its subclasses* will use this connection instead.
This feature is implemented by keeping a connection pool in ActiveRecord::Base that is a Hash indexed by the class. If a connection is requested, the retrieve_connection method will go up the class-hierarchy until a connection is found in the connection pool."
For the professional programmer, it's tough to tell ANYTHING from this article.
These trivial example type articles aren't anywhere close to the real domain of much of business software/webapps. Everything in this example is from one simple table with little/no error checking or formatting. Once you start getting into the nitty gritty of things where an entity uses multiple tables and has dynamic and/or very strict error/format checking... will this type of framework actually help you at all?
Can't tell from this article, unfortunately.
I like your restrained, elegant way of communicating.
please let me know when Ruby on Rails can add one and one together faster than any similar scripting langauge
Caesar si viveret, ad remum dareris.
package Foo;
use base 'Class::Accessor::Fast'
__PACKAGE__->mk_accesso rs(qw/a b/);
sub add { $_[0]->a + $_[0]->b }
package main;
my $f = Foo->new;
$f->a(1);
$f->b(2);
print $f->add . "\n";
Ruby is slow on its own, but rails is a horribly slow, bloated piece of crap. Testing it out, I ended up with more memory usage than my java solution, which is absolutely amazing. I've never seen anything use more RAM than java, but this does it, and has less than 1/20th the speed.
Then of course, there is the problem of rails always being broken, if you actually try to use all the functionality, especially with anything other than mysql, you will run into a bunch of random broken stuff, and then be told "oh well, try again when we make a new version".
With caching, its fine for sites that don't have lots of user-specific stuff that won't get much benefit from caching.
I like the idea, but speeding up my development by 10x I don't think is realistic. Perhaps if i had to start from scratch and make a table editing page. But, no developer who is working full time starts from scratch. I have a bag of tricks just like everybody else. Using datagrids, components, personal code libs, code generators, etc, i can have a basic UI for all tables in a database in a few seconds in any language i want. the harder, more time-consuming part is combining all of it into a usable application. sometimes the framework can help with a simple structure, but becomes a burden with complicated relationships and things that don't directly map to the table fields.
Its the same problem with ORM solutions. the easy stuff is easier, but the harder stuff can be even harder.
TODO: come up with a clever sig
I don't know what kind of apps you are developing, but my big time loss is not in having to add a property to my class when I add it to my table. Quite frankly, the execution speed hit is huge from this, and its not worth it when the dev speed increase is close to nothing.
All it does is force me to use Guido's favorite style instead of my own. If you stick with a normal syntax derived from C, you can just use indent or a similar tool to change any formatting you want to be how you want it, and others can change it to how they want. Imagine that, everyone getting to program in their style, and there being no problem at all. Good thing python insisted on solving this non-existant problem by making the syntax hidious.
Apache is too slow for my needs, so I run a good webserver. Does maypole run under fcgi? And if so is it multi-threaded to provide reasonable performance?
Its overly complex for basic tasks, and it makes some things damn near impossible. Plus zope is completely useless without squid in front of it, its just too damn slow.
MVC fits web apps perfectly. The models are objects retrieved from the db. The controller does handle all the requests, and the views are those web pages you see. I'm not sure if you noticed, but web apps do have an absence of OO widget based GUI environment.
Everything went fine until page 3 of the tutorial when I try to access http://127.0.0.1:3000/recipe/new
It tells me this error:
Mysql::Error in Recipe#new
Access denied for user: 'gregory@localhost' (Using password: YES)
I want it to log on with user gregory with a password. I set up everything in the database.yml file but still no avail? Any ideas?
"Very impressive, but no one uses REXX anymore."
Someone better stop IBM then, before they make a big mistake.
You have to write code? WebObjects can handle a basic task like that with no code. Have a look. I mean, I guess if you want to count the project templates, there's code in there somewhere. It's very simple really: Create a project, select a model file, and build immediately. You don't even have to know any SQL. EOModeler will create the tables for you. Relationships are cake: just a string of names.connected.with.dots. Serve it up with a web browser or a Java WebStart client. Oh, and the developer version is free, just like the rest of Apple's developer products.
Having said that though, this Rails thing sounds pretty nice too. It should be a real boon for those among us who already know a little bit about Ruby.
:-)
a tip from fellow language fanatic: drop everything except Lisp and Ruby.. Those other languages are just plain obsolete...
As much as I love Ruby, the Python libraries just seem to be, at present, a lot more immediately useful to me than the Ruby ones.
Knowing that Matz is working on 'Rite', intended to be 'Ruby 2', has helped me hold off. (Although perversely, GvR discussing Python3000 hasn't had the same effect.)
But whichever language you choose, you've got to have some respect for a designer whose motto is "I work very eagerly to be lazy" :)
I hadn't realised that Ruby/Rails has very weak Unicode support. I worked my way through the (excellent) tutorial and discovered that when you enter any unusual characters (e.g. something really dastardly like "café"), either Ruby or the Rails framework silently drops that character and everything after it on the floor.
I thought at first that it must have been MySQL's fault but a few experiments show that MySQL 4.1 will happily store and retrieve high-order characters.
This would seem to limit Ruby/Rails a bit for real-world stuff, wouldn't it? I assume you can still go and develop your own classes that handle UTF-8 correctly but that cuts down the appeal a bit.
There's some nice ideas in there, but I think I'll stick to Python and the very nice CherryPy 2.0.
From what I can gather, Ruby on rails is essentially two things-
1. a Model-View-Controller framework
2. an object-relational mapping framework.
I've build similar functionality in most languages I've worked with. I've recently built a php5 framework in about 20 hours work that seems to do everything RoR does (albiet it's not as nicely polished).
So other than the fact that Ruby (Being similar in philosophy to python) is much nicer than most other languages, can anyone explain whats so great about this framework (i.e. what sets it apart from every other MVC and O-R mapping out there).
(This post is not intended to attack RoR- As the lead developer at a small software development company I'd seriously like to know).
Wow, I'm surprised to find a WebObjects developer responding. I figured the few remaining WO developers were all hiding ina Y2K bunker somewhere wondering if it was safe to crack the hatch yet, or something. :)
Seriously though, Rails does things differently from the typically NeXTSteppish way that WO approaches the problem. And there is code, but it's generated, which is the same case with Rails. You didn't think you normally wrote those little two lines did you? Of course not. You generate it and only modify it if you need something special.
But WO is probably one of the only web development frameworks that I can think of that comes anywhere close to Rails.
Slashdot. It's Not For Common Sense
All this sh!t has not been done already. Until Perl 6 is ready for primetime, it's nothing compared to Ruby or Python. Perl 6 looks very promising, but I can develop Rails apps today, and have them up-and-running in just 10 minutes.
Maypole doesn't even come close to matching Rails. I have all kinds of respect for Perl developers, because I was one. But like you said, "We need programmers to act sensibly and use the right language/framework for the job at hand."
Ruby and Rails are those frameworks for now.
Slashdot. It's Not For Common Sense
I too was a little skeptical of python's use of whitespace. After a little while I came to love it. I think it's more elegant then having to type 'end' all the time like you do in ruby, or having to terminate expressions with ';', or having to surround functions with braces, etc...
Here was the ruby version:
:a, :b
class Foo
attr_accessor
def add() a + b end
end
f = Foo.new
f.a = 1
f.b = 2
puts f.add
Here's the python version:
class Foo:
def __init__(self):
self.a = 0
self.b = 0
def add(self):
return (self.a + self.b)
f = Foo()
f.a = 1
f.b = 2
print f.add()
... pretty similar, no?
And for those of you who like things compact:
class Foo:
def __init__(self): self.a = self.b = 0
def add(self): return (self.a + self.b)
f = Foo()
f.a, f.b = 1, 2
print f.add()
aXV1cTswMDR5dS9wc2gwYnFxew
It would be great if more ISP had Ruby preinstalled, but it is possible to install Ruby/Rails without having root access to your webhost. As long as they have CGI, and Apache configured right. I have posted a tutorial on how to setup Ruby/Rails at my host, www.nicewebhost.biz.
This was my first Slashdot post ever. I hope I didn't break every rule.