Slashdot Mirror


Ruby On Rails Showdown with Java Spring/Hibernate

Paradox writes "Java developer Justin Gehtland recently tried re-implementing one of his web applications in Ruby on Rails instead of his normal Java Spring/Hibernate setup. His analysis of overall performance and application size was startling, to say the least. The Java app's configuration alone was nearly the size of the entire Rails codebase, and Rails application was significantly (15%-30%) faster! At the same time, the Ruby community is abuzz because Ruby is getting a new optimized bytecode compiler for its upcoming 2.0 release. Will Ruby on Rails become even faster as a result?"

116 of 555 comments (clear)

  1. Faster? by Cruithne · · Score: 5, Funny

    ...Ruby is getting a new optimized bytecode compiler for its upcoming 2.0 release. Will Ruby on Rails become even faster as a result?

    I would assume so, doesn't optimized usually mean faster?

    1. Re:Faster? by Anonymous Coward · · Score: 5, Insightful

      theres a difference between compiling faster and running faster. If the "optimized" compiler merely spits out the same bytecode at a faster rate, applications will start faster and any JIT compilation done will be faster, but a continuously running application will eventually operate at the same speed as before. If it spits out "better" bytecode, then we'll see speed increases.

    2. Re:Faster? by sporty · · Score: 4, Insightful

      Optimized means that it's doing something better. Smaller binaries? Less memory when running? Faster execution? Faster to compile? In the context of the article, you can assume it's about speed. But out of context, you cannot.

      --

      -
      ping -f 255.255.255.255 # if only

    3. Re:Faster? by rbarreira · · Score: 4, Insightful

      Yeah, an optimized compiler isn't the same thing as an optimizing compiler...

      --

      The AACS key is NOT 0xF606EEFD628B1CA427BEA93A9CA9773F
    4. Re:Faster? by ajs · · Score: 5, Informative

      When we say "optimized bytecode compiler" these days, we generally mean that it does JIT. I know, I know, it's bad use of the terminology, but generally that's what people mean.

      Ruby has one other massive advantage over Java on the medium-term horizon: Parrot. The Ruby-on-Parrot effort is progressing nicely, and when that is complete, Ponie will give Ruby transparent access to all of CPAN (thought yet another JITted bytecode system) even for those who don't like or can't use Perl.

      At that point, Ruby becomes (IMHO) the most attractive HLL in existance (until Perl 6 lands... IF Perl 6 lands...)

    5. Re:Faster? by As+Seen+On+TV · · Score: 2, Funny

      Nobody told me there would be sentence diagramming.

    6. Re:Faster? by Karma+Sucks · · Score: 2, Interesting

      CPAN modules are never going to fit into the Ruby way of doing things, Parrot or not, unless I'm missing something?

      There are multiple sources for Ruby modules, as I'm sure you already know. So far they've worked out quite well for me.

      I agree that RubyGems is quite brain-damaged.

      --
      (Please browse at -1 to read this comment.)
    7. Re:Faster? by hawk · · Score: 3, Funny

      >Ruby has one other massive advantage over Java on the medium-term horizon: Parrot.

      You're just repeating what they told you, aren't you?

      :)

      hawk

  2. Obligatory by Anonymous Coward · · Score: 5, Funny

    doesn't optimized usually mean faster?

    I'd give you an answer, but I haven't been able to fully test out my optimized Gentoo box yet -- it's still compiling.

  3. Re:Here we go again by Anonymous Coward · · Score: 5, Funny

    Just watch, it's impossible to have an intelligent discussion between the two groups.

    Is that so, Mr. Poopyhead?

  4. Not fast enough for Slashdot... by ChrisKnight · · Score: 4, Funny

    Fifteen to thirty percent faster, and still crushed under the load of Slashdot.

    --
    -- This sig is only a test. If this were a real sig it would say something witty. --
  5. Not a safe or true assumption by Pac · · Score: 3, Insightful

    It all depends on what you are optimizing for - you can optimize for size, for instance (smaller but slower applications). You can optimize for portability and end up with code that is both slower and larger (but more portable). You can optimize for almost anything you need. Speed is one factor only.

    Anyway, in this particular case you may be right.

  6. Ruby on rails performance by Anonymous Coward · · Score: 2, Funny


    Beating Java's performance and garrulous xml-based configuration is like shooting dead fish in a barrel.

    1. Re:Ruby on rails performance by adavidm · · Score: 2, Funny

      ....with an elephant gun

    2. Re:Ruby on rails performance by sbrown123 · · Score: 4, Interesting

      I was able to read the site but unable to post comments back to the author. I'll drop them here instead to follow up on my prior posting comments:

      -----

      A few problems with your testing that I could see:

      "So, for the sake of total specificity, the following numbers were generated on a 1.5GhZ Mac OSX (10.3.7) PowerBook with a 4200rpm hard drive and 1GB of RAM."

      The Java Virtual Machine running on Macs has always been questionable. Its not Sun's implementation and has not been as heavily updated by Apple. First I would start by running your tests on a Windows or Linux box using the Sun JRE 1.5.

      "The Java app is running on Jakarta Tomcat v 5.0.28, while the Rails app is running in Lighttp with FastCGI. The setups are standard for each application stack."

      As mentioned by a prior poster, Tomcat is only a reference implementation. Its not built for speed. The Ruby setup you used, on the other hand, is. This alone is a major oversight in your testing.

      "Number of Methods:
      Rails: 126
      Java: 549"

      Having to write 4 times as many methods is a clear indicator that you are using the wrong framworks to get the job done. There are hundreds of frameworks for building web applications between the languages. Spring with Hibernate must not be the right mix.

      "Configuration Lines
      Rails: 113
      Java: 1161"

      I am guessing you used Xerces for parsing on the Java side. This is bad since Xerces is not a very quick parser and there are plenty of Java XML parsers that are much better suited when speed is concerned. Look at using XPP or Lightning instead. With JAXP (if Hibernate and Spring support it) you will not have to change code to use these in place of Xerces. Also, any time you are comparing a XML parsed document versus and non-XML parsed document the latter will always win. Try using frameworks that do not depend on XML configuration files.

      True language performance comparisons should never be done with web applications. There are simply too many variables. I know this was not your intent (doing language performance comparisons), but that is how your article is being viewed by others. People are always itching for a battle between the languages.

      Different languages are suited for different tasks better than others. For example, I once had to translate a Perl application to Java for my work. Due to what that Perl code was doing, the finished Java application was several times larger and slower. Perl was better due to the task at hand.

    3. Re:Ruby on rails performance by mccoma · · Score: 2, Informative
      The Java Virtual Machine running on Macs has always been questionable. Its not Sun's implementation and has not been as heavily updated by Apple.

      OS X uses Sun's JVM code which is tuned by Apple with some of the tuning being returned to Sun. Perhaps your thinking of the OS 9 JVM?

  7. Development Resources? by Pants75 · · Score: 3, Insightful
    Code base size and speed aside.

    How much time did it take to develop the site compared to Java?

    I ask here because the site is dead, Ruby isn't a magic hammer after all.

    Pete

    1. Re:Development Resources? by Paradox · · Score: 3, Informative

      The blog is not a ruby-on-rails application.

      --
      Slashdot. It's Not For Common Sense
  8. You are all wrong by Anonymous Coward · · Score: 5, Insightful

    There have been many posts concerning the speed of each and every possible language. Some have gone as far as to link to several studies with nice charts and graphs to conclude that X language is faster or X1 is truly the fastest. You are all wrong.

    A laguage, in of itself, cannot be measured by speed. A language is merely a group lexical elements with a particular syntax. That syntax has an associated semantics to it. That is it! It is pointless to compare languages purely on speed.

    Now, what we can compare is the implementation of a particular language. For example, we can compare the speed differences between the intel compiler and gcc for the same piece of C code. We might find that in most cases, gcc is slower that the intel compiler. Does this mean that C is slow? No! Now, take the same algorithm and port it to Java. Lets imagine that the Java version was 10x faster. Does this mean Java is inherently faster langauge? NO! It means that the compiler, JIT, and HotSpot implementations are better at tranlating Java source code down to the machine level.

    So, in summary, a language by itself should NOT be measure in speed. It should be measured by the following:

    Maintainability
    Ease of Use
    Learning Curve
    Clear Semantics
    Support
    Documentation
    Standard APIs

    Most often, when languages are compared, you are merely comparing the differences in constants in a language! Lets say we implement the Quick Sort Algorithm in C++ and Python. We will probably find that the C++ version is slightly faster. What does this mean? It means the the implementation of C++ generates fewer constants that the Python Implementation. So, the Python version may be slower, but it is only in constant O(1) differences and in most cases this does not matter! Eliminating extra constants ( in any language ) is stupid when you have chosen the wrong algorithm in the first place! ( such as an order n^3 when it could have been n*log(n) ).

    So, what is the moral of this story? Pick the right langauge for the right job. It you are doing advanced GUI development and prototyping, C++ is probably not the way to go ( since it is harder to write fast and correctly ). However, it you are doing low-level real-time I/O where constants do matter, then C/ASM is probably the way to go. After you have chosen he right language for your task, you must choose the right algorithm! Algorithms are the key! Algorithms are the only true way to measure the efficiency on any program in terms of memory and speed.

    1. Re:You are all wrong by lbmouse · · Score: 4, Insightful

      Add one more to your list: General Acceptance.

      If you're the only one using a language, it can get pretty lonely. Plus, managers like technology that is generally popular in case you get hit by a bus.

    2. Re:You are all wrong by ajs · · Score: 5, Insightful

      "A laguage, in of itself, cannot be measured by speed."

      Not so.

      There are purely functional languages that are -- for all practical purposes -- impossible to optimize as well as either procedural or hybrid procedural/functional languages.

      However, that's beside the point. Java in particular is NOT just a language. Java is a specification for a fair amount of the IMPLEMENTATION as well. Java specifies the behavior of GC, type storage, and many other implementation details ot a level that precludes many hardware or OS specific optimizations.

      There are non-conforming compilers that ignore these strictures (and get excellent performance), but they are not -- strictly speaking -- compiling Java.

      Languages like Ruby, Python, Perl and PHP on the other hand, make no such strict demands, and thus can be optimized appropriately for the platform.

    3. Re:You are all wrong by skubeedooo · · Score: 2, Insightful
      However, it [sic] you are doing low-level real-time I/O where constants do matter, then C/ASM is probably the way to go.

      So, as you imply yourself, a language can be measured by speed.

      Most programmers would say that assembler loses out in each of your above criteria, yet it is still used for certain tasks. Why? Because it is quicker.

      I agree overall with what you are saying, but the world isn't quite as simple as you make out.

    4. Re:You are all wrong by northcat · · Score: 2, Insightful

      Did you even read the summary? We are talking about two implementations of two applications, not the very syntax of the languages themselves. Yeah, we all know that a language by itself can't be fast or slow blah blah blah. Whenever we're having a practical discussion about a "language", we're talking about the syntax *and* the general qualities of its implementations - in this case there is only one significat implementation of each. This one summary itself would take the entire slashdot frontpage if we had to mention every particular detail like this. BTW, when people say "java is slow" they mean the most significant implementation of java is slow. They're just trying to be concise, practical and to the point.

    5. Re:You are all wrong by yasth · · Score: 2, Insightful

      A lookup is still constant(ish) time. Would I use python to implement an OS? Probably not, but it will scale pretty much the same as anything else. And CPU speed is often in surplus.

      C++ is not even a tool option for a wide variety of embedded architectures. Existence is a very big benefit.

      --
      I'd do something interesting, but my server can't handle a slashdotting.
    6. Re:You are all wrong by ReelOddeeo · · Score: 2, Insightful

      C has NO benefits over C++

      I am not an advocate of either C or C++, especially for just about every type of software that runs in userspace.

      That said...

      Even I, the non C advocate, recognize an advantage of C over C++. In C you can "see" every single clock cycle in your program. If you pass a pointer into a function, then inside that function, you can "see" the dereferences. Every single operation that costs cpu time is vislble as some kind of operation / operator in C. No hidden array bounds checking. If you check array bounds (yourself), you can see it happening. Absolutely every single clock cycle exposed in the source code for everyone to see.

      Therefore, and also because of the portability of C compilers, C is a great high level and portable "assembly language".

      As an "assembly language" it can be targeted as output of other compilers. Imagine the portability of huge mountains of software if only a simple C compiler has to be ported to a new processor architecture in order to initially get a bunch of stuff working. Remember that TinyC compiler that could recompile the entire Linux kernel as part of the boot process, in only about 15 seconds?

      --

      Those who would give up liberty in exchange for security and DRM should switch to Microsoft Palladium!
    7. Re:You are all wrong by kubalaa · · Score: 2, Interesting

      FYI: the higher level a language is, the *more* possible it is to optimize in general (though the optimizations may be difficult). It is languages like C that are "impossible to optimize", since they way overspecify, for example, the order-of-execution, and force optimizers to bend over backwards preserving semantics that the programmer doesn't even care about.

      --

      "If you look 'round the table and can't tell who the sucker is, it's you." -- Quiz Show

    8. Re:You are all wrong by ajs · · Score: 2, Insightful

      "What a bunch of crap."

      You're being abusive. This will be my last attempt to communicate with you in this thread. Clearly, you're not interested in the topic so much as ... actually, I'm not clear what it is that you're trying to accomplish.

      "You don't know what you're talking about."

      Last refuge....

      "Functional languages are *easier* to optimize, not harder."

      You're confusing terms here.

      First off, you're obviously correct. A purely functional language is much easier to optimize than a non-functional language.

      Of course.

      Now please go back and read what I wrote. I was speaking of the end result: execution time (presumably on modern hardware). I'm going to repeat myself at the end of this message for the third and final time. If you still have trouble understanding the difference between what you're saying and what I'm saying, then I'm afraid I can't help you.

      It's very easy to perform many sorts of near-optimal transformations on a functional program, and while there's deminishing returns here, there are in ALL programming languages (perfect transformation of a grammar into its optimal form, is of course, known to be a hard problem, but that's not dependant on the language in question).

      Now we get into that ugly bit: when you take your code and plunk it down on modern hardware, you find that your program performs poorly! This is because modern hardware is fundamentally NOT functional in nature. In fact, it's quite assertively operational!

      So now you have to take your near-perfectly optimized functional specification for a program and transform it into an operational instruction set. There are, of course, many ways to do this, and it turns out that finding the optimal one is actually much harder than having performed simple functional transformations on your code in the first place.

      There are other reasons that MOST functional programming languages cannot reasonably be optimized down to code that out-performs, say C, but they're all a matter of choosing to be a high-level language, and other high-level languages suffer the same problems regardless of how functional or procedural / operational (e.g. in a language with dynamic types).

      There, I've repeated myself. I hope this helps.

      If you consider anything in this message to be other than well-established fact at this point, then please provide a compiler which compiles ANY functional language down to machine code such that compile time plus execution time is less than or equal to that for the equivalent C program and gcc with normal (-O2) optimization.

      If you're still confused as to how any of this could be possible, sit down and write a translator between your favorite functional language and C. That should explain a lot.

  9. Article Text by Anonymous Coward · · Score: 5, Informative

    Article text in full, copied directly from Justin's blog:

    So, a few weeks ago I made an offhanded post here about my new-found love for Rails. I'd been skipping off the surface of Ruby for a while, trying to decide if it, or Python, or Groovy, or something else, ought to fill out the empty slot in my tool belt. (I'll save the "why LISP isn't on this list" post for another time.) Rails seemed like an excellent way to put Ruby through a workout, and I had the right sized project to try it out with.

    The project itself is not open-source; the client is now and shall remain anonymous. But they are paying me my going rate to do this work, which makes it a commercial Rails project, and it will in the future be installed into some rather large organizations. I can't really say much about what the application's domain is, but I can lay out the general principles of the app.

    The application must support multiple users, in the order of 10-100 concurrently. The load isn't particularly high, but the application will be treated like a desktop app (more specifically, a spreadsheet replacement) so it has to be responsive. The application is for managing pieces of a large machine process. There are lots of types of components to be managed, and the relationships between them can be quite complicated. There are no one-to-one relationships in the model, but plenty of one-to-many and many-to-many. In addition to managing the components, the application has to allow for the addition of entirely new categories of components as well as a variety of customizable fields. Finally, the authorization rules call for a breadth of user roles with a complex mapping of permissions to those roles.

    I've finally gotten around to running the profiling numbers and doing some comparison between the two systems. I won't spoil the suspense by listing my conclusions up front -- you'll have to scroll through the rest of the post to see them. But, first, let me set the stage: the original application is based on the Java/JSTL/Spring/Hibernate/MySQL stack. I used ACEGI for the security, SpringMVC for the web controller, and was using Hibernate 2.x for the O/RM. To increase performance, I was using the default output caching from SpringMVC and data caching in Hibernate. The re-implementation is in Rails on top of MySQL. The authorization is done through a custom observer and a custom authorization class, which uses a declarative rules file for permission mapping. For performance, I'm using a combination of page caching, action caching, and cache sweepers (observers whose job it is to expire cached pages).

    Now, for the comparisons:

    Time to Implement
    I made a comment about this in the previous posts on the topic, and that comment has been quoted widely out in the wide blogosphere as a classic example of Rails hype. So, let me make it plain: any time you re-write an application, it will go almost infinitely faster because you already have a firm grasp on the problem domain. Such was the case for me in my re-write; we'd spent so much time on the domain model and the database schema that the second time through the application, everything already made perfect sense to me. Any comparison of how long it took to implement one or the other is bogus, since the only fair comparison would be to implement two roughly functionally equivalent projects in the two different stacks and measure the competitive results. Since I have not done that, making statements about how it only took 5 days to re-implement the site are almost meaningless. What I can say is that I had more fun implementing it the second time, but that's just personal preference.

    Lines of Code
    This one is a lot more interesting. Folks will tell you all the time that there is a running debate about the meaningfulness of LOC comparisons. They're right; there is a running debate. I just think it's moot. For my money, the fewer lines of code I have to write to get a piece of functionality, *as long as those lines are clear in meaning*

  10. Mirror by blackmonday · · Score: 4, Informative
  11. I couldn't agree more by Weaselmancer · · Score: 4, Informative

    Language is merely description, implementation is what you can benchmark.

    And I also have to say, what we've got here is the single most intelligent AC post in the entire history of Slashdot.

    --
    Weaselmancer
    rediculous.
  12. Re:any comparison like this... by killjoe · · Score: 3, Interesting

    I think the crux of the matter is that he was not taking advantage of some of what these java containers offer. Things like queues, soap, RMI, CORBA bindings, remote invocations etc.

    The lesson here I think is that unless you plan on running on multiple containers and using asyncronous calls java is overkill.

    If you do need those things then ROR won't work at all.

    Another thing is that ROR wants you to design the database from scratch to fit it's naming rules. It's not really designed to work with existing databases. For example it can't map the ugly database field names into nice attribute names for your objects. To me that's a pretty big shortcoming.

    --
    evil is as evil does
  13. First Post! by lexbaby · · Score: 5, Funny

    First post!

    --
    Posted Via JFPB - Java First Post Bot

    --
    lexbaby
    "Be Brave, Be Loyal, Be True." -- Hawkeye Pierce
  14. Application by Tobias+Luetke · · Score: 4, Insightful

    Speed is a stupid mesure for web apps. There is nothing easier to scale then webapps in the world. You can cope with any amount of traffic by just throwing more hardware on the problem in a share nothing environment like php, perl or ruby/rails.

    Whats interesting is the development speed and thats what the comparison between the java and the rails version highlighted well. For a great analysis look here: weblog

    What makes the above link so special are the comments from the java community saying that the two examples are not functionally equivalent. This is really golden because they are really not. The rails version ( which is 3 lines of code ) does everything the java code does plus tons and tons of more things just by taking educated guesses after looking at the SQL schema.

    Rails is a remarkable framework and a glimps of what programming will be like in the future. Yarv will just save some hardware costs

    --
    First they ignore you, then they laugh at you, then they fight you, then you win. -- Gandhi

    1. Re:Application by Politburo · · Score: 3, Informative

      Whats interesting is the development speed and thats what the comparison between the java and the rails version highlighted well.

      No, the comparison did not highlight this. The development speed was not comparable because when the app was written in Ruby, it was not the first time the app was written. As such, many development problems had already been resolved. This is noted by the author in the post.

    2. Re:Application by gbevin · · Score: 2, Informative

      Except that they were not written by the same people, so they both had to do the same effort of analysing the application. Also the features are quite different, for instance:

      1. Bla-bla List has a complete REST API that sits in the middle of the GUI and the actual web application.
      2. you can continue editing even if your session times out
      3. private sharing is done securely
      4. public lists have meaningful URLs

      So there's a lot more to compare than just a screenshot that doesn't do anything constructive and just tries to hype a concise part of the RoR version.

      The fact that Ta-da took 600 loc and Bla-bla 900 seems to be totally ignored by Rails advocates and they all keep chanting 'that screenshot says it all'. No it doesn't, since the loc factor is 2/3, not 1/14. Ta-da is probably just more verbose elsewhere, but that's impossible to compare since it's not open-source.

      --
      Geert Bevin
    3. Re:Application by Da+Fokka · · Score: 4, Funny

      There is nothing easier to scale then webapps in the world.
      Yes there is. Writing shakespeare. Just add more monkeys and more typewriters.

  15. Re:any comparison like this... by LnxAddct · · Score: 4, Insightful

    In addition to that, how well does the ruby implementation scale? My understanding is that a good J2EE implementation is capable of scaling to thousands of clients (one article I read claimed a 250,000 client load), the ruby implementation might start crawling after as little as 50 clients. Turning up a page 125ms faster is more or less meaningless when you can't reach most of your potential customers, and more importantly, after a few start visiting it gets slower and slower. So I'm curious to see what kind of extensive laod testing he did for both implementations. Other important things to consider are how complex his needs are compared to an enterprise and how extensible both implementations are. How exactly did this Joe Schmoe get on the front page of slashdot?
    Regards,
    Steve

  16. No need to be pedantic by jfengel · · Score: 4, Informative

    This is all true, but as software developers we tend to use the word "language" loosely to mean, "The syntax, the compiler, the libraries, and the execution environment." So while a language can't be inherently faster than another, some languages have highly efficient, readily available implementations, and others don't.

    That's a matter only of constant speedup, assuming that the implementation is competent, and therefore theoretically swamped by the complexity of the algorithm. But if you've implemented the same algorithm using both systems, a constant speedup of 10 is an order-of-magnitude speed improvement. Even with the really, really fast computers we use today that makes a difference to a lot of applications. (And I've used plenty of languages where could get a 10x improvement by switching to a better language.)

    In this case there isn't even a single Java environment; there are numerous JVMs out there and I hope they tested several of them before writing the article. (I doubt it, but that's a whole different story.) You're probably not going to get a 10x difference, but 2x wouldn't be uncommon for certain applications.

    So you're using the terminology correctly and everybody else is using it wrong. They should talk about the "Java system" or "Java environment" rather than Java language. But I think nearly everybody reading the article knew what was meant.

    1. Re:No need to be pedantic by iwadasn · · Score: 3, Informative

      I would like to point out that the non GUI elements of the OS X JVM are about the worst around in terms of performance. It seems very clear that apple (first and foremost) wanted a JVM that worked and had native windowing, and didn't really worry about performance. There isn't even a -server VM in OS X, and using -server for server applications makes a HUGE difference in performance. I think running it on a modern Linux VM (1.4.x or 1.5.0) using -server would have almost doubled the performance. I am also an OS X user, but I've timed things running on OS X, and java has always been slow for the hardware available.

      It is possible that 10.4 will finally change this and really make OS X a first class java citizen, we'll see. Hopefully the better compilation from gcc 4 and 64 bit everything will help substantially. Good vectorization, and an auto-vectorizing bytecode compilier would go a long way towards fixing this embarassing little weakness. Also, including a -server VM wouldn't hurt either, if Apple wants their computers to be taken seriously in the Datacenter (Xserves).

  17. Re:any comparison like this... by Paradox · · Score: 5, Insightful

    Justin is a respected and skilled Java developer who's got a Developer's Notebook for Spring set to hit the shelves any day now.

    The app he wrote was quite complicated, and he freely admits that Rails got some free jump-starting because of his understanding of the domain. But you're going too far in saying he'd get a 50% speedup from a rewrite. His Java codebase needs work, but not that much work.

    He observed that the more complex the action, the faster RoR ran compared to Java. This is very counter-intuitive, so he went into an explanation of why.

    --
    Slashdot. It's Not For Common Sense
  18. Re:any comparison like this... by Minute+Work · · Score: 2, Funny

    ...without reading TFA, any comment of this sort does not have much value. Maybe if he re-read the article his comment would get a %50 improvement? Maybe his original thoughts were poorly conceived/whatever? This comment MAY be insightful but any comment like this is hardly valuable, that's why I would not even bother to RTFP

  19. Line counts, method counts.. all lies. by ahmetaa · · Score: 2, Insightful

    Oh please.. Author talks aout line counts and method numbers.. You count getter setter methods? you count the lines for {} symbols and getter-setters? You know that they can be produced lets say in 3 seconds with any modern Java IDE.. it has no meaning what so ever to put them into consideration in terms of productivity.. sigh.

    1. Re:Line counts, method counts.. all lies. by CatGrep · · Score: 5, Interesting

      You count getter setter methods? You know that they can be produced lets say in 3 seconds with any modern Java IDE..

      Good point about the getter/setter methods. To which I reply: You know they can be generated for you if you use a modern language like Ruby.

      class Foo
      attr_accessor :bar, :baz, :foo
      end

      Now the class Foo has accessor methods (getter and setter) for the instance vars bar, baz and foo.
      A total of six methods were created from that one line of code. No need for a 'modern Java IDE' - vi or emacs work fine. You want read-only access? Use attr_reader then only the getter methods will be created.

      This is probably why the method count for Ruby in the article was significantly less than for the Java version.

  20. Horses for courses by 16K+Ram+Pack · · Score: 3, Interesting
    From what I've seen so far (trying it out), RoR has its place.

    It's a little bit like using something like MS Access. If you play along with MS Access, and don't try and do things that it doesn't do particularly well, then you can actually build desktop database systems very quickly. If you try and go outside of the "Access way", it becomes a quagmire.

    There are tens of thousands of sites out there that don't need to have queues, SOAP, RMI etc. They might be someone's list of restaurant reviews or something. Maybe RoR has a good place for that.

  21. Mojavi by joelhayhurst · · Score: 4, Informative

    Slightly off topic, but thought some might be interested.

    There is a pretty cool and full featured MVC framework for PHP called Mojavi. If you like PHP and think Ruby on Rails or any other MVC framework is what you're into, you might want to check it out.

    1. Re:Mojavi by MAdMaxOr · · Score: 3, Interesting

      I tried Mojavi, and I liked it. However, it's not nearly as compelling as RoR, mostly because it's missing the *magic*. Mojavi is condensed best practices for PHP, and RoR is new, and borderline voodoo.

    2. Re:Mojavi by CatGrep · · Score: 2, Interesting

      RoR has given PHP a run for it's money.

      PHP is now very tired after that race. Please let it lie down and rest.

  22. Ruby marketing vs Cherrypy by alex789 · · Score: 2, Insightful

    15% - 30% faster! Wow. I hope anyone who ever developed anything for java is reading this so that they can start reimplementing all their code right away.

    Another showdown I'd like to read about is that between Rails and Cherrypy. Not in terms of technological superiority, but in terms of marketing skill. Why is the web abuzz with Rails, while Cherrypy is almost unknown.

    This isn't flamebait. I'd really want to know how they did it.

    --
    http://flosspick.org finding the right open sour
  23. Damn stupid summary format by Anonymous Coward · · Score: 3, Insightful
    Why do most of the article submitters have to end their summaries with a moronic or otherwise obvious or thought un-provoking question?

    Does this mean the code will be faster?

    What does the Slashdot community think about that?

    Is this the end of free software?

    This whole damn site is a discussion site. What does "What do slasdotters think about this?" add? Especially bad is the monthly article on total cost of ownership or the invalidity of the GPL ending with the "Is this end of FOSS?"

  24. Hibernate too hyped by Espectr0 · · Score: 4, Insightful

    Hibernate seems to be the most hyped technology for webapps on java right now. I evaluated it to use it on my thesis.

    I don't trust/want something to auto generate my sql tables and such based on my objects. That leads to problems, since the queries can't be tuned or maybe you don't get what you expect.

    So, i am using SqlMaps. You put your sql queries in a separate .xml file and use them with very few lines of code. It maps the results of the queries to your javabeans. Really simple, but powerful, there's a whole way of doing dynamic queries (i.e, if some object exists, do something with it, else don't)

    Disclaimer: i don't have any relationship with sqlmaps, i am just a happy user.

    1. Re:Hibernate too hyped by Anonymous Coward · · Score: 3, Informative

      I use both iBatis sqlmaps and Hibernate in my projects. iBatis is great for interfacing with our legacy database. Porting old SQL queries from our legacy software to Java middleware is a snap. It is excellent software no doubt, but it doesn't have the advanced ORM features that Hibernate has. Though it is much easier to use.

      We are using Hibernate in our new software. Hibernate has excellent SQL generation. Since it has its own abstraction from SQL, it can do things to optimize your queries in ways you can't really do yourself without considerable effort. Also, I believe Hibernate 3.0 has an equivalent to iBatis (being able to map straight SQL without abstraction), but I haven't tried it yet.

      I don't trust/want something to auto generate my sql tables and such based on my objects.

      You don't have to auto generate your SQL tables in Hibernate. Create your SQL tables first, and either auto-generate your mappings from the tables (using Middlegen), or hand code them. Or did you mean queries not tables?

    2. Re:Hibernate too hyped by fishbowl · · Score: 2, Interesting


      >Hibernate seems to be the most hyped technology for
      >webapps on java right now.

      I use Hibernate for databinding in production systems with thousands of users. I don't think of anything as "hype" when it works. Hibernate is very good at what it does, although it is a little tricky to learn how to use it effectively.

      As to the comparison of configuration lines, you have a huge amount of power in Java config, and the tradeoff for that, of course, is a little complexity.

      --
      -fb Everything not expressly forbidden is now mandatory.
    3. Re:Hibernate too hyped by scottsevertson · · Score: 2, Informative

      iBATIS SqlMaps is my persistance *assistance* technology of choice, and have been for two years.



      Notice *assistance* - it is not *meant* to compete with ORM solutions like Hibernate, which is why I use it. Ted Neward expresses it best: "Object-relational mapping is the Vietnam of Computer Science"

      My take? Relational databases are procedural in nature, not object-oriented. Get over it, and stop trying to pretened otherwise! iBATIS SqlMaps makes writing relational database "method calls" very easy, and stays mostly out of the way.
      --


      Scott Severtson
      Senior Architect, Digital Measures
    4. Re:Hibernate too hyped by ux500 · · Score: 3, Insightful

      I don't trust/want something to auto generate my sql tables and such based on my objects. That leads to problems, since the queries can't be tuned or maybe you don't get what you expect.

      And what does this have to do with Hibernate? Last I checked it doesn't generate SQL schemas for you (although you can get an add on to do it if you want.)

      Also, you can tell it the exact SQL expression to use if you find that its not doing something right or you need to "tune" it. Of all the times I've used Hibernate ojects, I've never had to do this.

    5. Re:Hibernate too hyped by dubl-u · · Score: 4, Insightful

      I don't trust/want something to auto generate my sql tables and such based on my objects. That leads to problems, since the queries can't be tuned or maybe you don't get what you expect. So, i am using SqlMaps.

      Perhaps you should try actually using Hibernate.

      First, Hibernate works just fine with hand-generated SQL tables. Indeed, that's the only thing I've ever used it for. Second, you can happily tune your queries through hinting to Hibernate and careful choices of object relationshiops, and the recently released Hibernate 3 allows to you hand-write all the SQL if you choose.

      Third, you're kinda missing the point of Hibernate. Using Hibernate akin to using Java itself in that both of them hide a lot of details about the underlying operations so that the programmer can spend their time and energy focusing on the essential problems rather than the details of the technology.

      Most programmers doing SQL stuff in Java let the weirdness of SQL databases distort their designs heavily. They don't really do OO programming because they spend all their time thinking about database operations. Hibernate lets you do good OO design and have 95% of the SQL rituals handled under the hood.

      It's possible that you lose some performance to Hibernate, although I never noticed it, and Hibernate's built-in caching means that many apps will be faster. But really, if performance is all that important to you, you shouldn't be using a database at all. Serializing all your data every time you need to work with it is incredibly expensive. There's a reason that things like Google and Quake aren't built on top of SQL databases.

  25. Re:Here we go again by TrekCycling · · Score: 4, Interesting

    Are you serious? I would argue that if there is such a thing as a J2EE "fanboy" (to use a gaming term) then that is an individual who cares only about job security and not about being a good technologist. I'm a developer with 10 years of experience. My experience is in everything from ASP with VB/JScript to PHP to Java. I use whatever the company deems best at the time or whatever I feel is the best solution at the time. I think there is a virtue in being agile and being able to pick up new technologies. The downside is that you don't go as deep. So I don't have 5 years of J2EE on my resume. The upside is that I'm not a J2EE fanboy and if next week my company decides that Ruby is the way to go then I pick up a Ruby book, start poking through the documentation and learn Ruby.

    I think J2EE "fanboys" are either too lazy to learn something new, too philosophically rigid to allow for the possibility that there are other ways to accomplish the task at hand or don't, or they're worried that RoR becoming popular would invalidate their 5 years of J2EE experience.

    I know people that probably fit this bill in some manner. I would hope for their sake and the sake of their organizations, however, that they'd be willing to pragmatically look at the problem being presented and make a decision based on what's best for the organization, be it Java or Ruby. At the end of the day I believe being a good technologist and a good communicator, being eager to learn and willing to try new things is more valuable than just being a Java wonk. Flexibility is a virtue. I imagine most Java developers are more flexible than you give them credit for. Although I know there are exceptions.

  26. Re:Wait..... by markv242 · · Score: 3, Insightful
    I think the reason why I don't admin a huge corporate dynamic website is about to be pointed out though.....
    Well, if you insist...

    Java as a "dynamic deployment platform", as you put it, offers trivial matters such as load balancing, server-independent sessions, and hot deployment (where new sessions get the new codebase, while old sessions get the old codebase), just to name a few. These three items alone are nearly impossible to pull off in a PHP/MySQL configuration, without keeping your sessions in a database and reloading them for every single pageview. Nearly every Java app server gives you these without having to write any code.

    And I think that's where a lot of these pseudo-flamewars get started. On an individual page basis where all I'm doing is "SELECT * FROM NEWS WHERE ID = ?", on one machine, of course PHP and MySQL are going to run faster. But once you start deploying your application to multiple boxes, the advantages of Java become clear.

    Additionally, I would challenge you to this test: let's say you have a stock PHP installation, without the GD libraries linked into the PHP binary. Now let's say you want to create a PHP application that uses GD. Do you A) recompile your PHP server, or B) give up platform-independence and run some kind of system call? Under Java, the answer is C) add in a GD jarfile to your application, and you're done, without any recompilation or configuration on your part.

    My point, and I do have one, is this: in exchange for the inefficient startup time of the VM and potentially inefficient bytecode (depending on your app server-- Tomcat is a real dog in this aspect) Java gives you a ton of freedom. With hardware getting faster every day, I'll make that tradeoff every single time.

  27. Re:Ruby is a toy by Paradox · · Score: 5, Informative
    There is no serious caching
    Incorrect. In fact, RoR's caching complete destroys Java's caching in Justin's comparison. You can read about Rails' caching here.
    No serrious transation capabilities
    Obvious jokes about your spelling aside, Ruby provides these already. Rails does not need to provide them.
    or messaging mechanisms.
    This complaint is flawed. However, Rails can accomplish what you're asking for if you want to. It's just that, assuming I understand what you're parroting, it's a very bad idea to do it.
    hype and buzz.
    Only if you don't bother to find out the truth.
    --
    Slashdot. It's Not For Common Sense
  28. Re:Security by Tobias+Luetke · · Score: 3, Informative

    Nice FUD... Except that its made up. Rails is very secure by default (uses pepared statements and things like this).

    It does whatever it can do to make the framework part of the application secure and even offers a book on security on the hieraki bookshelf for the user side of things: Securing your Rails application .

    This is a great example of rails quality documentation. have a look at the bookshelf itself: Hieraki bookshelf

    And the application which powers it is open source (MIT) at www.hieraki.org

  29. This is a flawed recollection. by Paradox · · Score: 5, Informative

    There was a brief example of this on ONE of the wiki-based tutorials in which the person posting the tutorial didn't use Rails's built in SQL search features or safety features. Because of this, there was an SQL injection hole. It was promptly corrected.

    No amount of safety can make up for novice mistakes. Rails provides everything you need to make secure webapps, and it lets you do it painlessly.

    --
    Slashdot. It's Not For Common Sense
  30. TFA by daddyam · · Score: 3, Informative

    Some Numbers at Last

    So, a few weeks ago I made an offhanded post here about my new-found love for Rails. I'd been skipping off the surface of Ruby for a while, trying to decide if it, or Python, or Groovy, or something else, ought to fill out the empty slot in my tool belt. (I'll save the "why LISP isn't on this list" post for another time.) Rails seemed like an excellent way to put Ruby through a workout, and I had the right sized project to try it out with.

    The project itself is not open-source; the client is now and shall remain anonymous. But they are paying me my going rate to do this work, which makes it a commercial Rails project, and it will in the future be installed into some rather large organizations. I can't really say much about what the application's domain is, but I can lay out the general principles of the app.

    The application must support multiple users, in the order of 10-100 concurrently. The load isn't particularly high, but the application will be treated like a desktop app (more specifically, a spreadsheet replacement) so it has to be responsive. The application is for managing pieces of a large machine process. There are lots of types of components to be managed, and the relationships between them can be quite complicated. There are no one-to-one relationships in the model, but plenty of one-to-many and many-to-many. In addition to managing the components, the application has to allow for the addition of entirely new categories of components as well as a variety of customizable fields. Finally, the authorization rules call for a breadth of user roles with a complex mapping of permissions to those roles.

    I've finally gotten around to running the profiling numbers and doing some comparison between the two systems. I won't spoil the suspense by listing my conclusions up front -- you'll have to scroll through the rest of the post to see them. But, first, let me set the stage: the original application is based on the Java/JSTL/Spring/Hibernate/MySQL stack. I used ACEGI for the security, SpringMVC for the web controller, and was using Hibernate 2.x for the O/RM. To increase performance, I was using the default output caching from SpringMVC and data caching in Hibernate. The re-implementation is in Rails on top of MySQL. The authorization is done through a custom observer and a custom authorization class, which uses a declarative rules file for permission mapping. For performance, I'm using a combination of page caching, action caching, and cache sweepers (observers whose job it is to expire cached pages).

    Now, for the comparisons:

    Time to Implement
    I made a comment about this in the previous posts on the topic, and that comment has been quoted widely out in the wide blogosphere as a classic example of Rails hype. So, let me make it plain: any time you re-write an application, it will go almost infinitely faster because you already have a firm grasp on the problem domain. Such was the case for me in my re-write; we'd spent so much time on the domain model and the database schema that the second time through the application, everything already made perfect sense to me. Any comparison of how long it took to implement one or the other is bogus, since the only fair comparison would be to implement two roughly functionally equivalent projects in the two different stacks and measure the competitive results. Since I have not done that, making statements about how it only took 5 days to re-implement the site are almost meaningless. What I can say is that I had more fun implementing it the second time, but that's just personal preference.

    Lines of Code
    This one is a lot more interesting. Folks will tell you all the time that there is a running debate about the meaningfulness of LOC comparisons. They're right; there is a running debate. I just think it's moot. For my money, the fewer lines of code I have to write to get a piece of functionality, *as long as those lines are clear in meaning*, the better off I am. Obfuscated Perl programs don't make the

  31. Re:any comparison like this... by swimmar132 · · Score: 2, Insightful

    With fastcgi and a decently tuned server, I've heard people getting 1000 req's per second. And lighttpd doesn't take up much memory. And you can always add more applications servers if that's not fast enough.

  32. Re:Security by Xugumad · · Score: 5, Insightful

    Dear Moderators,

    THIS IS NOT INFORMATIVE. It is INTERESTING. If the poster had supplied supporting evidence at all, it would have been a start towards informative.

    As it is:

    1. Which tutorial was it?
    2. Was the problem a fundamental problem with Ruby on Rails, or the tutorial itself.
    3. If it was a problem with Ruby on Rails, can it be fixed?

  33. Meta-application issues by ewg · · Score: 3, Insightful

    Improvements in performance and application size are always welcome, but there are some important outside issues to consider when picking a platform for your project.

    One is, how deep is the library? With Java or Perl, there are libraries of open-source tools such as Apache Jakarta Commons and CPAN that often mean that with a quick download an enhancement request is 80% done. All new platforms (naturally) have a disadvantage in the department.

    Another is, how easy is it to find developers with applicable skills? If an organization commits to Ruby and their Ruby developer leaves, how hard will it be to find a suitable replacement? This is a problem for all platforms except the juggernauts like Java, but especially new platforms. Looking at this another way, a platform choice can be a multi-decade committment. Choose carefully.

    So the summary of the summary of the summary is that software development doesn't take place in a vacuum. Ruby is the coolest scripting language ever, but I can't recommend it until I learn more about its library and community.

    --
    org.slashdot.post.SignatureNotFoundException: ewg
    1. Re:Meta-application issues by swimmar132 · · Score: 3, Insightful

      Any developer who can't pick up Ruby in a couple days is a developer who you should not hire.

      It's not like C++ (which, in my experience, takes a LOT of training in order to become proficient).

    2. Re:Meta-application issues by CatGrep · · Score: 2, Insightful

      Another is, how easy is it to find developers with applicable skills? If an organization commits to Ruby and their Ruby developer leaves, how hard will it be to find a suitable replacement?

      (raises hand) Pick me! Pick me!

      Seriously, I've been programming in Ruby for a few years now (sometimes even getting paid to do it). It's so much nicer working in Ruby and there are quite a lot Rubyists out there who would love to get paid to develop primarily in Ruby.

      Also, anyone who knows Perl, Python or even C++ should be able to pick up Ruby in a week. Companies are often too concerned about findind someone with an exact skillset that they overlook a candidate's growth potential.

  34. Hibernate Vs. Ruby on Rails- flame free! by acomj · · Score: 4, Informative

    This article is a good look at RnR(ruby) and Hibernate (java). The author is a java developer and doesn't claim to be a ruby expert, but its interesting analysis about each one.Technical pros and cons of each without a lot of flame bait.

  35. Re:any comparison like this... by Anonymous Coward · · Score: 4, Informative

    Actually, this is possible. Rails complains the most about having your primary key be something other than the field named "id". A snippet from a recent post on the Rails ML:

    class XXX "Person", :foreign_key => "person_id"

    def self.table_name() "YYY" end

    def self.primary_key()
    "myprimarykey_id"
    end
    End

    So, you can tell active record what the primary key is for each model, and
    you can spell out what foreign keys to use for has_many and belongs_to,
    etc., as well as what the table name is.

  36. Re:any comparison like this... by dtfinch · · Score: 3, Informative

    # of clients can be misleading. If it's the number of daily users, it could mean as little as 10 requests/second in an 8 hour day. Just about anything can handle that kind of load. If it's the number of simultaneous connections, then with a gigabit connection you could only serve about half a packet a second to 250000 clients, and I know Java doesn't scale to 250000 simultaneous threads. If they're talking about a horizontal scaling, as in a cluster, then load comparisons becomes almost meaningless without specifying the hardware. Depending on the application, with 10x servers you can usually handle nearly 10x the users, no matter what language you're using.

    Notice that Slashdot is written in Perl, with nearly all dynamic pages. According to the FAQ, which may or may not be up to date, they have 8 single processor 600mhz PIII web servers and 1 quad 550mhz xeon MySQL server.

  37. looks interesting, but does it have to be ruby? by ramone1234 · · Score: 5, Interesting

    I checked out the video demo at http://media.nextangle.com/rails/rails_setup.mov and I have to admit that I'm pretty impressed. This framework eliminates a lot of the tedium that goes into developing web apps... Here's my problem though... Is there any reason it has to be in Ruby? I've heard of python's equivalent 'subway' ( http://subway.python-hosting.com/ ), and I'm wondering if Ruby has some language feature that makes it inherently more suitable than other languages (like python) for this 'rails-style' of development...

    Otherwise, I think I'd just rather stick with Python... It seems to have a bigger and more mature standard library, and I can find more web hosts to support it... I'm not trying to start a language war, I'm just looking for the practical solutions...

    1. Re:looks interesting, but does it have to be ruby? by CatGrep · · Score: 4, Interesting

      I'm not trying to start a language war,

      Oh, of course you are. Might as well just admit it.

      As far as Ruby vs. Python features go:
      1) code blocks. Ruby lets you pass code blocks around. Sounds pretty dull, eh? But in fact it's what makes it possible to create Domain Specific Languages in Ruby quite easily without needing to create a special parser. In many ways Rails can be thought of as a domain specific language built on Ruby.
      2) classes are always open in Ruby(including the Class class). By 'open' I mean you can always add new methods to a class (or even a particular object). Another feature that makes it easy to create DSLs
      3) continuations. (Not that Rails makes use of them, but some other Ruby-based web programming frameworks do)
      4) Ruby has true lambdas. AFAIK Python's lambdas are pretty limited (limited to one expression?)

      Also, can you embed Python in HTML? (seems that the whitespace issue would cause a lot of problems with doing that)

      I'm just looking for the practical solutions...

      Give RoR a try. You might just find that it'll do everything you need it to do now without needing to wait around for a Python-based clone. What could be more practical?

    2. Re:looks interesting, but does it have to be ruby? by nosferatu-man · · Score: 2, Informative

      Python's classes support metaprogramming, although it lacks continuations and a non-useless lambda form.

      As far as the OP's question, no, there's nothing at all in Python the language that'd prevent a similar project, although the implementation would be pretty different.

      --
      To spur "enterprise Linux," Big Bang, the distributed two-phase commit.
    3. Re:looks interesting, but does it have to be ruby? by nosferatu-man · · Score: 2, Informative

      Python folks always seem to minimize the importance of [anonymous code blocks], but in practice it is very useful/powerful and it can lead to very natural looking DSLs in Ruby.

      Oh, no question. It's the one thing that Ruby has that Python doesn't, and it's one that many developers (myself included) would love to have.

      --
      To spur "enterprise Linux," Big Bang, the distributed two-phase commit.
    4. Re:looks interesting, but does it have to be ruby? by Abcd1234 · · Score: 2, Informative

      But the lack of a usable lambda feature in Python would mean that you can't pass around significant code blocks like you can in Ruby

      Well, this is just silly. I'm not a Python expert by any means, but even I know this works:

      def func():
      def my_code_block():
      print "Hello, World!"

      return my_code_block;

      f = func();
      f();

      What Python doesn't have is nice, clean, anonymous code blocks (ie, for anything non-trivial, you have to name them).

    5. Re:looks interesting, but does it have to be ruby? by CatGrep · · Score: 4, Interesting
      Well, this is just silly. I'm not a Python expert by any means, but even I know this works:

      def func():
      def my_code_block():
      print "Hello, World!"

      return my_code_block;

      f = func();
      f();


      Of course. You're basically passing around a function reference. That's not what I'm talking about.

      What Python doesn't have is nice, clean, anonymous code blocks

      That's what I'm talking about. In Python you can't do something like this:
      def my_while(cond)
      return @ret unless cond
      @ret = yield
      retry
      end

      my_while i<10 {
      puts "i: #{i}"
      j = 0
      my_while j<10 {
      puts " j: #{j}"
      j+=1
      }
      i+=1
      }
      my_while looks like a natural extension of the language. I'm sure you could duplicate this function in Python, but it wouldn't look like a natural part of the language.
    6. Re:looks interesting, but does it have to be ruby? by Abcd1234 · · Score: 2, Informative

      Which would be why I said "What Python doesn't have is nice, clean, anonymous code blocks (ie, for anything non-trivial, you have to name them).". What you've shown me is a very nice example of syntactic sugar. But make no mistake, that's all it is.

      The real difference between Python and Ruby is that Python doesn't support true lexical closures. As such, it's not possible to duplicate your example, as you can't rebind the outer variables in Python... an annoyance, to be sure, but certainly not fatal, and it definitely doesn't prevent one from creating a Rails-like system in Python. In fact, it can be argued that Python's way is safer... fewer side-effects.

      Incidentally, I have to say, Ruby's idea of having 'yield' execute an implicit codeblock (as opposed to just passing the damn thing in explicitely) is one of the most braindead things I've seen in quite some time... talk about confusing code. I mean, if you're going to copy Smalltalk, at least do it right... yeesh...

  38. Is it just me or... by dDrum · · Score: 2, Insightful

    Nowhere in the article it is claimed that the "The Java app's configuration alone was nearly the size of the entire Rails codebase".
    What is said is that it's the configuration files are nearly the size of the ruby implementation of the example application.
    I know that rails makes you write less code but don't over do it.

  39. Re:Ruby is a toy by Jerf · · Score: 2, Interesting

    You should try one of these dynamic languages sometime. You'd be surprised how easily Python or Ruby lets you roll your own messaging systems, simply because they are so easy to work with. You can often roll up a custom solution that exactly matches the domain in less time than it would take to set up a Massive All-Purpose Java solution. I know, I've done it at least twice now.

    Does my custom solution do absolutely everything that the Massive All-Purpose Java solution does? No, and that's half the point. I can still add what I need faster than you'd believe.

    Normally I'm all about using libraries, but there is a cost to them as well (bending your app to the library's assumptions), and these languages make some things so easy it's not worth it anymore.

  40. Re:RoR == the mysql of web servers by nitehorse · · Score: 2, Insightful

    The funny thing is you obviously didn't read the article, where the author noted that Java was faster for the less-complicated things but the more complex the pages got the more that Rails kicked ass.

    Considering that this guy wrote the Spring: A Developer's Notebook for O'Reilly, I'm inclined to believe that he has a clue when it comes to the Java side of things.

  41. Re:any comparison like this... by aziegler · · Score: 5, Informative

    Full disclosure: I don't particularly like the Rails way of doing things with databases, because it bases its data interaction semantics as if MySQL were a good (rather than an "easy") database.

    That said:

    1. Ruby has SOAP capabilities and it's built into the core of Ruby (SOAP4R). Just because someone has not yet seen fit to mix ROR and SOAP doesn't mean it can't be done.
    2. Ruby can do RMI/remote invocations through DRb or other mechanisms. Of course it can't do Java RMI without a JNI connector, but those JNI connectors are available -- and there's even a nascent JWDP connector for additional interaction with Java.
    3. There is some queueing technology available for Ruby. I haven't had a need for it, but it's available. Or buildable.
    4. ROR prefers you to design the database from scratch, but it certainly doesn't prevent you from using an existing database and doing a bit of extra coding to make it Just Work. The good thing about ROR is that it uses sane defaults to make the common brain-dead simple. You can manually implement a mapping. There might be room for an easier mapping mechanism in cases like this (rather than defining self.table_name and self.primary_key), but as ROR is still an evolving framework, that's not a big deal.

    The assessment on the Rails blog is, I think better. The numbers are impressive but meaningless -- there are tweaks that can be done in any case. The real point is that this shows that Ruby Isn't Slow and that Rails (or any other application environment) can be used in a production environment.

    --
    Ni bhionn an rath achx mar a mbionn an smacht (There is no Luck without Discipline)
  42. Re:Security by Karma+Sucks · · Score: 2, Interesting

    The first one seems to be in PHP anyway.

    --
    (Please browse at -1 to read this comment.)
  43. Re:any comparison like this... by swimmar132 · · Score: 2, Informative

    Sure you can.

    In the model for the class:

    def first_name
    fname
    end

    There might be a better way to do it, but that works.

  44. RoR sounds great, but... by fritter · · Score: 4, Insightful

    I've been meaning to try out some RoR development for a while now, it looks like an incredible language. That being said, I keep thinking of something I read on another forum - don't trust a language until someone can explain to you why it sucks. Right now RoR is in full hype mode, with 100% gushing and not a lot of discussion of its weaknesses, things like that. So that being said, can anyone tell me why RoR sucks?

  45. Wrong attitude. by Some+Random+Username · · Score: 2, Insightful

    This is why I gave up on rails. The developers take the attitude of "its your problem, you make sure its secure". No, that's wrong. You are making a web development framework, then YOU make it secure. If you don't read the rails code and find out how things are implimented underneath, then you don't know if your own code is vulnerable to SQL injection or not. That's rediculous, all the rails automatic SQL generation should be safe, you shouldn't expect every user to guess which is the safe way to use rails and which is the unsafe way. And when David dismissed a patch to fix an issue like this "because that would inconvenience people who are using the potentially insecure method securely", I knew he had no business writing software for the web.

  46. Re:any comparison like this... by Anonymous Coward · · Score: 2, Funny

    I feel the same way about "complement" and "compliment."

  47. Application scaling by reaper · · Score: 4, Insightful

    You know, I've made a tone of cash begging to differ with this. Perhaps you should ammend that statement to be "There is nothing easier in the world to scale than trivial webapps".

    First off, a webapp is not a peice of code on a web server; it is a functional system that does desirable work. Yahoo Search is a web app, but I'd be really impressed if it ran on one server. The front end may be easy enough to scale out, as long as you've figured out how to effectivly manage session handling (either by not using them, having the state kept on a 3rd party system, or assigning a session to always go to one web server).

    Now, if we're talking only the front end part, than it makes it a whole lot easier to scale out by throwing money at it. The problem I've always run into is the various resource utilizations on the web server.

    If your webapp calls up an application framework and calls up a ton of copies of it, or even just takes up a lot of memory, you run out of it, which now asses a 10,000% penalty on access thanks to swapping. You won't see this if the framework requires a couple megs, and is going to be pooled in some way, but it suddenly gets real interesting when you have hundresd of copies floating around (for whatever reason). When this happens, you now need to know how much of a monetary hit you take to get it to an acceptable level. It may just end up being way too much cash spent to get you to the next level. Then you may have to do it again.

    I wound up doing a job that each web app used about a gig of RAM if it ran long enough. I told them to fix the leak. They said the programmer just quit. So we throw money at it. They ran up to 60 web apps on Windows. Guess what.... it would have taken $20,000 and a bunch of downtime to do the upgrades. Once the guy stopped yelling, he realized they were forced to fix the app.

    Same priciple applies to anything that hits the disk more than it should, tries to factor large numbers, or tries to download all the Internet porn right now. You run out of something, and have to either see if you can spend money, or fix it so it should have to.

    Basically, if you've got a simple app, it's easier to throw hardware/money to scale it. If your app is a large system with complex requirments, it may be possible to do that to an extent, but it's much better to have different tools that may provide much better results.

    --
    - Dan
    1. Re:Application scaling by Tobias+Luetke · · Score: 2, Informative

      The best solution for this is memcached. It means that all sessions will be in memory and therefore blazingly fast accessible to anyone in the server farm.

      The database is a excellent second choice as well. I usually go with db based sessions first for convenience and move to memcached as soon as it is required. As always, dont try to make your app scale before you need it. I know its fun but just wait, you will have a much better idea where the bottle neck is when you hit one.

      I know this is a trick 99% of all projects never need to run across more then one box, never mind what management says.

  48. Spoke to Justin about this... by scottsevertson · · Score: 5, Informative

    At the Milwaukee No Fluff Just Stuff conference, I was invovled in a lunchtime conversation with Justin and [Pragmatic] Dave Thomas about this subject, just days after Justin completed the Ruby code.

    The concensus at that point: it probably wasn't a difference in *execution* speed, but smarter data retreval strategies used by Rails persistance layer. While Hibernate has excellent support for lazy loading, both developers thought that Rails was being *lazier*.

    Justin's new numbers also point to faster caching in RoR's persistance layer: while both applications performed about equally without pre-cached data, RoR performed 20x better than the Java stack with cached data [both versions using similar caching strategies].

    As for those questioning Justin's java skills: he's one of the best programmer's I've had the privilege to know, one of the best speaker's I've listend to, and is freaking hilarious to boot. He's the co-author of O'Reily's Better, Faster, Lighter Java, and he regularly speaks on advanced Hibernate, Spring, and a bunch of other Java topics.

    He also points out a *significant* decrease in Lines of Code[Java:3293 RoR:1164] and Lines of Configuration [Java:1161 RoR:113]. While not an accurate gauge of effort, it is another point in Ruby's favor.

    Last point for Ruby: Every single *top notch* Java programmer I know is at least playing with Ruby and RoR, with a large percentage [>50%] transitioning to Ruby as a first choice for new project work.

    Don't call it a toy until you've played with it. There's some pretty convincing evidence that Ruby/RoR can beat Java for development effort, and now we're seeing it can beat it for performance, too.

    --


    Scott Severtson
    Senior Architect, Digital Measures
  49. Hardly by Safety+Cap · · Score: 2, Insightful

    Speed is important, but not the most important thing. If that were true, then your Browser would not be written in C or C++, but in Assembler.

    --
    Yeah, right.
  50. Out of the box by fishdan · · Score: 2, Insightful
    Alot of what has happened to Java is feature creep and bloat. I think that Ruby is likely to suffer the same fate at some point. Lean and Mean will always be faster than Big and Powerful. Comparing Ruby and Java is like comparing MySQL and Oracle. Of course MySQL is faster than Oracle for many things. Just as when Oracle was the upstart and THEY were faster than all the Old guys on the block.

    Java is an old man in todays hyper-development environment. Teh old man still has a few tricks up his sleeve though, and he can get the job done. He's just not the upstart he was in his youth.

    CS is CS -- there's more to development than language. In 10 years Ruby will be supplanted as well -- and we'll be talking about the NEXT great language.

    Face it brother developers, in this profession, we cannot sit around and become complacent. Learning a new language is somethign you should do joyfully. All my pay work in still in Java, and I don't anticipate that changing -- but I thinkI am going ot move some of my pet projects to RoR -- just to see what it's like.

    --
    Nothing great was ever achieved without enthusiasm
  51. I use both J2EE and Ruby on Rails by MarkWatson · · Score: 4, Interesting

    I earn most of my living writing custom web apps using (usually just part of) the J2EE stack. I love J2EE because it is rock solid - debugged web apps seem to run forever :-)

    That said, I have been working through the fantastic second edition of "Programming Ruby" and I have been using Ruby on Rails. Another great technology for use in my consulting business!

    While I understand that it is good for developers to share their experiences as per what works for them and what does not, I think that these J2EE vs. RoR discussions are starting to loose value based on the time spent on them.

    Now, to get up to speed on J2EE probably takes several months of dedicated study and lots of experience. Ruby and specifically Ruby on Rails might take a half dozen evenings of study instead of watching TV. If you are a J2EE developer the cost of trying RoR is low. The cost of trying J2EE is much higher.

    The choice of platform does not have the impact that design choices make on the success of projects. This is obvious, but: do some up front analysis and then try to use the best tool for a job.

    BTW, I have a few open source projects in both Java and Ruby (shameless plug :-)

  52. Sure. by Some+Random+Username · · Score: 5, Interesting

    Rails sucks because its written in ruby, which is slow (excruciatingly slow for recursion and text processing), and doesn't support OS level threads. The fake threads ruby does have can under uncertain circumstances cause the entire interpreter to block.

    Rails sucks because David thinks security is your problem, and leaves in functionality that can easily be misused to create a security problem if you haven't read the rails code thoroughly to understand what its doing underneath. Convenience trumps security in rails development.

    Rails sucks because its development is incredibly mysql centric, and doing anything beyond the basics with real databases will result in tons of bugs, and then you are told "try again in a few weeks when there's a new version, it should be fixed by then". Then the new version has different bugs instead. Continue this cycle until you decide to use mysql or stop using rails.

    That's all I've got, any other problems I've seen are personal preference issues, or things that can easily be fixed as rails matures.

    1. Re:Sure. by Paradox · · Score: 3, Informative
      Rails sucks because its written in ruby, which is slow (excruciatingly slow for recursion and text processing), and doesn't support OS level threads. The fake threads ruby does have can under uncertain circumstances cause the entire interpreter to block.
      Get off it. Ruby is not "excruciatingly slow" for anything. It is surely not as fast as some languages, but its speed is obviously good enough, because even without caching the Rails app is faster than the Java app.

      I mean, if caching was the only thing holding Rails afloat, you could draw this conclusion, but even a cursory examination of TFA wills show that's just not true.

      Rails sucks because David thinks security is your problem, and leaves in functionality that can easily be misused to create a security problem if you haven't read the rails code thoroughly to understand what its doing underneath. Convenience trumps security in rails development.
      Making secure actions in Rails is trivially easy. There is even a generator for it. Rails developers are concerned with security, but they've yet to see a scenario where the standard login generators and practices of the rails community require a technical fix.

      Yes, you could bring up Geert's posts point out flaws in Ta-da Lists, but that'd be silly. Every application can have bugs, and Ta-da Lists was ripped wholesale out of Basecamp, reseated, and used mainly as an Ajax demo and advertisement for basecamp.

      Rails sucks because its development is incredibly mysql centric, and doing anything beyond the basics with real databases will result in tons of bugs, and then you are told "try again in a few weeks when there's a new version, it should be fixed by then". Then the new version has different bugs instead. Continue this cycle until you decide to use mysql or stop using rails.
      This is no longer true. It was true at one point. Yes, many features go into Edge Rails that are MySQL only, but that's just because the developers tend to know it best. Features don't end up in the mainline unless they're as compatible as people can make them. I cannot deny that some databases are not as well supported as others, though.
      That's all I've got, any other problems I've seen are personal preference issues, or things that can easily be fixed as rails matures.
      I think you formed your opinions before the 0.10.0 release. We're closing in on Rails 1.0 now, and things are starting to get really stable.
      --
      Slashdot. It's Not For Common Sense
    2. Re:Sure. by Azoth's+Revenge · · Score: 4, Informative

      I'm currently using Rails for a project at work using PostgreSQL as my DB. Everything works fine with PostgreSQL in place of MySQL except sequence names. Rails assumes that a person creating a table will use something like (id serial primary key, foo ..). the serial keyword creates a sequence that is something like tablename_fieldname_seq. I wanted to have plural table names but singular sequence names. No way to change it by default. Also rails assumes one table one sequence.
      The Oracle abraction for active record has a way to specify the sequence name, but the postgres one doesn't I hope that this will eventually be rectified.

  53. Re:Security by paulpach · · Score: 2, Interesting
    Not only that, but it is full of XSS vulnerabilities:

    Scaffold is vulnerable, input any data like

    <script>alert('I have been fooled')</script>

    and when you see the data it will happily execute that code.

    The bug tracking system they use is also full of XSS holes. Browse their database and you risk giving your login/password to anybody.

    Even on the tutorials, they teach people to write XSS vulnerable software. From the first tutorial:

    ...
    <input id="recipe_title" name="recipe[title]" size="30"
    type="text" value="<%= @recipe.title %>" />
    ...

    The user only has to input

    "/> <script> alert('fooled again')</script>

    for the title, and presto, he can get all other user's cookies

    All the other tutorials have the same vulnerability.

    The developers don't care about these. Some people even activelly oppose fixing them. I can only imagine what else is in there. I wouldn't touch ruby on rails with a 10 foot pole for anything where security mattered.

  54. Re:Here we go again by C10H14N2 · · Score: 4, Interesting

    In sixteen years of developing for large-cum-huge organizations, I've found that there is one overriding criterion for EVERYTHING that such companies do: stability.

    People who are "fanboys" may just be so invested in [something] that to achieve the same depth of _tested_ knowledge in [something else] would take five years. They may in fact be looking at things like Ruby, but they aren't planning on switching their production development to it until both they and it are seasoned because it would be insane to do so. It's not just THEIR level of comfort that is in question, it is the organizations ability to accept it.

    Before someone slams on corporate culture limiting your godlike creative powers, it's actually pretty reasonable. A business is a machine. You want to get some return on the machine before you rip the engine out and retool it--and that timeframe is generally ~5 years. Think of it like buying a car. YOU may be able to afford to replace yours every year or maybe you're a grease monkey who does a frame-off rebuild every spring just for kicks, but the vast majority don't want to go through the hassle and expense on an annual basis.

    So, Ruby has now reached the point where it is a serious contender. Expect it to start replacing J2EE somewhere between 2008-2010.

  55. Re:Part of the Reason by TrekCycling · · Score: 2, Interesting

    I think there's a good chance this is part of the problem. I assume you meant universities switched from C++ to Java, right? They did locally where I live. I think that's a shame. I'd rather learn something more challenging like C++ as my first language (my first language was C) so that that way I can understand basic concepts of programming at a lower level before moving on to Java, etc.

    I think part of this also is what you pointed out, people who went into CS because that's where the money was. For my part I studied English in college. I wrote a lot. I read a large chunk of the classics of post-modern, modern and earlier literature. And then somewhere halfway through college I fell in love with computing. So I bought "Teach Yourself C on the Macintosh" (I think because it was the book in the store that came with a compiler, whereas the Pascal book didn't).

    Then when I graduated from college, being a former landscaper, I applied for a couple different jobs. One was as a landscaper. One was for $10 an hour doing HTML, JavaScript, CSS, Photoshop, etc. I got the web job first, so I became a programmer. I didn't seek it out, but rather fell into it and enjoy it enough to keep learning new things.

    I think you're right that there is a distinct difference in mindset there. I wasn't looking for a career. I was looking for a job I enjoyed. And all the same I won't fight against new technologies to cling to my newfound career. I could easily be happy doing landscaping if for some reason all the world needs is Java experts. But if they need generalists who love what they do, then I won't be planting trees again for a while.

    That's how I look at it.

  56. Zope 3 by Lodragandraoidh · · Score: 3, Interesting

    I wonder how Zope 3 (python web application framework+more) compares to these?

    --

    Lodragan Draoidh
    The more you explain it, the more I don't understand it. - Mark Twain
    1. Re:Zope 3 by Ian+Bicking · · Score: 2, Informative
      Huh, highish rated posting with no replies, I guess other people are also curious. I know about Zope 3, but I haven't used it at all seriously.

      Zope 3 is really targetted at J2EE-like functionality. Rails is based on a You-Ain't-Gonna-Need-It philosophy -- it provides significant base functionality and a set of conventions, but the framework is not all-encompassing or intended to match J2EE feature-for-feature, nor as a framework does it really mean much outside of the web. This is by design.

      Zope 3 is really a whole design philosophy, kind of like J2EE. It makes heavy use of interfaces and adapters, which are intended to bring an increased level of formality to the development process. But it's not just an attempt to put static typing on top of a dynamic language; the techniques they use are fundamentally dynamic, and an attempt to utilitilize those formalisms as basic programming constructs. This is embodied in the idea of "adaptation", where instead of requiring an interface, you ask for a version of an object that implements the interface, and then you provide wrappers ("adapters") to translate interfaces.

      There's other ideas in there too, generally built upon these basic programming ideas. It's a framework of frameworks. It's also heavy on the idea of modeling, and of an applications that provide a window into your models. The entire scale and concept is very different from Rails. It's actually a little foreign to the Python community too. A lot of Zope 2's ideas were also foreign to the Python community, but the problem is that they were also uncomfortable and put people off -- I don't think people are uncomfortable with Zope 3 as much as unfamiliar.

      (Also, Zope 3 is a complete rewrite of Zope 2 and is very different, so most of people's experience of Zope 2 -- good or bad -- can't really be applied to Zope 3)

  57. Re:Security by snorklewacker · · Score: 2, Insightful

    Funny, I don't recall JSP templates scanning for javascript and rejecting them. How is this ROR's problem? You get the same thing in JSP, ASP.NET, PHP, and anything that lets you substitute values from the environment.

    Oh look, the shell lets me type rm -rf. I better stop shell programming.

    The tutorials are sloppy. This doesn't mean Rails is.

    --
    I am no longer wasting my time with slashdot
  58. Java Trails is the Java version by FigWig · · Score: 2, Informative

    Java Trails is a Java version of RoR. A domain driven collection of tools that allows you to quickly get a CrUD web app up and running. Since it uses Spring, Hibernate, and Tapestry you have complete flexibility to customize code if trails doesn't do what you need.

    https://trails.dev.java.net/

    --
    Scuttlemonkey is a troll
  59. Conclusion holds the key by javaxman · · Score: 3, Insightful
    I think that the Java version is just as capable, and could be just as performant, as the Rails app. To me, the eye-opening revelation isn't "Rails is faster than Java/Spring/Hibernate". It's "Rails can be very fast". I think that there is a lot to be said for Rails, and it deserves much of the press it is getting. However, I don't think its a Java-killer. I think there are plenty of applications, and development teams, that are better suited to Java and its immense universe of available support libraries. I certainly am not going to stop developing in and learning about Java just because I've discovered Rails.

    This whole thing is easily blown out of proportion, in the opinion of the author. Pay attention, people! Use the right tool for the job- all this guy is saying is that in his one instance, he found he was working on a simple project in which the caching of Ruby on Rails worked very well.

    Measurable slowness of individual functions in Ruby were overcome by an agressive caching scheme. It's entirely possible that similar or better results could be had in Java, but it would take effort. YMMV. More than a few more comparisons might be needed before you decide to dump Java for Ruby. Think and test. He's just relating a positive experience with a new tool- one which contradicts many people's assumptions about the speed of Ruby as a deployment solution. It's one interesting datapoint, and a fairlly anecdotal one at that... nothing more. I'm definitely not saying it's not significant, but it is what it is, folks shouldn't make it out to be anything more.

  60. Show me the code by MSBob · · Score: 2, Interesting

    So.... I should make my next platform decision based on some guy's blog where he quotes some suspicious looking numbers within some unknown domain space and refuses to open the source code for public scrutiny? The Ruby trolls are really out in full force lately.

    --
    Your pizza just the way you ought to have it.
  61. Re:Here we go again by Listen+Up · · Score: 2, Insightful

    The second post of yours is much more intelligent and much less ignorant and arrogant than your first post. I rolled my eyes when I read your first post.

    Depth is far more valuable than breadth, especially in a real corporation. In a real corporation, the objective is to make money, not see how many different disparate technologies can be strewn around and later supported for the next 10-15 or more years. The objective is also to get the job done as quickly and efficiently as possible. If Java does the job better than than Java gets chosen for our enterprise project. If Java and do the job equally well, but we already have a Java programmer and not a programmer, then Java gets chosen. Every minute you spend barely getting deeply involved in a language, such as you claim to do in your first post, makes you more useless to a corporation, not more useful.

    From an educational standpoint, I agree than both depth and breadth are of utmost importance. But from a business standpoint, I completely disagree with you.

  62. Here's why Ruby is not an option by melted · · Score: 2, Interesting

    It does not support Unicode. No unicode strings, no unicode regexps. So if you write your apps with l10n/i18n in mind, Java is still your best choice (or .NET/C# if you're on Windows).

    Unicode is expected in v2.0, but nobody knows when it will come out.

    Plus, the IDE doesn't support code completion, and having worked with code completion for years now I'm now much less productive without it.

  63. Re:any comparison like this... by aziegler · · Score: 2, Interesting

    1. I don't believe your SOAP comment is correct. Remember, ROR doesn't provide SOAP per se; it's SOAP4R that does. ROR may provide basic SOAP4R capabilities, but that in no way means that it's using 100% of the features. The ROR team may have decided that the typical use of SOAP with a ROR site is likely to be 25% of the SOAP capabilities. You can *still* do the full SOAP support -- you just have to work a bit harder on it.

    2. Yes, but J2EE is an overblown, overladen framework to begin with. When people need queueing and remoting technologies with ROR, it will be added. In fact, the remoting technology -- at least in part -- is already there through DRb (if you haven't looked at it, you should) and Florian Groß's breakpoints code. I would strongly disagree with your assertion that the J2EE components for these are "comprehensive" and especially "unified."

    3. Again, you *can* do field name mapping, but it's a bit more work to do so. There's no reason you can't create aliases, e.g.:

    def deg_f=(fahrenheit)
    write_attribute("celsius", (fahrenheit - 32) * 9 / 5.0))
    end

    def deg_f
    (read_attribute("celsius") * 5 / 9.0) + 32
    end

    See http://ar.rubyonrails.com/classes/ActiveRecord/Bas e.html for more information.

    Field name mapping is easy; not as easy as simply following the Rails model, but it's *easy*. SOAP is a bit harder, and other stuff maybe a bit harder still. It's all still easier than trying to pick up all of J2EE.

    -austin

    --
    Ni bhionn an rath achx mar a mbionn an smacht (There is no Luck without Discipline)
  64. Code Completion by Paradox · · Score: 2, Interesting

    Ruby does not have a canonical IDE, unlike Java.

    However, most developers agree they are more productive in languages like Python, Ruby or OCaml than they are in languages that do have auto-complete environments (e.g., C++, Java, C#, etc...).

    This shouldn't be taken as a "We don't need no stinkin' code completion" comment. It's just an observation that code completion would be icing on the cake, but the cake is allready there, tasty and full of chocolate.

    If you want to try ruby with code completion, check out FreeRIDE. It is not done yet, but it'll show you the direction things are going.

    --
    Slashdot. It's Not For Common Sense
  65. I think this is great news by hey! · · Score: 2, Insightful
    I've looked at Rails, and I'm very impressed.


    I hope this inspires a lot of people to use Rails in demanding production enviornments. That way after they have picked the arrows (if any) out of their backsides, the rest of us can follow along. In all seriousness, I'd be on the rails bandwagon right now if it had a bit more of a track record, and if certain highly specialized java libraries I use were available in ruby.

    --
    Post may contain irony: discontinue use if experiencing mood swings, nausea or elevated blood pressure.
  66. Re:I was unclear about YARV. Let me clarify by computational+super · · Score: 3, Interesting
    Know your latin: i.e.: "id est" or "that is" e.g.: "exempli gratia" or "for example"

    To which I'd like to add, "et cetera: et = and, cetera = the rest" . There is no work "eck" in the Latin language, and the phrase "Eck cetera" is nonsense. And you sound stupid if you say it. And, while I'm on the subject, there are two "s"s in the word asterisk. It's not an asterick, even if you verb it.

    The fact that bringing ignorance to the attention of the general populace is considered worse than being ignorant itself is a sure sign that we've reached a period of pure intellectual unenlightenment - the second dark ages hath begun. Well, Paradox, let me be the first to stand behind you in solidarity in the battle against stupidity and deliberate ignorance.

    --
    Proud neuron in the Slashdot hivemind since 2002.
  67. Chill out horny rails guys. by Some+Random+Username · · Score: 4, Insightful

    He asked what sucks about it. I told him. Seriously, nothing is perfect, including your precious rails, get over it. The list is only three items long, you should be proud, not trying to make up excuses.

    I think I formed my opinions before the 0.10.0 release too. I tried what was being hyped as the greatest thing ever. These were the problems. Sorry you don't like it, but that's what I found. There has been no indication of a change in attitude with regards to security:
    http://article.gmane.org/gmane.comp.lang.ruby.rail s/749/match=sql+injection
    and a simple scaffolding blows up with the current version of rails for me, so I think clearly the mysql specific issue has not been dealt with sufficiently.

    As for speed, benchmark ruby yourself, its recursion is an order of magnitude slower than other languages, PHP being the other language sharing this undesirable trait. And benchmarking rails vs some mess in tomcat doesn't mean anything about rubys performance. Benchmark ruby and java, java is WAY faster. I don't think this is that big of a deal, but you can't deny that this is one of the weaknesses rails has in it, which is what the poster specfically asked for. Everything has its downsides, and wanting to know about them from the start is a pretty smart move.

  68. Trails Video by Mindbridge · · Score: 2, Informative

    Trails has been mentioned earlier as the Java copy of RoR. You will probably find the following video pretty interesting -- it demonstrates how quickly one can develop an application with Trails. It is a part of Chris Nelson's weblog.

  69. Re:any comparison like this... by gnuman99 · · Score: 2, Informative
    Make a view out of the stored procedure? Then you put the necessary code in the database to update/insert into that view.

    Rails assumes that each model is one table. In the database, the table can also be a view, but you have to add capabilities in the database to update/insert into that view if you want that functionality.

    Mappings should be done in the databases - that's what they are there for.

  70. Re:Here we go again by Listen+Up · · Score: 2, Insightful

    Whatever you wish to say about 'real corporations' is fine with me. There are many different kinds of working environments in the world. I have no turf to protect and I am neither ignorant nor arrogant.

    What I was simply saying is that in your first post you very much sounded like you were bashing people who are intimately in-depth with one particular language. Especially if those people resist learning 20 new languages simply for the sake of having to learn them. That is a waste of everyone's time and money, especially if the project can be accomplished in the language the programmer is most comfortable with and happy using. Not everyone's reason for resistance is 'protecting their turf'. If you are trying to talk specifically about some people who you know, in a very finite view, then that is fine.

    Personally, I love to program in Java and would move most of our corporation to the platform if the opportunity were to present itself. In a small generalist corporation, it may be beneficial to have 20 different programming languages being learned on a superficial basis by 20 different people, none of them experts on any one particular field. Generally, but not always, you get what you pay for in the end product with a group of people like that too. You've heard the saying "Good at everything but exceptional at nothing". Like I said, that does not apply to everyone as some people can be absolutely exceptional at anything and everything they want, and those people are exceptional talents, but you get my point. In a much larger corporation, such as the one I currently work at, software goes into production cycles on scales of 10-15 years. In-house talent and support dictates how projects get implemented. A very small, finite number of excellent programming languages, a small group of programming language experts, and reuse and homogenization at every possible step saves not only time but money.

    Intelligent people are not just the ones who are the most flexible, but are absolutely the ones who are the most singular and focused on the job at hand. And on top of it, if they are passionate about their work too, then more power to them.

    I agree that with your point that learning should never end and that adaptation and flexibility is key to growth. But, you need to learn respect and be understanding of those people who are most in-depth in their work too. On your point about flame-wars being stupid, I completely agree.

  71. "Normal Spring/Hibernate" by FatherOfONe · · Score: 2, Interesting

    I would read the article but the site is down.

    My first issue with this is that he uses spring and hibernate and then compares speed. WTF is this about? You use an OR mapping tool that is fairly robust and you then talk about speed? Why didn't he just code all the SQL by hand and forget Hibernate. On a LOT of applications this would perform much better. Heck he could even rip Spring out and again do what he needs by hand.

    How much would that have reduced the size?

    Now for my next question. How did both applications scale? Where both speeds acceptable at the required load/user level? Heck if you are building a system that you want to maintain, and potentually switch out databases, then Hibernate ROCKS. Yes there is some overhead, but for 99% of the applications on todays hardware this will not be an issue.

    --
    The more I learn about science, the more my faith in God increases.
    1. Re:"Normal Spring/Hibernate" by jgehtland · · Score: 3, Informative

      Wow. Well, just a quick history of the post: I wrote an app in Spring/Hibernate. I then, as an experiment, rewrote it in Rails. I liked the result, and blogged about it. Not "everyone must dump Java right away", just "I had a good experience doing this". The blogosphere demanded a more concrete comparison. I provided those numbers. I have not stated anywhere that these are reference implementations, that they are the fastest things available, etc. I did pretty clearly explain the requirements in the latest posting, and both applications meet the requirements handily. So, in sum, Rails solved my particular problem slightly better than Java/Spring/Hibernate. And the code is more fun (for me) to write. Is that really such a controversial statement?

  72. Re:Here we go again by hugg · · Score: 3, Interesting

    I am not a J2EE fanboy, but I depend on it for my bread and butter. As long as I work within the federal/enterprise development sphere, I will probably depend on it for quite some time. This is because big organizations in the U.S. are standardizing on J2EE, and to some extent dot-NET.

    One reason for this is because their IT departments discovered a few years ago that they have accumulated all sorts of crufty code written against multiple languages and platforms, and had no way to manage it because all the contractors who wrote it had taken the money and run. Seeing shrinking IT budgets, and new platforms (like ROR) coming out every year, they decided to make their lives easier by standardizing on the most best-of-breed (read: most resumes available) platforms. This would allow their IT folks to only have to learn one set of technologies to deploy and manage applications internally.

    IT managers like standard platforms, because they are sold on the idea that they can develop "web services" which can let apps "transparently share data" and allow for "collaborative whatchamacatchie". Most often, the reality is that these organizations still have a tremendous amount of data scattered across N databases and M organizations, and no magic dev platform is going to solve that without effort.

    I regard most of the J2EE architecture as over-engineered and overkill on most projects I've done. I prefer to use it stripped-down as I can get away with. Heck, I could probably embed a Jython interpreter in a servlet and use it on a project without anyone noticing. But for large organizations, the trend is toward less diversity.