Ajax On Rails 235
mu-sly writes "Ajax and Rails - probably two of the biggest buzzwords in web development at the moment. In this article over at ONLamp, Curt Hibbs introduces the incredibly powerful Ajax support that is part of the Ruby on Rails web application framework. It's a great read, and serves as a gentle introduction to the cool stuff you can accomplish with ease using the Ajax features of Rails."
Ruby on Rails as a threat to PHP? (Score:5, Insightful)
Which is the bigger irony: (Score:4, Insightful)
b) Microsoft's own technology being used by Google to loosen Redmond's deathgrip on the market?
Dont Forget Zope (Score:4, Insightful)
On the other hand remember Zope - If you can get your head around Aqusition, the ZODB and Product Deveopment then Zope is a super-fast development platform.
And the funny thing is... (Score:2, Insightful)
Re:Rails, great for those fed up with J2EE. (Score:2, Insightful)
The moral is, no matter how complex a system build on Ruby will get, it will always be more simple to use than a system build on Java, just because Java carries the characteristics of a systems programming language while Ruby carries the characteristics of a scripting programming language.
Re:Rails, great for those fed up with J2EE. (Score:3, Insightful)
No, you hold the hype for 3 months. (Score:5, Insightful)
Re:The Straight Scoop On AJAX & RoR here... (Score:1, Insightful)
A web application framework that includes a web application program generator
No, Rails generates many methods "on the fly", but it doesn't generate any program for you. You still have to write the program. However, there are many cases where if you don't write your own code for something, Rails will supply a "default". When you get started writing your app, do you really need to waste time writing code to "display the template"? No, rails does it for you and chooses the template with the same name as the action. However if you need it to do something different, which is common, you simply have to add the one line of code to render the template. This saves a lot of time!
Think of it this way: when you log into a Unix shell, you need to "ls" some files, "cp" some files, etc. Luckily, most Unix shells have those commands available, already written for you. Does that mean you can't write your own? No. Does that mean you can't customize what they do? No, they have lots of flags. Do you often need to write your own? No, usually the existing functions are good enough.
That's what Rails is: a domain-specific language for writing web apps. Of course you can throw all that out the window and write *any code you want*, Ruby is a general programming language, but it's kinda silly to waste your time like that.
a database
what database?
Rails doesn't "include" the Ruby language! And the web server is part of the Ruby library, not Rails!
The program generator accepts a description of database tables and generates generic Ruby code (web pages) to do CRUD (create, read, update, delete) maintenance of each table.
Man, you are really lost. ActiveRecord (a PART of Rails, you can use your own model classes) queries the DB to find methods *if you haven't defined them*. It also makes time-saving assumptions like, the name of the table is derived from the name of your class. Most people of course, use the defaults.
With very little initial effort one can create a (very) basic web application.
Delete "initial". Delete "(very) basic". Replace "create" with "create and maintain".
Same weaknesses as most one-way program generators:
Rails is not a code generator. Do you understand? No .rb files are created. It's all done dynamically, on the fly, with well-factored libraries. You can rewrite or replace any part of it.
Once a site is generated, modifying the generated code slows things to a near-halt since
Man, when you're in a hole, stop digging. All you have to do to "modify" the "generated code" is write a method that overrides the default. If you're an OO programmer you already understand the concept. (And no, it's not hard to do. If your table has a "first_name" column, and you want to override Rails' generated method, name your method "first_name". The original value is in a hash called "@attributes". It ain't rocket science).
There is no round-trip capability (i.e., if you hand-coded changes to a web app, regenerating the app in RoR will wipe out those changes.
You seriously need to take 10 minutes to look at Rails so you can realize how ridiculous this is.
Both RoR and AJAX are being pitched to communities not particularly skilled in development.
If this community doesn't include folks like you, count me in.
I've been coding since before the web, for nearly 20 years. I've done "real" MVC. Rails is a collection of all the good ideas people have been using for years, all in one pac
Re:ASP.NET (Score:3, Insightful)
You don't understand one of the most important necessary preconditions for a larger web app in corporations - someone to approve it.
J2EE and ASP.NET have rich organizations that they can loan you to take key decision makers (CFOs) out to lunch to help approve expensive J2EE projects.
Compared to the Oracle sales guy flying my previous CFO out to some golf conference to pitch their J2EE-based framework, Rails has NOTHING..
I speak from experience - We had the case of One Oracle Salesguy against EVERY SINGLE internally developer telling this CFO that the Oracle framework sucked and that even Oracle was moving to Tomcat. Guess who won.
That feature - the lunch&conference&golf budget - and that feature alone is enough to make J2EE and ASP.NET win most corporate environments.
Re:Rails, great for those fed up with J2EE. (Score:3, Insightful)
Rails itself could be put on top of any persistence layer. Instiki uses Madeliene instead of AR and it works fine. It just comes, out of box, with AR installed and that is the most natural. If you write your own ORM, it can work with rails. People have had success working with legacy schemas by frontending them with postgres views that behave more in the way that AR expects.
In any case, rails is more suited to new projects with new databases at this time. AR doesn't propose nonstandard database design in principle, it just dictates certain facts (mostly naming conventions for columns/tables) which can often be overridden. The most obvious one is that rails expects non-join tables to have an INT(11) PRIMARY KEY AUTO_INCREMENT field. Not being a DBA, I don't know what database design patterns are out there. Being a performance and efficiency conscious developer, I don't see how AR's patterns could get you into a performance or maintainability muddle by using them on a new project.
Re:Ruby? (Score:1, Insightful)
Algorithmic and architectural optimization is best accomplished after you fully understand the problem domain, and low-level code optimization is best done only after you've optimized the big stuff. Most of the time, you don't go in knowing exactly what you're doing, so you can't make big gains without refactoring a ton. In fact, the more you design up front, the more work it is to go back and change things around. This is one reason why iterative development methodologies are gaining in popularity.
Our example, Ruby, is currently a 1.x release. A feature-complete 1.x release, as far as I'm concerned. Now, Ruby 2's VM is planned to be JIT and generally faster. But, I guess it won't because apparantly refactoring "doesn't actually work". Just the other day I was writing some new code that ran faster, but it actually didn't because, see, I had written slower code to begin with, which makes all succeeding versions work at exactly the same speed. Yeah.
-/ILP/-
So much for make it work, make it right, make it fast
Advantages of dynamic languages (Score:3, Insightful)
The other advantage of dynamic languages is flexibility. While Java has limited support for features like reflection and generics, dynamic languages have offered much more powerful and easy to use versions of these features for years. Java is also missing other dynamic features like closures and metaprogramming. Groovy's feature list is an inverted list of many of the limitations in Java's dynamic capabilities.
Java's main contribution to programming languages isn't any new feature. It doesn't have any significant new features, and most of its main features like object orientation, byte-compilation/VM and primitive concurrency were in other languages like Simula and Pascal in the 1960s or 1970s. Java's primary contribution is that it was well marketed and that its limited dynamic features have inspired a large number of programmers to want more of the flexibility that languages like Scheme and Smalltalk offered decades ago.
Re:Rails, great for those fed up with J2EE. (Score:3, Insightful)