Slashdot Mirror


Is Ruby on Rails Maintainable?

kale77in asks: "I've become a big fan of Ruby over the past few months, but I'm not at all sure about Ruby On Rails. Automatic code generation sets of alarm bells in my mind; so that, to RoR's promise of 'Web Development that Doesn't Hurt', I automatically add '...until you have to maintain it'. On the other hand, some writers and coders I respect (like the Pragmatic Programming mob) seem to be fans. I've mainly written generators in Python, to produce PHP/SQL/Java from SQL files, but I've always gone back to well-constructed objects, where extension and overloading offers more precise and maintainable customization than auto-generation allows. So is Rails just a nice RAD tool for disposable, cookie-cutter apps (which have a place, of course)? Is high-level generation just a bad OO substitute? And what has your experience of Rails' maintainability been?"

78 of 348 comments (clear)

  1. Uhm... by Black+Parrot · · Score: 4, Insightful

    > Automatic code generation sets of alarm bells in my mind

    Do you have a beef with compilers and assemblers?

    --
    Sheesh, evil *and* a jerk. -- Jade
    1. Re:Uhm... by Pxtl · · Score: 5, Insightful

      Well, if you have to do maintenance work on the resulting machine code, then yes, it does alarm me. Otherwise, not so much. Likewise, any code gen environment where you're maintaining the generated code instead of working on the generator should worry people.

    2. Re:Uhm... by eclectro · · Score: 2, Funny

      Do you have a beef with compilers and assemblers?

      No, but interpreters have always slowed me down.

      --
      Take the cheese to sickbay, the doctor should see it as soon as possible - B'Elanna Torres, "Learning Curve"
    3. Re:Uhm... by Bastian · · Score: 4, Insightful

      I think the author is thinking of this from an attitude of generating code using RoR and then maintaining the generated code. Which is the wrong way to do it. If there's a bug in the original RoR code, change the original code. If there's a bug in the generated code, you change code generator.

      If you're writing the original app using a code generator and making all subsequent modifications to the software by modifying the product of the generator, you've sort of missed the point.

    4. Re:Uhm... by Bruce+Perens · · Score: 4, Insightful
      You have two options with scaffolds: let them be generated every time the program starts, or get the code generated into view source code that you can edit from then on. So, you either have code that you don't have to maintain at all, or code that's yours. Pick the best for what you're doing. It's brief and clear code. If you use the generated-every-time option, you can override it method-by-method simply be creating a view source file for that method.

      Bruce

    5. Re:Uhm... by Dracolytch · · Score: 2, Insightful

      So the code generator should be able to automatically generate any potential output? Hmm... I'm not sure I agree with that.

      --
      This sig has been enciphered with a one-time pad. It could say almost anything.
    6. Re:Uhm... by publius_ovidius · · Score: 4, Informative

      Do you have a beef with compilers and assemblers?

      This is a valid question. Quite often when we have a robust low-level language generating high-level language (HLL) code, it's extremely well thought out and tested. However, many are dubious about HLL generating HLL code. I suspect (though I can't prove it) that this is because HLL -> HLL tends to be less widely used and thus is less thoroughly tested and less planned. When done properly -- particularly when covering a restricted and well-defined domain -- it can be extremely powerful. When done improperly, it's a nightmare.

      Rails has a large enough user base that most common bugs have been eradicated but from what I've seen, it appears to have a problem that many fourth generation languages suffer from: if your problem fits its domain, it's a piece of cake to solve. When your problem doesn't fit its domain, it can be extremely difficult to solve (anyone who's ever worked with the 4GL Easystrieve Plus can readily testify to this). Most web-based apps, though, are simple enough that folks working with Ruby generally don't seem to have much of a problem with it. However, I've heard horror stories about people trying to use their custom model in lieu of what Rails natively supports -- though I've not had first-hand experience.

      Compilers and assemblers tend to be general purpose tools which address a fairly wide problem space. HLL -> HLL tools tend to be special purpose tools and trying to get them to solve problems they aren't optimized for can be trying. In the case of Rails, one thing it excels at (CRUD apps) is a well-known problem space and Rails fits quite nicely.

      So I have to say that comparing Rails to compilers or assemblers doesn't quite fit simply due to the differing focus of said tools. However, all of them require that someone trying to work with them understand what they're doing (at least at a high level) and that brings down the maintenance burden quite a bit. Personally, I'm quite impressed with Rails and am happy to see it spread.

    7. Re:Uhm... by Jack9 · · Score: 3, Interesting

      Practical question about Rails implementation with Ruby.

      I concede that "scaffolding" is used by EVERY PROGRAMMER. That's the idea behind code reuse. "I'll adapt my authentication I made for a BB system to use as auth for an entire website." "I'll use my pretty table CSS from last year for displaying this data."

      Can you alter the templates generated? If I have coding standards implemented, I have serious doubts the default RoR scaffold templates specifically adhere to mine. If I can't alter these templates, the answer to the article is no. If I can alter these templates (I assume it's possible), the answer to the article is yes.

      How is this article generating all this Ruby-anti-Ruby nonsense when it's a question of Rail implementation? More importantly, why isn't there a PHPoR?

      --

      Often wrong but never in doubt.
      I am Jack9.
      Everyone knows me.
    8. Re:Uhm... by CrazedWalrus · · Score: 2, Informative

      There are a few. I've never used them, so I can't speak to their quality, but apparently work is being done on exactly what you ask:

      Biscuit: http://bennolan.com/biscuit/
      Qcodo: http://www.gadgetopia.com/post/4726
      Cake: http://cakephp.org/ ... just to name a few. I just google'd for 'php rails', and got lots of interesting links.

    9. Re:Uhm... by Marillion · · Score: 3, Informative
      RoR has explicit and implicit code generation. Model classes which extend ActiveRecord::Base have amazing amounts of implicit, runtime-generated methods which can be replaced with custom logic if that's what you want.

      The template generators are explicitly called development-generated blocks of code which are intended to be one-time only and edited by hand thereafter to meet business objectives.

      Between the two, I love the former and dislike the later. I usually don't use scaffold built views except for Quick and Dirty lookup table administration. I think the difference between the final view and an empty file is smaller than the scaffold view and the final view.

      --
      This is a boring sig
    10. Re:Uhm... by Bruce+Perens · · Score: 2, Informative
      Can you alter the templates generated?

      Yes. Either completely override the template for a specific method starting from zero with your own code, or get the code generated for that method and then alter it.

      How is this article generating all this Ruby-anti-Ruby nonsense when it's a question of Rail implementation?

      Because this is in part an instance of the perennial compiled-vs-interpreted argument.

      More importantly, why isn't there a PHPoR?

      IMO, because the developers capable of doing something like RoR 1) didn't like the PHP language as much as Ruby and 2) felt they could do better than the existing PHP web environment.

      Thanks

      Bruce

    11. Re:Uhm... by caseydk · · Score: 2, Interesting

      I did an interview with Mike Ho - the lead developer of QCodo - just a couple weeks ago. He laid out some pretty good differences between RoR & QCodo. Check it out: http://codesnipers.com/?q=node/187

  2. It's obvious... by eruanno · · Score: 5, Informative

    It's quite obvious that the concept of the automatic code generation done in Ruby On Rails was either not completely grasped or completely missed by the author. The whole purpose of the code being generated was to give you a basic structure to take and change until it was what you needed it to be. This is precisely why it is called 'scaffolding', because it gives you the framework to get started with.

    As far as the Ruby On Rails framework itself is concerned, it is extremely capable and flexible for handling a great deal of web application projects. Of course there will be specific functionality that Ruby On Rails will not handle very well — there never are perfect solutions.

    I wouldn't consider the reviewers objections completely devoid of import, just misguided. You must always be careful about anything you didn't do yourself, but you must exert the same care and attention to the stuff that you do create yourself! Often we put far too much confidence in our own coding skills.

    So, in the end, the concept of Ruby On Rails is simply to alleviate the mundane, rote programming that goes into the basics, particularly the structure and minimalistic database interaction, and make it surprisingly simple.

    M.T.

    --
    "Support Bacteria - Its the only culture some people have" - Circa 1985
    1. Re:It's obvious... by qslack · · Score: 5, Interesting

      This is exactly right. The scaffolding is seen as the major feature of Ruby on Rails by far too many people. It's not. In fact, if anyone were making a serious, production-level app, they wouldn't even use the scaffolding. It serves only three purposes: to help newcomers to the language become familiar, to jumpstart a simple Web app, and to look amazing on the screencasts.

      Ruby on Rails is great. At the very least, everybody should try it. It's no silver bullet, but it is a huge improvement over most everything else out there.

      Using Rails is a bit like using a Mac: you always run into these little helpful features that make you think it was created just for you.

    2. Re:It's obvious... by happyemoticon · · Score: 4, Insightful

      Here's how I'd look at the problem. I'm not a developer, but I'm decent with Java, C++, Python, and Perl. If I look at some random Java project, I can pretty much grok what it's saying and make the changes I need. The same is true for many languages I'm not really familiar with, like Lua and php (I've been updating a WoW mod that was dropped by its creator).

      Now, mind you I might just be upset because I looked at RoR and didn't instantly understand everything. But I was generally put off by the amount of things that were being invoked as if by magic, and I'm even less of a magician than I am a developer. At least with some Java project I've got all the code in that directory, and I know which parts of the standard API and which 3rd party modules are being imported. I looked at some of the stack traces that I got and I was totally bewildered.

      One thing that could alleviate this is good documentation. The majority of RoR docs I've found are written by people who either have no intention to truly impart knowledge or don't have the competence, and are directed at non-programmers. They're consummately infuriating. I would much rather hear the ugly truth (I read Programming Perl and Python in a Nutshell for leisure sometimes) than be treated like a child. This pretty much means I have to read the API specs, which ain't no walk in the park.

      What this boils down to is if I were in a management situation, I wouldn't know how to hire or deal with a Ruby dev. First off, I couldn't just get somebody I thought had good character, work ethic, an excellent track record and a portable skill set, I'd have to hire a Ruby on Rails Developer. I mean, there are some times when you really want an expert in the field, but those people are hard to come by. Then if I hired him I'd be like, "Hey John, what's this function over here do?" and he'd be stirring a black pot in a pointy hat while cackling, "Double, double, boil and trouble / Fire burn and cauldron bubble!"

    3. Re:It's obvious... by bryanthompson · · Score: 4, Informative

      I agree 100%. The scaffolding should be used to get a feel for how quickly developing *anything* on Rails can be. For newbies or J2ee migrants, the short videos on the Locomotive and rubyonrails.com site shows how scaffolding can be built, modified, etc. There's no way I'd put scaffolding into any site that others will see. It's quick, dirty, and easy. Use and extend it, but don't rely on it!

      Coming from J2ee-land, Rails has been really easy to pick up, and very easy to maintain--so far. If you visit the #rubyonrails irc.freenode.net, it's very active, and there are a ton of Java guys who want to see what RoR is all about. My biggest problem was figuring out the project structure and then figuring out the standards. Parenthesis, semicolon line endings, and block brackets not being required really turned me off at first. It felt sloppy and just weird.

      I think the biggest advantage is that all of the add-ons we were using are included in RoR. Log4j and hibernate, for example, can be hell to set up and maintain. With RoR, the logger is built in, and its migrations are just hibernate-ish enough to get the functionallity I wanted out of it. The pieces you need are there, and they are easy to use. For us OS X guys, Locomotive makes it ridiculously easy to start out also. I don't know about setting up a RoR app in a production environment... From what I've read there looks like a lot of initial configuration, but I had my share of difficulties with Tomcat also.

      Since we're still developing the app, I don't know how easy it will be in the future to maintain. I worry about Ruby updates and how they'll interact with old code. WHat happens when deployed in totally different environments? The API is total suck, and there really isn't a ton of information like there is on J2ee. I want to know the best practices and common ways of doing things, but all I find are blogs and random articles that don't really get into detail. The Programming Ruby and Agile Web Development with Rails books are great, but they don't get into these other areas.

  3. Yes, very by Bruce+Perens · · Score: 5, Interesting
    Maintainability is a combination of several factors. Most important is: can you read and understand the code? Ruby on Rails wins in this category because it's brief - smaller and thus easier to comprehend than Java - without being cryptic like APL. Second most important is: is it easily modified? Here Rails wins again, because of the say it only once philosophy and because of Ruby's duck typing *. Say-it-once means that you don't have to track down the other places where you've had to say the same thing (as in Java) and change them. Duck typing means you can change an object substantially without the user of that object seeing the change, because the user only knows what methods the object is expected to respond to, not the object's type.

    Bruce

    * Duck typing: If it looks like a duck and sounds like a duck, it's a duck! Object types don't matter to the users of Ruby objects. What matters is that the object responds to a particular collection of methods. This is something like virtual functions, but does not require inheritance from any class or virtual class although inheritance from a Ruby module (sort of an abstract base class) is often the best way to implement those methods. So, a Ruby object might export a collection of methods called Enumerable and would respond positively to an is_enumerable? method to identify that those services are available.

    1. Re:Yes, very by Atlantic+Wall · · Score: 2, Informative

      If you had to use something more than once in Java, why not just write it once and overload the method or the object. That statement that you have to edit the same thing in different places does not make sense if Java is coded correctly.

      --
      To Hell with the Queen of England!
    2. Re:Yes, very by Bruce+Perens · · Score: 2, Informative
      It's mostly declaration that has to be repeated endlessly, rather than implementation.

      Bruce

    3. Re:Yes, very by jarran · · Score: 4, Insightful

      Of course, Java doesn't require inheritence either. What you have described is exactly what Java interfaces are for.

      Ruby's lack of typing does make it incredibly flexible, but it has significant disadvantages to, namely that a whole class of programming errors which should be found at compile time, go totally unnoticed until the program tries to execute that code path and finds that it has an object of the wrong type.

      Don't get me wrong, I program Java at work and hate it, and I program Ruby for play and love it. But I still think we can do significantly better.

      Languages like O'Caml, manage to get the best of both worlds. For example, you can write a method in O'Caml which takes a object as it's parameter and uses a "compare" method on that object. Elsewhere in your program you try to call this method with an object that doesn't have a compare method. Not only will O'Caml detect this error at compile time, it can do so without forcing the programmer write type declarations everywhere.

      Sadly O'Caml isn't the answer either, it doesn't have a remotely decent web application framework. But I think that combining strong typing with type inference is the way to go for rapid prototyping environments.

    4. Re:Yes, very by Abcd1234 · · Score: 5, Insightful

      Yeah! And if in, say, Java, you have a superclass and subclass, how do you know the subclass didn't override superclass methods to do totally different things!

      It's called not doing stupid stuff. Now, I don't know much about Ruby, but in Objective-C, these things are called Protocols, and in Java, they're called Interfaces, but the rule is that if you implement a given protocol, then you must conform to a given contract. Can a developer deviate from that contract? Yes. Are they fucking retards if they do? Absolutely! If you want to prevent that, your only option is to work with a language like Eiffel which incorporates design-by-contract at the language level... of course, even that isn't foolproof.

    5. Re:Yes, very by Eivind+Eklund · · Score: 2, Interesting
      No, you're not guaranteed that something that respond to the same methods with the same parameter counts is really implementing the same interface. However, while writing an article and a bunch of code for type checking in Ruby, I read've read probably hundreds of discussions on this and certainly thousands of messages. I've not once heard anybody claim that they'd seen this happen or heard of it happening as a problem in practice.

      Eivind.

      --
      Doubting the existence of evolution is like doubting the existence of China: It just shows that you're uninformed.
    6. Re:Yes, very by Hognoxious · · Score: 2, Insightful
      how do you know the subclass didn't override superclass methods to do totally different things!
      And how do you know that a method does what its name implies anyway? Or that it works as intended? At some point, you have to trust the author of them. Or verify the source yourself.
      --
      Confucius say, "Find worm in apple - bad. Find half a worm - worse."
    7. Re:Yes, very by the+chao+goes+mu · · Score: 4, Insightful

      Give it time. Ruby and RoR is still young. It takes a while to accumulate a body of stupid coders and the associated body of bad code.

      --
      Boys from the City. Not yet caught by the Whirlwind of Progress. Feed soda pop to the thirsty pigs.
    8. Re:Yes, very by spludge · · Score: 2, Insightful
      Most important is: can you read and understand the code? Ruby on Rails wins in this category because it's brief - smaller and thus easier to comprehend than Java - without being cryptic like APL

      I disagree with this. I recently had to debug some RDoc code to create a custom generator. RDoc a big chunk of mostly uncommented Ruby code. Trying to debug and understand it was somewhat reminiscent of trying to debug Perl. Ruby gives a programmer the same expressiveness that allows them to write highly cryptic short statements that are very difficult to unravel. Not as bad as Perl for sure, but still difficult. The other big problem is that Ruby is so dynamic. I found it very difficult to trace the runtime behaviour of code because it is so easy to modify the runtime behaviour of an object from anywhere in the code!

      I agree that Java can sometimes be so verbose that it is hard to debug, but Ruby does not strike the right balance. I'd prefer to see a statically typed language (for easier debugging and refactoring in the IDE) that is also dynamic, but that enforces that runtime modification is somehow easier to follow.

    9. Re:Yes, very by Bruce+Perens · · Score: 2, Interesting
      Not only will O'Caml detect this error at compile time, it can do so without forcing the programmer [to] write type declarations everywhere.

      Only if the object's type is explicit at some point in the function call tree at compile time, I suppose. I can think of dynamic scenaroios where this would not be knowable at compile time.

      Static checking as you describe would involve propogating type information from the called function up through its callers while that call sequence is being checked. While nobody does this for Ruby (I think Matz's Ruby compiler is still in alpha-test) it's theoretically possible.

      Thanks

      Bruce

    10. Re:Yes, very by Bruce+Perens · · Score: 4, Funny

      Hm. Then perhaps the best way to maintain code quality is to change languages every few years :-)

    11. Re:Yes, very by CableModemSniper · · Score: 2, Informative
      --
      Why not fork?
    12. Re:Yes, very by pthisis · · Score: 2, Funny

      Or you could just be incredibly elitist about it and shame bad coders into never publishing stupid crap for other people to see or maintain
      No, the key is to have a superficial language feature that has no impact on development time but keeps people away.

      Tons of parentheses seems to work well. Using indentation to delimit is another approach that's still in its infancy.

      --
      rage, rage against the dying of the light
    13. Re:Yes, very by Bruce+Perens · · Score: 2, Interesting
      there's no reason you couldn't have a "Java on Rails", that's almost as good.

      Hibernate, Struts, Spring, and so on add facilities to Java that bring it more in the direction of Rails. There's a famous example of a Java programmer who set out to show that he could write concise code in Java on a par with RoR. He attempted to duplicate an existing RoR program. He sent the result to the RoR creator, claiming success. It's three times the size of the equivalent RoR code. So, I'm still waiting to see someone make Java as concise.

      Bruce

    14. Re:Yes, very by jbolden · · Score: 2, Insightful

      You describe the program as: mostly uncommented, highly cryptic short statements that are very difficult to unravel, modifies the runtime behaviour of an object from anywhere in the code. Why do you think it was written to be maintained by an external author? It seems to me the author hadn't intended a 3rd party to maintain his code. Further my guess is that he was conceptualizing the problem differently than you were. "Highly cryptic" usually means that you need to understand how the programmer viewed the problem before trying to figure out what the program does; that is maintain it like you would translate a poem not fix a broken car.

  4. Get the basic premise right, first by blakeyez · · Score: 5, Informative

    Rails is _not_ a code generation framework. Note the period on that sentence.

    Rails may provide the some simple scaffold generation, but that's only there if you _want_ to use it, and it happens to fit the way you'd like a particular part of your app to work. The code produced is concise, easy-to-follow, and thus easy-to-maintain.

    For my own applications, I barely ever use scaffolding. It works well for simple admin screens where I just want 'something' that works for now, then will spend some effort on designing it a little better, later.

    Rails is as maintainable as you make it. If you're a poor programmer, you're likely to write unmaintainable code, no matter what language or framework you have to help you. Rails helps point you in the right direction, but in the end, it's up to the _developer_ how maintainable his/her code is.

  5. Gem up on Ruby First! by Boss,+Pointy+Haired · · Score: 5, Insightful

    Rails has created quite a buzz in the Web 2.0 community, which means a lot of people jump straight into Rails without any prior knowledge of Ruby; and then when they find they can't get very far they blame that on Rails.

    It's like hacking the Linux Kernel without ever having programmed in C. You're bound to think it sucks because you won't have a clue what's going on.

    1. Re:Gem up on Ruby First! by secolactico · · Score: 2

      Somebody mod this guy up!

      Myself, I'm in that situation. I've never done any coding professionally except to support my own work as network admin. Having started in Perl, every problem I come across I try to solve in perl (even when a simpler shell script would suffice).

      Now that I'm giving rails a try, I find myself frustrated because I realize I know nothing of ruby. So next step (for me) is to put aside rails and learn some ruby. Rails will come afterwards.

      If you want rapid application developement, I'd say you are better off with a tool like CodeCharge (http://www.yessoftware.com/products/product_detai l.php?product_id=1 a try. It's not free and it's not very customizable. But you will have a completed app in a very short time.

      --
      No sig
  6. It isn't really code generation by Anonymous Coward · · Score: 5, Informative

    Ruby on Rails script/generate generates very little code. If you choose "File, New class" in Eclipse, you get the about the same amount of code, as you would get if you used rails generation features. The only difference is that ruby on rails also generates a test class for the model.

    Scaffolding generates a bit more code, but it is never intended to be actually used. It is ment to be slowly replaced, piece by piece, by your own code. So I don't think the disadvantages of code generation really applies here.

    So yes, in my experience a ruby on rails project is maintainable.

  7. "favoring convention over configuration" by leather_helmet · · Score: 2, Informative

    My limited use of RoR has been favorable - no issues, as of yet, regarding maintainability or spheghetti-O code

    It has worked as promised and I have been pleasantly surprised by its functionality
    btw, my main use was creating a new database for an intranet application

  8. This is your typical dev-versus-admin mentality. by old_skul · · Score: 3, Insightful

    Devs are always looking for ways to reduce the amount of time it takes to code something. Admins are always looking for ways to automate their jobs. RoR is nice for devs but makes the admin tasks pretty hard - unless the admin knows his way around the product about as well as the dev does.

    Now add the additional idea of a custom-designed project that the dev put together - and didn't document (because devs never document, right?). Chaos ensues.

  9. Bad OO Substitute? by cheesedog · · Score: 5, Insightful
    I'll make a bold counter-claim: Object-oriented programming is a bad substitute for straight-forward dynamic binding and typing.

    I've been doing almost pure OO programming for the past 8 years (using mostly C++ and Java), but recently took up Python (for python-twisted and pyWxWindows) and Ruby on Rails (for server-side development), and I can tell you that it is much simpler, easier to debug, and quicker to get done than taking the time to create massive class hierarchies whose inheritance structures and interfaces only exist to satisfy type-safety requirements.

    Don't get me wrong. I like writing class hierarchies as much as the next guy. I've spent years doing it. But when I compare what I can get done in 30 minutes in, say, Python, to what I can't get done in 3 hours in C++, the advantages start to become very clear.

    1. Re:Bad OO Substitute? by Bruce+Perens · · Score: 4, Insightful
      Ruby doesn't contradict the Object Oriented programming paradigm. If you go back to the origins of OO in Smalltalk, it was much closer to Ruby than some tightly-typed OO languages like C++ and Java. Perhaps the lesson to be learned is that tight typing of class references isn't that good an idea.

      Thanks

      Bruce

    2. Re:Bad OO Substitute? by the+chao+goes+mu · · Score: 3, Insightful

      Actually Java's biggest problem in my experience is inconsistent typing. Why does the method to fetch a port return an Integer object, but socket connections want an int primitive? Or how about the eight million different date/time object types? I think if that mess were made even a bit more consistent, Java would have a significantly faster development cycle.

      --
      Boys from the City. Not yet caught by the Whirlwind of Progress. Feed soda pop to the thirsty pigs.
    3. Re:Bad OO Substitute? by IamTheRealMike · · Score: 3, Interesting
      Of course it isn't as simple as that. If it was, everybody would use Ruby or Python for everything and Java/C#/C++ would be dead.

      In practice, strong typing and the lack of Ruby-style dynamism allows compilers and runtimes to make optimizations they otherwise couldn't. Those matter, a lot, try looking at the memory usage or execution speed of your average Ruby program sometime! Worse, it's an unfixable problem, at least without modifying the language itself quite heavily.

      I think the way we're going to go with language design, as an industry, is more like Boo - a language which on the surface looks like Python and has many of the clarity and programmer efficiency features that make Python so much fun to use, but under the hood is actually a traditional strong/static typed language. In Boo, type inference is used to let you drop many of the redundant type declarations that normally clutter up Java/C#/C++ style code, and a smart compiler plugin system is used to let you add new features to the language easily. This is traded off against the ability to do things like add/remove methods at runtime which are hard to implement in a time/space efficient manner.

  10. Try Ruby here! In your browser! Painless! by 5n3ak3rp1mp · · Score: 5, Informative

    Try Ruby (the language) here. Integral to understanding much of Rails.

    I released my first production Rails app last month. I like it a lot. I have a background in ASP/SQL Server/PHP. Not having to use Microsoft Windows itself is a huge win. But I like the design of the language and the framework and the built-in separation and a thousand little other things. Check out #rubyonrails on irc.freenode.net, great community there too.

  11. Wrong Idea by AntiDragon · · Score: 3, Informative

    The "Automatic Code Generation" is a slight misnomer. It would be better to think of it as "Semi Automatic Code Generation". (Mental image...hehe).

    It's just a part of the system that can *if you so desire* generate basic classes and parts of an MVC system by inspecting your database. It's basic and is designed to give you something to work with while you build the actual application you want.

    The real strength of the Rails framework is the various support libraries and the way it gently encourages you to follow specific coding conventions (Hungarian notation fans, run for the hills!). If anything, this not only speeds development but makes maintenance a breeze - Ruby is a very readable language when not abused.

    Hmm...that does all sound a bit fan-boyish, doesn't it? Well, I'm a PHP convert to Ruby and I have to say I wish I'd decided to take a look sooner.

    Short answer - Rails systems are probably more maintainable than your average ASP/PHP system.

    --
    "...So I hung back and lurked. For 18 months. Can't beat a good old-fashioned lurking."
  12. Scaffolding is exactly what it says it is. by Boss,+Pointy+Haired · · Score: 2, Insightful

    Automatic code generation sets of alarm bells in my mind;

    You're reading too much into it. Just like when you're building a house; you put the Scaffolding up to give you something to work from. When you're done building your project, the Scaffolding is gone.

  13. We've been told... by fury88 · · Score: 3, Funny

    To stay FAR FAR AWAY from Ruby on Rails here. In fact, they sent us java developers to the Java conference and we were forbidden to go into any of those seminars. Why? Probably because they don't want us picking up any bad habits.

  14. Code Generation - Negative Image by ajwitte · · Score: 2, Insightful

    I think a lot of the "it's not maintainable or scalable" assessments of Rails come from people who have seen its code generation and "scaffolding" features and think that those are the main advantage of Rails. It's true that one can only do so much with the "scaffolding" which is simple and generic. However, the real power of Rails comes not from the scaffoldings but from the framework Rails provides in which to write custom code. I've written two Rails applications and maintained several others. None of them used the scaffolding provided by Rails - they had all hand-written code inside the bare-bones Rails-generated structure. Those applications have proved to be easily maintainable. It's a shame that most of the introductory tutorials/examples/videos for Rails focus on the scaffolding features, because that leads people without much Rails experience to believe that the scaffolding is all there is to Rails and form a (usually poor) opinion based on that.

    --
    chown -R us ~you/base
  15. Rails is more then meets the Eye by TheUncleD · · Score: 4, Informative

    Rails provides more then the scaffolding capabilities and simple framework of designing a blog as seen in the video. It provides the structure for fast and organized ruby application development by setting up for the user a foundation of modelling, views and controllers that are easy to use and distinguish. It is not the magic wand to a great web application. The magic wand comes with Ruby programming experience and learning to tie it into Rails application development. You could even go as far as stepping beyond the "narrow view" of what rails is doing and see the bigger picture, understanding that Ruby is supporting all of this webmagic and rails is providing the "rails" as it claims to. One challenge many of the "why is this better than Php?" questioners have difficulty seeing past is the far smaller community rails has, the less clear translation between what php can do and what rails is capable of, and the predefined examples of rails applications in action. Many people leap to using PHP becuase it provides pre-existing code snippets that make the same thing true of many php users, "simple cookie cutter codejobs." Rails offers you a chance at not only using a great framework, but also a great programming language that its built on to make more pragmatic and simpler design tactics to getting your website online and active. Another alternative to rails is Iowa which offers a lighter approach to maintenence, though remains less documented. It can be found here: http://enigo.com/projects/iowa Whatever you choose to do, look deeper into the situation then the surface of what appears to be "cookie cutter" programming and realize that a powerful tool lies beneath all of this: Ruby.

  16. ORM and MVC in the same framework by stelmach · · Score: 2, Informative

    I find it unfortunate that most of the 'newbie' tutorials jump right in to how to generate scaffold code. This code is a bit unmanageable and hard to modify, but I think it has a certain 'WOW' factor associated with it. Once the novelty wears off and you need to develop real applications, you will rarely use the generated scaffold code, and the code you write within the framework will certainly be manageable.

    Where I think Rails comes out on top is the fact that it includes a full blown ORM and an MVC implementation under the same, configuration-less framework. No more XML. No more duplicate java beans...More of this on my blog if interested.

  17. Code Generation in Rails is No Big Deal by fthiess · · Score: 2, Insightful

    I've been using Rails for several months, and I think it's "automatic code generation" is no big deal, and nothing to worry about. If you're worried about maintainability, it the wrong place to focus.

    The only time code gets generated for you automatically is at the very beginning of a project to create "scaffolding". That scaffolding is great, because it lets you get something up and running very quickly, but in my experience, it NEVER survives in the body of the project for long--you always want to do something differently, or more elaborately, than what the scaffolding provides.

    So, I think of Rails' scaffolding as "stub" code that happens to include some (very) basic functionality. Like code stubs, they just provide placeholders for you to use to flesh out your own code.

    Once the project is underway, it's unlikely you will generate any more code automatically--you don't need to.

    It's worth noting that what I've described here is the behavior and usage of code generators that are included as part of Rails. There *are* some cases where people have written code generators that attempt to automatically generate entire subsystems for you in a Rails app--and those generators are the subject of interminable support questions in online forums, and a lot of discussion within the Rails community as to their wisdom. . . which is why no generators like that are included as part of the Rails distribution.

    Beyond code generation, I can't say anything definitive about Rails maintainability because it's so new, but my feeling from having worked with my own code, and from having studied the code of others, is that Rails apps should be wonderfully maintainable. After all, the "opinionated" style of Rails leads all Rails apps to be laid out the same way, with the same directory structure, the same application architecture, coding standards, naming standards, etc.

    From my experience so far, all these things are likely to make Rails a winner from a maintainability standpoint, as well as in terms of productivity and fun!

  18. Nobody even uses the scaffolding anymore by bloodroot · · Score: 3, Funny

    Unless they're making a promotional movie on writing a slashdot replacement in 5 minutes

  19. Author has it all wrong by wackysootroom · · Score: 2, Informative

    Judging by how this article was written you haven't used rails at all, or maybe used it for something extremely trivial. The "automatic code generation" (scaffolding) is only there to help you get started on a project. You can completely bypass it if you want.

    I'd be willing to bet that if you used rails for an hour or two, you wouldn't have written this article. In fact, the entire article depends on your assumption that the code *has* to be generated automatically.

    So what are you waiting for? Try it and see!

  20. Re:Here's an AJAX example - how good is RoR for th by zardo · · Score: 2, Informative
    I've been using rails for over a year, I think that would be really easy and a testament to how great a language ruby is, in addition to how great a framework rails is. The filesystem classes you will be amazed with, and you don't even have to know javascript to get some pretty amazing AJAX functionality out of your app.

    I honestly couldn't think of a better way to do something like that than with Rails.

  21. TurboGears by ultrabot · · Score: 2, Interesting

    In the meantime, if you want rails-like development but with Python check out TurboGears.

    It's been raising quite a storm lately, and for a good reason!

    --
    Save your wrists today - switch to Dvorak
  22. Re:Eh kindof by brian_olsen · · Score: 3, Informative

    "It requires you to do a lot of things manually that could easily be done automatically, and you still write bits of SQL in your code."

    Which type of things can be done automatically, you see? Also, what is so bad about writing SQL queries *for complex queries*? I know in my case, I will not be hopping from database system to database system to worry about SQL compatibility issues.

    "Also, more importantly, it doesn't provide an application layer that entirely abstracts the functionality from the interface. This is bad for any number of reasons."

    You mean its use of ERb?

    "Finally, it's pretty much tied to MySQL, so if you use PgSQL or Oracle (and you should), then you're in for a big headache."

    I have no problem using it with PostgreSQL.

  23. Java Interfaces by bunglebungle · · Score: 2, Informative

    Java interfaces allow you to declare that something is a Duck, so it must be a duck. However, with Java, I can ensure that anything I think I want to call a duck does indeed fulfill the contract of being a duck. What in Ruby forces you to properly export the collection of methods in Enumerable when you defined is_enumerable to return true? Nothing?

    In Ruby, you can write code that assumes a parameter has a method called foo. In the future if I make a new object, I can add a foo method to it and pass it into that code. In Java, all it takes is the oh-so-hard task of creating an interface called, say, CanFoo, that declares a foo method, and typing my parameter to that. For anything I want to pass into that code, I just implement method foo, which I have to do anyway, and add CanFoo to my list of implemented interfaces. Classes don't have to inherit from any particular class, and they can implement as many interfaces as they want. So that was no more work. However, now the compiler helps me to ensure that I properly fulfill the contract of CanFoo. Plus if I want to do anything useful like find things that think they CanFoo, or rename foo to something else, the compiler will know where all of these references are and help me.

    I'm not anti-Ruby, but I just plain don't understand arguments like this for the language.

    Also, "say it only once" may be somewhat forced by the framework, which is a good principle of a framework, but that transcends languages, so I don't buy that, either.

    I'm not arguing that Rails isn't maintainable, just that your reasoning for why it is aren't exclusive to Rails or Ruby.

    1. Re:Java Interfaces by Tamerlin · · Score: 2, Interesting

      "Java interfaces allow you to declare that something is a Duck, so it must be a duck. However, with Java, I can ensure that anything I think I want to call a duck does indeed fulfill the contract of being a duck. "

      How? If I have an interface with a method "quack" that is supposed to print a message from a string you pass it, and I write a class implementing it that calculates the factorial of 1,023,342 instead, you can call it, and it will compile and even run, but still violate the contract of being a duck.

    2. Re:Java Interfaces by Dalroth · · Score: 2, Interesting

      Java interfaces allow you to declare that something is a Duck, so it must be a duck. However, with Java, I can ensure that anything I think I want to call a duck does indeed fulfill the contract of being a duck. What in Ruby forces you to properly export the collection of methods in Enumerable when you defined is_enumerable to return true? Nothing?

      I call BS. Just because a Java class implements an interface, does not mean it implements what is expected of the interface. If your compare method returns a -1 when it should return a +1, you aren't a duck, you're a retarded duck and Java let's you do that just like Ruby.

      Bryan

  24. Re:Eh kindof by znu · · Score: 4, Informative

    I've been using Rails for about 7 months, and have done two major projects in it. I completely disagree with your assessment. For starters, it's not at all tied to MySQL. PgSQL support is also very good. My understanding is that Oracle support is not so great at the moment. But I expect that will change. My real point here is that Rails is not inherently tied to any specific database; it's just a matter of what ActiveRecord adaptors happen to be out there right now.

    As far as requiring the user to write SQL code, yes, you do have to write fragments of SQL code, sometimes. But SQL is a useful way to describe queries -- that's the whole point. Would using some other query language, that got translated to SQL, be any better? I don't see why it would.

    Your comment about Rails not abstracting functionality from interface seems off base as well. Rails adopts a standard MVC architecture, which is pretty much the standard method for abstracting functionality from interface. If you're not getting such abstraction in your Rails apps, you probably just need to think about exactly what should go in the models, what should go in the controllers, and what should go in the views, and rearrange things a bit. Like any other MVC environment, Rails can't prevent you from e.g. putting view-specific code in your model. All it can do is provide a structure that allows you to properly separate these things if you take the time to think about your design properly.

    Finally, on the charge that Rails only provides proof-of-concept features, I think you've misunderstood one of the major design principles of Rails. Rails is intended to provide a framework to build on, not a bunch of components you can plug together to get a web app without writing any code. As such, many of its components focus on the core functionality that's really useful, to the exclusion of other stuff. That other stuff might sometimes be nice to have, but it frequently locks you into doing things the way the framework does them, instead of the way that's most appropriate to your app. The Rails approach is a very refreshing change, for me anyway, and I hope the project will continue to maintain this focus.

    --
    This space unintentionally left unblank.
  25. If you think Ruby on Rails is scary... by NardofDoom · · Score: 2, Funny

    You've obviously never worked with ASP.NET.

    --
    You have two hands and one brain, so always code twice as much as you think!
  26. RoR & Maintainability by Whatchamacallit · · Score: 2, Informative

    RoR (Ruby on Rails) is simply a very nice API for doing web apps with Ruby. It will auto-generate some code via what Rails calls Scaffolding. This is meant to get something working extremely quickly and it allows you to enter some data into a table with minimal fuss. The code it generates is quick and dirty and you are supposed to re-write each method as you move forward. That said, it's not a real code generator in the traditional sense. The Wow factor of the videos on rubyonrails.com show off the Scaffolding but that is only a very small part of Rails development.

    Ruby itself is very maintainable because the syntax is so very clean. However, it's up to you to document your code with meaningful comments, check it into CVS or Subversion, and implement your own Unit Tests, and include RDOC tags in your comments, etc. All code regardless of language is maintainable if you eliminate the code monkey bad habits. i.e. if you've been coding in PHP and all your code became unmaintable then it's your own fault and not that of PHP. Ruby in my opinion is better organized then PHP and encourages good code standards but ultimately, it's up to the programmer. If you are a neat freak and are very detail oriented and you tend to go back and cleanup, test your code before you check it into your version control system then your code will always be maintainable.

    I like the way the RoR ActiveRecord mapping system; maps my classes to database tables and objects to my records. You can programatically create records in the table by creating additional objects. The scaffolding will read an existing database table and generate working classes so you can utilize CRUD functionality. You don't have to use scaffolding but it comes in handy for me even when I throw it out one method at a time and re-write it.

  27. RoR HLL maintainance nightmare by recharged95 · · Score: 2, Insightful
    Granted that RoR is a nice alternative from Java or scripting--can RoR generated code be a nightmare to maintain?

    Yes, if poorly written and

    Yes, when applications get very, very complex--which is a given. And they will get very complex, just wait 2 yrs.

    Consider the great development tools of RoR such that you end up with a Microsoft environment/paradigm--great for RAD, not so great for critical systems that need to be up 24/7, 100%.

    I'd still go with XML Schema-based code generation, much more stable as it forces you to thing about state and behavior before you write your first GUI title bar. And since the web is XML-centric, makes sense..

  28. Structure generation vs code generation by Erisynne · · Score: 4, Insightful

    As others have noted, what Rails generates for you are stubs. Even if the stubs are full-featured enough to let you add, edit, view, and delete objects, they're still stubs. It's just that RoR is succinct enough that generating 150 lines of code (including action views and layouts) is all that's necessary to provide all of that functionality in a very basic way.

    But, two links for your consumption.

    My article on the topic of what I call Scaffold Withdrawal
    http://www.slash7.com/articles/2005/12/07/the-fall -from-scaffolding

    Structure generation vs code generation (from the Rails' creator's blog)
    http://www.loudthinking.com/arc/2005_10.html

    It's true that "Ask Slashdot" is vehicle for enlightenment, but I didn't think it was a vehicle for the basest laziness. I don't understand why someone would go Ask Slashdot instead of looking at a couple F/OSS Rails app packages and deciding for himself whether or not they look "maintainable."

    If the submitter did, he'd find that it's clear that maintaining Rails apps is no problem. You don't have to know much about a given app to even do serious "maintenance" on it. As long as the programmer hasn't tried really hard to break all the benefits Rails brings to the table (regular file structure, MVC separation, clean models, helper classes, etc), then you'll already know a lot about how the app is structured before you even unzip it.

    --
    ---- My Design, Code, Ruby on Rails blog: http://www.slash7.com/
  29. Coincidental naming by kabloom · · Score: 3, Interesting

    The problem that he's referring to in ruby is coincidental naming.

    I implement a function with a name "join" without knowing what the rest of the world uses it for. (e.g. my "join" joins a chatroom, but the standard use of "join" is to concatenate all of the objects in an array together into a string.) Suddenly my object looks like a duck, and quacks like a duck, but doesn't act like a duck. Ruby thinks it can be used in the same context that everything else uses it in, but semantically it can't be used there.

    Inheritance prevents conicidental naming problems by making the default assumption that two similarly named functions *don't* do the same thing, and can't be used in the same place. You override this assumption by indicating that the class inherits from a certain class (C++) or implements a certain interface (Java).

  30. Static vs Dynamically Typed maintainability by TheNarrator · · Score: 5, Insightful

    Ruby is not statically typed, which means that if you have a very large program and you change an API in that program you have to go and find all the instances of calls to that API in your program yourself, either through running automated tests or seeing the broken calls in the debug log of your application. Compiled langauges on the other hand such as Java,C,C++,C# have static calling conventions which means that when you break an api the compiler will point out all the broken calls to you and not let you run your program till you fix them all. This tends to make statically typed languages more maintainable. If you need to break out of static calling conventions you can in Java at least using introspection and bytecode enhancement but this is usually only done in well defined scenarios inside of application frameworks instead of for every class like in Ruby.

  31. generation gap pattern can add maintainability by zdburke · · Score: 2, Informative

    Vlissides' generation gap pattern can help solve a lot of the maintainability issues with code auto-generated from a DB's structure. The idea is that you use some tool to auto-generate stubs from your model, and then you extend (in the formal OO sense) those stubs. When your model changes, you can regenerate your stubs without trying to do some ugly merge between your customized templates and those that reflect the new structure.

  32. Doesn't work. by Medievalist · · Score: 3, Funny


    Sadly, the stupid are shameless.

  33. Automatic Code Generation sets off alarm bells? by meowsqueak · · Score: 3, Interesting

    I have no experience with Ruby or RoR but I am a software engineer like many people here and I would like to stick up for automatic code generation. Modern software is extremely complex and even when excellently designed and implemented by a skilled person or team it is still subject to faults. Automatic code generation, when done properly, is an excellent way to reduce the effort and risk associated with creating certain types of complex systems. A classic example is a parser - hand writing parsers can be done, of course, but they can be notoriously difficult to test and small grammar changes can upset the entire structure of the parser. In this situation, automatic code generation is not only useful, it's also safer and more reliable. If you have to change the grammar, you just reconstruct the parser code.

    A compiler is a form of automatic code generation - you don't compile your source by hand, usually, you let the compiler do it. The compiler becomes a cornerstone of your industry and is trusted perhaps far beyond what it really deserves. But the important thing is that it is hopefully consistent and can compile to a lower form much more accurately and faster than you or I or anyone can. You can make large scale higher-level changes without worrying too much about the effects of these at the lower level.

    Unfortunately all generalisations fail when you talk about specifics and the implications of this don't need stating, but I think it's unwise to say 'automatic code generation sets off alarm bells' when it is more accurate to think 'writing it manually should set off alarm bells' for many implementations.

  34. Generated Code? by misleb · · Score: 2, Interesting

    I started my first real Rails project with generated scaffolding, but after a few days there was almost nothing left of it. And I almost wish I had never generated the scaffolding because I had to spend time cleaning up tons of files and method stubs that I was never going to use.

    I do, however, use the basic "scripts/generate " scripts. They save me a minute or two of creating files and directories and class definitons. Handy, I suppose, but I am not sure if this is considered "generated code." The only "code" that Rails really generates for me is HTML and SQL (Tag Helpers and ActiveRecord) which is pretty nice, actually. The less HTML and SQL i have to write and more I can focus on the actual code, the better.

    Re: code generation replacing OO model:

    I have no idea what the OP is talking about. RoR is pure OO.

    Probably the only thing that I find a little frustrating about RoR is the shear volumn of files involved in a project. Navigating through them gets gradually more time consuming.

    -matthew

    --
    "THERE IS NO JUSTICE, THERE IS ONLY ME." -Death
  35. Usage of RoR by achacha · · Score: 4, Interesting

    RoR is pushing this whole codegen thing too much (I personally think codegen is the work of mediocre developers who have ego issues, but that's just me). I used RoR for about a day and wrote a little app then realized that maintenance is a pain and that I would have to manually change all the code anyways to make it behave as I want and that codegen created something I did not want. Then I weighed it against writing sevlets and JSP pages and RoR didn't look so appealing. Ruby is a nice scripting language but I didn't like the architecture of rails. Just not for me. Performance was quite bad too, about 6 times slower than JSP for fetching some data from a database, manipulating it (which is the bulk of the work) and displaying it (given JSP gens compiled into Java and takes advantage of JIT). Ruby is a nice language though, but it's not as useful as python. So I struggle to find a place where I can use it, maybe it can be nice as a simple embedded script language (similar to Lua).

    If asked what I would use to develop a server side app, I would have to look at volume and complexity then go in the order: C/C++ > servlets > JSP/PHP > RoR (from highest volumen/complexity to lowest). For high volume/complexity C/C++ is still the best efficient way to go but not for all, requires more work from the developers and not for average/weak developers. Servlets are a good next step if performance is not extremely important. JSP/PHP is a good way to run a site that doesn't have complex computation or one that is static content based (news, blog, forum, and such). RoR I would use for maybe some prototyping or to build a quick and dirty app to provide a simple view of the database (but even then I would probably lean to PHP). YMMV.

    1. Re:Usage of RoR by ogleslurp · · Score: 2, Informative
      I used RoR for about a day and wrote a little app then realized that maintenance is a pain and that I would have to manually change all the code anyways to make it behave as I want and that codegen created something I did not want. Then I weighed it against writing sevlets and JSP pages and RoR didn't look so appealing.
      I'm certain that this idea will be expressed elsewhere, but please note that the code that rails generates is only a skeleton that you can shape to suit your purposes. But which code generation feature did you use? I am honestly curious, because I can't really line up these comments with any of the code generation features in rails without making some pretty absurd assumptions.
      Performance was quite bad too, about 6 times slower than JSP for fetching some data from a database, manipulating it (which is the bulk of the work) and displaying it (given JSP gens compiled into Java and takes advantage of JIT).
      Probably you were using the webrick server in development mode. It's not really supposed to be fast, it's supposed to be simple and portable. If you spend some time looking around, you'll find many production configurations that will run as fast as you need them to.
      Ruby is a nice language though, but it's not as useful as python.
      This is just noise, honestly. Please explain!
  36. Code generation methodology by gfim · · Score: 4, Insightful

    Unfortunately, that's exactly what most Visual C++ programmers mean by code generation. The "wizard" generates a huge chunk of boilerplate code that the developer never understands. He would prefer not to even look at it, but occasionally has to make some minor tweak.

    When I use code generation, I generally write the generator too. As you say, there are two choices: you either generate the code once and then maintain it completely manually (i.e. it's just the scaffolding), or you maintain the generator and the input to the generator but never touch the output of the generator.

    Tools like Borland C++ Builder and Rational Rose try to give you the best of both worlds with the "round trip" code generation/reverse engineering. While they do have some advantages, in my opinion they aren't overly successful at it.

    --
    Graham
  37. Alternate Frameworks by hohonuuli · · Score: 2, Informative
    Rails has been getting a lot of Buzz lately but it's not the only RAD framework out there. Personally, I'm not a fan of Ruby so I'm not so keen to jump on to the 'Ruby Rocks' bandwagon. If you're using python you may want to check out the Python equivalents of 'Ruby on Rails'. Here's a few:
  38. The hard part is writing, not maintaining by Chief+Typist · · Score: 3, Informative

    I've been using Rails and Ruby for the past few months -- I had no prior experience with either.

    The thing that has become clear to me is that the hard part of Rails is learning *how to do it right*

    The "automatic code generation" (scaffolding) is helpful for learning *how to do it right* but as you get deeper into the framework, you find yourself coming up against difficult and/or domain specific problems. In all cases I've encountered so far, there are simple solutions to these problems -- the hard part was finding the right way to solve the problem.

    You have to take the time to read the documentation, dig through the source code, think about design patterns, and write elegant Ruby code.

    Often, this code is only a few lines long. For example, I had an issue with SQL statements including NULL values when I wanted to pick up a default from the table schema. The solution was a single line of code to remove the named attribute from an array in a Model subclass. It took a few hours of research & prototyping to figure out that one line of code.

    So as far as maintainability is concerned, I'd say it's pretty good. That one line of code mentioned above is easy to understand for someone doing maintenance. Less is more.

    One final observation that I've made regarding Rails and Ruby -- it's a lot like Cocoa and Objective-C (another excellent framework backed by a dynamic language.) When you find yourself writing a lot of code, it's a good sign that you are doing things wrong.

    -ch

  39. RoR is maintainable enough -- but... by oldCoder · · Score: 5, Informative
    But the programmers API isn't nicely documented in RoR, although there is a web page that claims to do that. For example, to search the RoR API web page you have to use google. Half the time I come up with a blank document. That is, the entry for the function I want is a blank page, and there is no context (no "up" button) so I can't use it as a starting place for more navigation.

    The result of the somewhat sloppy documentation is that if I find a function that does something (like by looking at the source) I don't know if it is guaranteed to be there next release. The existing book ("Agile web programming...") is too chatty and not complete and accurate like a reference manual would be.

    So I'm somewhat blindly following the examples and when something doesn't work I have to backtrack. Still, all in all, I like it. I need the speed.

    And, like a lot of people, I found I had to go back and study Ruby a few times. The existing Ruby docs are great.

    But I desperately want a good Rails reference manual.

    --

    I18N == Intergalacticization
  40. Common Misconception by l00k · · Score: 4, Insightful
    The idea that developing in Rails is 'code generation' is a common misconception amongst /.ers - in fact the last time a Rails article was posted sometime last week I had to do battle with a number of people that thought this.

    I hope that the number of highly-modded responses which have had the chance to clarify what code generation is in Rails, and what its purposes are within the development cycle, will allay some of the FUD. When I began learning Rails I was under no impression that code would be generated beyond the scaffold, and that the scaffold was only there to get some meaningful database interaction happening right away. This tutorial which I began learning Rails from explained it clearly:

    Of course, these actions and views are very plain--not the sort of thing you'd want users to see (unless they are total geeks). The good news is that we can leave the scaffolding in place and slowly, one at a time, provide our own versions of the actions and views. Each time you create one of the actions or views it will override the scaffold's version. When you're done, simply remove the scaffold statement from the controller.

    The way I imagine the misinformation formed is from certain people hearing the sentiment of "faster development in Rails" and jumping to the conclusion that there must be some sort of cheat involved. Watching the video demos probably fueled this, as the demos are showing Rails off, and the scaffolding is a selling point.

  41. Re:Agreed. And, Python equivalent of RoR by Beek · · Score: 2, Informative

    > In the end, Ruby is just a MVC and ORM web framework, along with a little bit of code generation to get you started.

    Don't forget about testing... The testing framework is probably the best part of the framework, and not enough people are talking about it.

    But int the end, Rails is more than just MVC + ORM + Code Generation + Testing. Rails is greater than the sum of its parts. Having all of those thing in one cohesive framework is much better than cobbling together a stack of tools to do the same thing.

  42. final void superClassMethod() {} //WO > RoR? by MacDork · · Score: 2, Insightful
    And if in, say, Java, how do you know the subclass didn't override superclass methods to do totally different things!

    Well, if you make a method final in Java, the compiler generates an error when you try to compile an overridden subclass method. That's one way to take care of the problem :-) Perhaps Ruby has something similar...?

    RoR, codegen.. from what I gather, there's nothing there that wasn't done years ago. It's called WebObjects. So far, no one has mentioned to me or pointed out anything RoR does in Ruby that WebObjects doesn't do already in Java. Meanwhile you loose the advantage of TONS of mature libraries written in Java. Am I missing something? Is there something particularly compelling about Ruby perhaps? I'm not trying to be condescending toward RoR or anything, but all the 'hype' I've read here about RoR was done a decade ago with WO. Plus, WO does a number of things that I haven't heard the RoR camp boasting, like deploying database connected apps over the internet directly to the desktop with WebStart/D2JC.

    Anyone care to enlighten me?

  43. Re:you reveal your ignorance with your poor exampl by Sircus · · Score: 2, Interesting

    I'm not saying the other guy's right, but, er, you're revealing your ignorance a bit. ...it's java.lang.String...it can dynamically grow and shrink.

    No it can't, it's immutable. Strings can only create new objects which have grown or shrunk. Admittedly, the optimised implementation uses the same backing array for the new String, but it's still a new String. A StringBuffer (which in my books is another string class) can dynamically grow and shrink. In 5.0/1.5 there's now also StringBuilder.

    --
    PenguiNet: the (shareware) Windows SSH client