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?"

555 comments

  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 Hard_Code · · Score: 1

      Unless the adjective optimized applied to the noun bytecode and not compiler...

      --

      It's 10 PM. Do you know if you're un-American?
    6. Re:Faster? by sporty · · Score: 1

      Yeah, but even in JIT, is it reducing the memory foot print? Recompiling code ala hotspot did in the JVM at some point? Optimized is still a throw-around word.

      --

      -
      ping -f 255.255.255.255 # if only

    7. Re:Faster? by Karma+Sucks · · Score: 1

      I call bullshit.

      I've been following Ruby for a while and practically no-one in the community has any interest in Parrot let alone CPAN.

      Most of the excitement and focus is on the new Ruby VM Rite as OP mentioned.

      --
      (Please browse at -1 to read this comment.)
    8. Re:Faster? by Anonymous Coward · · Score: 0

      No interest in Parrot... But interest in CPAN is not unexpected. I am a Perl-user-turned-Ruby-user, and the only thing I miss from Perl is the gigantic collection of libraries for it. The lack of a large repository of good modules for Ruby (and a good way to manage them; I don't like rubygems) is just about its only drawback. If I could have CPAN modules available in Ruby, well... That would just be fab, far out, and bodacious.

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

      Nobody told me there would be sentence diagramming.

    10. 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.)
    11. Re:Faster? by zaxus · · Score: 1

      You must be new here....

      --
      /. zen: Imagine a Beowulf cluster of Beowulf clusters...
    12. Re:Faster? by Anonymous Coward · · Score: 0

      IT'S SLOW!

      End of story.

    13. Re:Faster? by zardo · · Score: 1
      I would agree with this. I moved away from Perl because I didn't like the language, CPAN was nice but the problem I had is that everything on CPAN was written in Perl. Typically when I convert my old perl code to ruby it ends up being anywhere from 10-50% the length of the perl code, so given the choice between converting code to ruby by hand or using some old perl library, I tend to go for the ruby effort.

      I don't know what to think about Parrot, it'll probably make sense to use language independent technologies and get unified drivers and stuff like that, but I dont intend to use any other languages, I *really* *really* like ruby's syntax.

    14. Re:Faster? by cintyram · · Score: 1

      depends on whether it is (optimized bytecode) compiler or optimized ( bytecode compiler) cheers ram

    15. Re:Faster? by idlake · · Score: 1

      "Optimized" doesn't mean that it works better in every case. In fact, it is common for compiler changes to make some code run faster, not change the performance of a lot of code, and make some code run slower.

      Compiler writers try to make optimizations that make the common cases work better and only cause slowdowns in unimportant or rare cases. They may also give you lots of options to control detailed optimization behavior (hence all those optimization flags on gcc). And, more recently, they have tried to select optimizations automatically based on profiling and benchmarking data (particularly useful with JITs, where it can be fully automated, but also possible with batch compilers).

    16. Re:Faster? by ajs · · Score: 1

      "I've been following Ruby for a while and practically no-one in the community has any interest in Parrot let alone CPAN."

      Well, you're looking at it from one point of view. The Ruby-on-Parrot effort is quite strong, and while it does await finial Parrot semantics for some basics Ruby needs, there's already a primative parser in the Parrot source tree, contributed by Ruby developers.

      I think you're confusing BUZZ with INTEREST. Parrot development doesn't generate much buzz because it can't be used for anything real-world yet. That is changing rather quickly these days, as Pugs pushes forward finalization of many Parrot features.

      As for CPAN... I don't expect anyone's sitting around saying, "oh, I'll just put off everything until I have access to CPAN," but there's no denying that transparent access to the world's largest source code programming moudule repostitory wouldn't hurt Ruby at all!

    17. Re:Faster? by Anonymous Coward · · Score: 0

      Cardinal is DEAD.

      The devels didn't have the required skills. Heck, they didn't know how to use a parser generator resembling yacc.

    18. Re:Faster? by Anonymous Coward · · Score: 0

      Ruby on Parrot (Cardinal) is DEAD.

      The people working on that were not skilled in that domain. It was all wishful thinking.

    19. 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

    20. Re:Faster? by MajorDick · · Score: 1

      Yeah like AOL Optimized 9.Slooooooooowwwwww

      Not neccesarily, Optimized could actually mean smaller bytecode (which usually does not equal Faster)

      Theres fast and theres small which one are you optimizing , they can be mutually exclusive.

    21. Re:Faster? by Anonymous Coward · · Score: 0

      Who comes up with these names?!

      Imagine trying to sell a Ruby-on-Parrot+Ponie solution to your boss and convince him that you're not yanking his chain and talking about transsexuals.

    22. Re:Faster? by Karma+Sucks · · Score: 1

      Hey, he got modded up to +5. Who are we to argue? ;)

      --
      (Please browse at -1 to read this comment.)
    23. Re:Faster? by NaruVonWilkins · · Score: 1

      I thought you said Slashdot jumped the shark, and that you were going to kuro5hin for a long while? You still seem to be here. :)

    24. Re:Faster? by Anonymous Coward · · Score: 0

      I consider Parrot a vaporware now. It has taken years and years without any real-world demo now. And I don't think the concept will fly either. Sure, it's CLR for scripting languages. In the end, many specific languages' features must be cut/compromised, just like .NET.

      So I rather put my eggs on language-specific VM's like YARV... Let Parrot become the VM for Perl5/Perl6 and that's it.

    25. Re:Faster? by Anonymous Coward · · Score: 0
      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,

      No, and no. If the optimized compiler spits out byte code at a faster rate, this will have no effect at all on the speed at which applications start. In the JVM, applications are loaded from files that already contain bytecode. Converting source code to bytecode is done at build time, not at application load time. Also, the rate at which the compiler can generate bytecode will have no effect on JIT compilation in any way at all. JIT compilation takes the existing bytecode (which was put into classfiles at build time and which does not change at runtime) and converts it -- at runtime -- into machine code. From the point of view of the JIT, it doesn't make any difference whether that bytecode was produced nearly instantaneously by a super-fast compiler or whether it was hand-built by thousands of monks and entered into the computer using punchcards, because the bytecode is just data in a file.

      However, you are correct in pointing out that the slashdot abstract is unclear. It says that it is "a new optimized bytecode compiler", whereas what I expect they mean is "a new optimizing bytecode compiler".

    26. Re:Faster? by Anonymous Coward · · Score: 0

      If it spits out "better" bytecode, then we'll see speed increases.


      The current Ruby (1.8.x) is not byte-compiled.
      That's why we expect Rite (= v1.9.x + YARV)
      to be faster.
  2. how fast can Ruby on Rails go!? by Anonymous Coward · · Score: 0

    GO RUBY GO!

  3. ROR? by Anonymous Coward · · Score: 0, Flamebait

    ROR bites. Try zope instead.

  4. 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.

  5. Here we go again by pj-allmod · · Score: 1, Insightful

    Nothing like fanning the flames of an already hot topic between J2EE & RoR developers. Just watch, it's impossible to have an intelligent discussion between the two groups.

    1. 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?

    2. Re:Here we go again by I+confirm+I'm+not+a · · Score: 1, Offtopic

      Nothing like fanning the flames of an already hot topic between J2EE & RoR developers.

      Oh, I don't know! On the pro-Java forum theserverside.com, where this article has already been covered, they're pretty open to the Ruby-on-Rails community...

      (Warning: you may want to wait 361 days - crap April Fools ahead)

      --
      This is where the serious fun begins.
    3. 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.

    4. Re:Here we go again by Anonymous Coward · · Score: 0

      Whoa there buddy. There are times when it is good to know a bit of everything and there are time when it is good to have detailed knowledge of one thing. No need to be all defensive if you belong to one camp or the other. Like you said, use the right tool (or person in this case) for the job...

    5. Re:Here we go again by Anonymous Coward · · Score: 0

      This is almost always because of the J2EE morons.

      The Ruby people are generally very open. This is one of the reasons why Ruby got so popular.

    6. Re:Here we go again by TrekCycling · · Score: 1

      I agree. I'm not being defensive. I'm just arguing that if there are Java (or Ruby) "fanboys" out there who argue the case for their chosen platform purely for the sake of job security, then they are doing it for the wrong reasons. There is nothing wrong with depth. And obviously depth and breadth are often at odds with each other unless you have tons of time on your hands. However, I'm just proposing that for those programmers out there (Java or Ruby) that are siloed into their given technology, the depth of knowledge they have is wonderful. In fact, as a junior level developer in everything with breadth, I will likely call on their expertise and my team will need a few of them around as architects. So I'm by no means demeaning depth. I'm simply saying that while depth and breadth are often at odds with each other, I know people that won't go broad, not because they don't have time, but because they refuse to. I've met many highly intelligent software developers that can't install Windows. Or don't know how to use the Linux command line. I've had to install Windows for many of said developers while also being their peer as a developer. So my point is that while depth may be a virtue, depth for the sake of protecting yourself is not. You owe it to yourself and your organization to gain more breadth...

      A) So people like me don't have to install your OS or teach you how not to destroy it when you're supposed to be productive.

      B) If something like RoR comes along you can give it a fair evaluation. And even if Hibernate is your technology of choice, at least you've made an informed decision.

      I think that's fair, isn't it?

    7. Re:Here we go again by ogleslurp · · Score: 1

      I'd say that's pretty well put.

      I've traditionally been a breadth man. For prototyping, rapid development and non performance-intensive stuff it's worked out for me. In fact, at work I do a little bit of everything, with all of the languages we use (Perl, Python, Ruby, C/++, VBA) and my level of comfort with those languages helps us be a little more flexible.

      On the other hand, Ruby has inspired me to go for depth. I _really_ enjoy using it, and for me that's awfully important. I can use a lot of other languages for easy things, but when the going gets tough, I like Ruby because it doesn't seem to fight back quite as much.

    8. 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.

    9. Re:Here we go again by atlacatl · · Score: 1

      Sorry, you do seem defensive on the "depth/breath" issue.

      Anyway, I see the point of not being adventurous. But, you have to look at where the push is comming from: some guy that wrote the book is pushing the whole framework to the plebs.

      I don't believe it's about job security, like you suggest: "Scared of loosing a job."

      You have to look at it from a different perspective than the idealistic developer attitude of fixing everything and doing everything with technology "X."

      Also, being a technologist is probably not the same as a Software Engineer/Developer. Being the latter involves coding applications that will be maintained by a large group of developers 5 to 10 years from now. If you look at Java, it's exactly what happened with its evolution - The J2EE architecture works well for large scale development and will likely stay that way for a while.

      Scripting languages, on the other hand, come and go. Perl is an extremely useful language and very productive, however, once the original developer is gone it becomes extremely hard to maintain any code such person developed.

      I'm not saying that either approach is wrong, or that we shouldn't use scripting languages - However, you can't go overboard porting all your applications to the new "new thing" just because it is going around the blogs. This year is probably Ruby, next year it may not.

      Also, we shouldn't point fingers at "depth" guys just because they say "no" to "X," where x is in the set {PHP, Rubby, perl, etc, etc}. They have their reasons: budgetary reasons, political reason, maintanability reasons, etc, etc.

      It's funny, every year something comes along that say "X is much better than J2EE." And we're not even done with PHP, and we already have Ruby. So, which one is the scriting language that makes you a better developer, is cheaper to implement, make you a super developer that never writes bugs into code? Right...

      I say we should keep an open mind and embrase anything that makes you productive in the environment you want to work in. Scripting languages have their place, but it is not in large scale development engagments, where maintainable multi million dollar projects are involved. At least not yet - And I haven't come across any "depth" guys that would bet their careers on a scripting language, unless it's the inventor of it, or write books about. I don't do either (invent scripting language or write about them), hence, I don't complain - Plus the more diluted the market is, the better for some "depth" fanboys :)

      --
      Esta es una firma en Espanol.
    10. Re:Here we go again by TrekCycling · · Score: 1

      But we're not talking about companies here. The original poster in this sub-thread was talking about the inevitable flamewars between Java and Ruby proponents. I would be the first to agree that the long-term and short-term (while often at odds with each other) interests of the organization will dictate what technology is used. But that shouldn't dictate what technology the developers learn and what technologies they advocate for or whether they advocate for a technology at all. I think that's the point. Of course a company heavily invested in Java will stick with Java for some time. It would be insane to switch. Heck, there are companies out there running Visual Basic and Access with Access Forms, because in order to keep operational from day to day that's what they have in place and they don't have the funding to change the wheels on the plan in mid-flight.

      However, that doesn't mean that the developers should be willing (time permitting) to give other technologies a look and maybe even be open-minded to them being superior to what they're currently forced to use.

      The original poster was referring to these silly flame-wars that break out over whose platform is the best. When in reality the correct answer is to try to learn how to use screwdrivers and hammers so you don't end up taking hammers to everything.

    11. Re:Here we go again by TrekCycling · · Score: 1

      I never said anything about "loosing a job" (it's "losing"). If you're going to quote me, at least don't misspell it, lest someone think that was my typo.

      Secondly, if I seem defensive, then that's your perception. I simply think it's a shame when someone with depth won't even take the time to gain just a little breadth. To be able to competently evaluate something like Ruby before declaring it inferior. That's all. *Remember, the original poster of this sub-thread was referring to the inevitable flame-wars over whether Ruby or Java is superior.*

      So my problem with guys who have depth isn't that they have depth in and of itself. As I said in another post, every organization needs those guys. However, I believe it's in the best interest of the organization and the individual to also invest in some breadth. What I find silly is when someone becomes a Java expert then spends their time on message boards, blogs, Usenet groups, etc. railing against technologies, platforms, etc. that they know nothing about. That's my beef. I care not a whit that there are people in this world that know more about Java than I do. In fact, many of these individuals have been excellent mentors to me as I transitioned into Java. However, what I do care about is that these individuals don't discount other technologies simply to save their job or because they don't have any interest in learning new technologies.

      My point being that if you don't know Ruby how can you have an opinion on it that's educated?. And if you don't know Java how can you have an opinion on it that's educated?

      So no, I don't believe I'm being defensive. I just find it to be poor form when someone is an expert in a given technology and then completely discounts other technologies.

    12. Re:Here we go again by C10H14N2 · · Score: 1

      ..right, which is why I pointed out the source of the opposing sides. Perhaps I wasn't blunt enough. My previous post can be restated:

      "Why aren't you using this?!? It's the BEST!!!"

      "Erm, no, this is currently better for me, thanks. Not really interested, too expensive, unstable, blah blah blah, you know the drill."

      "You suck! What are you too stupid to learn a new language? You scared of change? Oooh, must feel really safe only using your favorite language."

      "You must live in your mom's garage. I work for IBM and already know fifteen languages, five of them spoken. Piss off."

      Rinse. Repeat.

      My point is that the roles reverse depending on the [something] vs. [something else], but the cause is generally the same. So, when Java/J2EE came around everyone bitched because they just luved [whatever] and that was just so much extra abstraction and bloat yadda-yadda--and, at that point, why the hell does EVERYTHING have to be on the freakin' Web anyway? Can't we just keep these old curses apps that have worked since the dawn of time and run on a server that is little more than a glorified pocket calculator? Well, after a few years, companies (the ones who write the individual's paychecks, so it's rather presumptuous to separate the individual from the company in these arguments for that reason, IMHO) started embracing Java/J2EE because it was safe. Now other languages and frameworks like Ruby are coming along and becoming safer bets to entertain, but people are comfortable (that is to say "not threatened," although they may be pained) with Java, so most of these flames can be translated into "goddamnit, I spent ten years building everything in [x], then five years rebuilding every goddamned thing in [y], now you want me to spend the next three years rebuilding the same f!@$ing thing in [z]?!"

      So, we just use the above "yo momma" shorthand because we assume that we've all heard this song before and no matter if you replace the Hammond Organ with the London Philharmonic, it's still the same tired old tune.

      See? It was on topic. If we keep this thread alive and turn it into a flamewar it'll REALLY be on-topic, non?

      Here, I'll start: you didn't get it the first time around because you're fapping to pr0n in yo momma's garage you Ruby-loving hippie...

    13. Re:Here we go again by rbanffy · · Score: 1
      they're worried that RoR becoming popular would invalidate their 5 years of J2EE experience

      Alter enduring that kind of pain, I would be sympathetic to the Java programmer that fears any other technology could invalidate his/her suffering

    14. Re:Here we go again by tota · · Score: 1

      Mod up!

      Couldn't agree more!

      --
      TODO: 753) write sig.
    15. 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.

    16. Re:Here we go again by Anonymous Coward · · Score: 0

      My experience is in everything from ASP with VB/Script to PHP to Java.

      Umm, that really doesn't sound like everything to me.

    17. Re:Here we go again by TrekCycling · · Score: 1

      Oh boy. Calling people ignorant and arrogant (and useless) is a sure fire way to keep the topic on an intelligent and reasonable level. Also it displays a level of ignorance and arrogance as well, no?

      I disagree completely with what you're saying. I "roll my eyes" at your "real corporation". I've worked for "real corporations" my entire career. And at every place I've been they've needed generalists and specialists. Sometimes, some "real corporations" are so small they need mostly generalists because that person has to run the servers, do desktop support AND do development. Sometimes if they're bigger these "real corporations" need generalists to be the glue that binds together all the specialists. Help with the servers. Do some front-end work. Write tests. Help teach people how to use CVS. To fill in the gaps, basically. I've never had problems finding work, nor being useful as a generalist.

      You say depth is more valuable, but how do you quantify value in your "real corporation"? I agree that most companies with projects of any kind of scale need specialists. I'm just arguing in favor of those specialists being less specialized and being willing to be more broad. Nothing more.

      Besides, I define value as the work getting done. And often times in order to get the work done you have to have intelligent flexible people willing to do whatever is thrown at them and sometimes the nature of the platform changes. And I want people around who can adapt. That's all I'm saying. Thus the Ruby vs. Java flamewars purely to protect one's turf are silly. That's my point.

    18. Re:Here we go again by TrekCycling · · Score: 1

      You don't understand the use of the word everything in that phrase? Come on. Seriously?

      It's like saying "I play all kinds of video games, everything from Madden to Final Fantasy". It doesn't mean I play every video game on the planet. It means that I play many different video games, including the following and a few more that I won't bother mentioning.

      I thought that usage of the word was well known and understood and didn't bear being picked apart tediously.

    19. Re:Here we go again by iamthetru7h · · Score: 1

      Oh yeah? YOUR MOM

    20. Re:Here we go again by TrekCycling · · Score: 1

      There are people who happen to use J2EE and then there are the J2EE "morons" as you call them. I know from being a Java developer the last 4 years in a J2EE environment that the majority of J2EE developers are intelligent people interested in other technologies. They program Python when they need it. I've known many who ignore IDEs like Idea in favor of Emacs. I've known many who love PHP. I agree that there are morons out there. People who defend their silo for reasons other than technical grounds. Those people might be considered morons.

      I do agree with what you say about Ruby. I have only brief and fleeting experience with Ruby. I hope to learn more later when I have time. But in the brief time I've worked with it I've found everyone to be helpful and fun and open-minded and.... well... pragmatic (to steal from the author of the PickAxe).

      In summary I think there are less boosters of Ruby than there are boosters of J2EE. So your statement rings of truth, but I wouldn't call them morons.

    21. Re:Here we go again by b17bmbr · · Score: 1

      this reminds me of the story about the company that wanted to settle on a single server technology, and left the choice to its IT dept. of course, there were twice as many windows admins for the same number of servers, so guess which "technology" they voted on?

      i do alot of LAMP (well, OS X and AMP), mostly php, but some perl. i don't know what is more important, the absolute best technology, or one that a developer can generate a stable, secure, and effective solution, in an acceptable time frame. sure, there are the amazons and ebays, etc., for whome a 5% difference will mean alot, but for most sites, i think there will be little difference. however, alot of sites won't have access to every technology especially if they have shared server hosting. even if they have full root access, they still might prefer to go with a particular technology, no matter its merits. for example, if i said to a client, "hey, i'll do this on ROR, but, you gotta install x, y, and z, on your server..." well than it gets harder. even if working for larger firm, or on a larger site, what is more expensive nowadays? throwing one more server at the problem, or rewriting the entire codebase?

      not an argument against learning anything , hell, if had the time, ROR looks cool. but how long until php became acceptable? is it better to be really good at A or able in B, C, and D? specialization vs. generalization? tough call.

      --
      My problem? I was perfectly gruntled, until some numbnuts came by and dissed me.
    22. Re:Here we go again by d34thm0nk3y · · Score: 1

      I have noticed that some people can wrap up so much of their personality in a particular subject (technological or physical no diff. really) that they get very defensive when challeneged. The threat can be as small as voicing an opposed opinion but the response always has a particular hyperactive tone to it that is unmistakeable. I like to poke these people and see what they do. I guess I have some trollish tendencies, but really it is just curiosity. I just cannot understand how a mind can work in this fashion.

    23. 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.

    24. Re:Here we go again by TrekCycling · · Score: 1

      I can see where you got that mistaken impression, but please reread my initial post.

      First off, I said "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."

      So I'm starting my post by arguing against the original posters assertion, saying that it isn't really "these two groups" who are two blame for the language flame-wars, but rather individuals (in both camps, mind you, I just pick on the J2EE camp because that's what I know). I use the term "fanboy" intentionally. Because it reminds me of the same psychology that drives someone to berate XBoxen or the GameCube or the PS2 simply because they are a huge fan of one of the other 3 systems. This similar detachment from open-mindedness and flexibility is what I was arguing against. And I was trying to make the point that it wasn't J2EE developers writ-large to blame, but rather individuals who had become so entrenched in their technology that they had a self-interest in not learning other technologies or giving them an open look.

      I believe these developers do exist. I've never known them personally. Ever Java developer I've personally worked with has had side interests in everything from Scheme to Lisp to Python to Ruby to PHP to .NET. They just became Java specialists because of the toolkit or because that was the nature of their work. So I believe they exist, thus I did go off the rails a bit (no pun intended) and talk about the virtues of having broad experience, but mostly to support my idea that the individuals who engage in flame wars, on both sides, are possibly misguided by their interest in protecting their investment in time spent learning their trade. And that these are individuals who are to blame for the flame-wars, not the two camps at large. So I will agree that my argument wasn't entirely coherent, but that was the point I was trying to make.

      I have great respect for those with depth. In fact, they're why I'm primarily a Java developer today. That and my own hard work. However, I was just trying to make the point that for those other individuals, the ones for whom Java is the end and not the means, they should consider broadening their technical expertise for the sake of their organization and themselves.

      In the end, you're correct and I think I echoed this. Passion for your work (as opposed to passion for keeping your job at all costs) and the desire to work hard to do the job at hand, regardless of the tool required, are the traits I admire in fellow developers. Java, for many organizations, is the answer. I personally believe in it myself as the answer to many problems. Thus the reason I seek work doing it. However that won't stop me from giving Ruby an honest look. And it also means I'm never going to become a participant in a Ruby vs. Java or PHP vs. Java or .NET vs. Java flame-war.

      Now if one is an expert in Ruby and Java, then by all means give me your opinion. But otherwise, discussions of that nature are useless.

    25. Re:Here we go again by TrekCycling · · Score: 1

      I know it's bad form to reply to yourself, but I found this on a Nintendo DS message board and it seemed appropriate to this current sub-topic.

      http://img.vgcats.com/050404.jpg

      I'm a gamer, so not only have I been witness to the...

      Windows vs. Linux
      GTK vs. QT
      Gnome vs. KDE
      Python vs. Ruby
      Ruby vs. Java
      PHP vs. Java
      Emacs vs. vi ...flame-wars, but I've also been a party to countless gaming flame-wars. And in the end they all devolve and become pointless. Granted the stakes are higher when you're talking about Ruby vs. Java or GTK vs. QT. You're talking about making decisions that impact a project and perhaps a company for years or decades to come. But in the end all I ask is for both sides (if they must engage in debate) to first actually debate and secondly to do so from a neutral, open-minded and informed point of view.

    26. Re:Here we go again by computational+super · · Score: 1
      everything from Madden to Final Fantasy

      But in the context you used it, it's more like "I play all kinds of different video games, everything from Mario Brothers to Super Mario Brothers."

      --
      Proud neuron in the Slashdot hivemind since 2002.
    27. 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.

    28. Re:Here we go again by TrekCycling · · Score: 1

      No, not really.

    29. Re:Here we go again by peatbakke · · Score: 1
      So, Ruby has now reached the point where it is a serious contender. Expect it to start replacing J2EE somewhere between 2008-2010.

      Java is big for two big reasons:

      One, it's a pretty good language. Not great, not fabulous, but as an alternative to C++ it was major step in the right direction at the time it arrived on the scene. It came at the right time, from the right place. On the other hand, Ruby is a pretty darned cool language, but it's not as special as Java was at the time -- it's one of a half dozen popular high level scripting languages in a relatively lean marketplace.

      Two, Java started with a major marketing budget, has had 10 years of Big Corporate Pimping behind it, successful high visibility lawsuits, and the enormous growth of the dotcom era. Today, there is no political leverage to be gained for businesses who want to adopt or push Ruby in the marketplace.

      Ruby isn't a revolutionary language/environment, like Java was, and I don't expect it will be replacing J2EE in the business world any time in the next 25 years. Heh. Our children will probably be cursing Java, just as we curse COBOL and Fortran. ;)

      I like Ruby, but I really don't think it'll be the next Java unless a major business steps up to the plate and makes it the cause du jour. However, it wouldn't surprise me if it followed the same path as Perl as a phenomenally successful tool, rather than a phenomenon in and of itself.

    30. Re:Here we go again by atlacatl · · Score: 1

      The double "oo" was my mistake - Either I have an over sensitive keyboard, or I'm a gooooof and kan't spel - We'll just never know...

      Anyway, I think we both agree on this one. I do find the overzelous technologies to be bit a close minded - Again, if you are the promoter of the tool or book or scripting language, you should be. After all, some company is probably paying to be titled "Evengelist" or your livelyhood depends on it.

      I'd look further into why someone shuts down an idea or a suggestion to use "X." There's probably a good reason for it. However, if you really think that your idea or suggestion is really good, why not push it all the way if you really believe in it (I don't mean you specifically - I mean anyone). I'm quite certain that "depth" guy can and will accept a good idea or suggestion. Perhaps the approach that needs to be taken is the by pointing how much "money" everyone will save.

      If your suggestion gets shutdown, and you don't fight for it, maybe it's not the best approach in the end - Again, I don't mean specifically...

      --
      Esta es una firma en Espanol.
  6. any comparison like this... by fedork · · Score: 1, Insightful

    ...

    without reading TFA, any comparison of this sort does not have much value. Maybe if he reimplemented his app using same Java he would get 50% speed and codebase improvement? Maybe the original was just too poorly coded /overengineered / whatever? Ruby on Rails MAY be much better but any evidence like this is hardly valuable, that's why I would not even bother to RTFA

    --
    ...remember good 'ol times when IP used to mean Internet Protocol....
    1. Re:any comparison like this... by RazzleFrog · · Score: 1

      Well if the original was poorly coded or overengineered it may speak to the adequacy of the development platform. It may be that RoR is just an easier platform to develop well written applications.

    2. Re:any comparison like this... by rbarreira · · Score: 1

      Yeah, this comparison on slashdot's page makes it seem like a really intelligent site... "Look, some random guy who maybe knows how to program well with java thinks it's slower than Ruby!"

      Give us a break...

      --

      The AACS key is NOT 0xF606EEFD628B1CA427BEA93A9CA9773F
    3. Re:any comparison like this... by OwnedByTwoCats · · Score: 1, Insightful

      I can't read TFA; slashdot effect?

      Reimplementing any app, changing the language or no, results in a better implementation, because the (re)implementor has a better understanding of the problem.

      If he were to go back and redo the Java app in Java, it would be interesting to learn how it turned out.

    4. 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
    5. 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

    6. 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
    7. 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

    8. Re:any comparison like this... by fedork · · Score: 1

      no doubt it might, the point is that the example in the article is pretty meaningless/ does not prove anything...

      --
      ...remember good 'ol times when IP used to mean Internet Protocol....
    9. Re:any comparison like this... by northcat · · Score: 1

      You post looks like a poor attempt at saying "no way, java still rules."

    10. Re:any comparison like this... by Anonymous Coward · · Score: 0

      You say over engineered, I say the right tool for the job, or at least some jobs. I'm familiar with ROR and the Spring/Hibernate solutions. ROR looks best suited to quick, simple database driven websites. On the other hand, Spring/Hibernate is targeted at larger scale web applications. Would you trust ROR to handle your banking transactions? I wouldn't. I'd be more likely to trust Spring/Hibernate, seeing that Hibernate is the primary implementation of the future j2ee ejb 3.0 spec.

    11. Re:any comparison like this... by TrekCycling · · Score: 1

      Me thinks someone is a J2EE developer who doesn't want to have to learn something new down the road. :-)

    12. 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.

    13. Re:any comparison like this... by Anonymous Coward · · Score: 0

      You make it sound like Java is the only language that can do SOAP, CORBA and RMI.

    14. Re:any comparison like this... by The+Fun+Guy · · Score: 0, Offtopic

      I have nothing to contribute to this discussion of RoR, but I have to complement you on your sig. Seeing "i.e." and "e.g." used interchangeably is almost as irritating as hearing people use "literally" as a meaningless intensifier, e.g. "She was so mad, she was literally on fire!"

      --
      The man who does not read good books has no advantage over the man who cannot read them. - Mark Twain
    15. 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.

    16. 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.

    17. Re:any comparison like this... by killjoe · · Score: 1

      Yes you can specify the table name and the primary key but that's all. You can't map a field called "fname" to an attribute called "first_name" though. That's something you can do with hibernate.

      --
      evil is as evil does
    18. 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)
    19. 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.

    20. Re:any comparison like this... by yerfatma · · Score: 1

      I dunno, but I'd trust a developer who investiagted solutions other than Java over the guy who graduated 10 years ago knowing Java and stuck with that.

    21. Re:any comparison like this... by WhiplashII · · Score: 1

      Unfortunately, this is not necessarily true. For example, let's say that your code has this one loop where all the time is spent:

      for (int cnt=0; cnt
      (OK, silly example, bear with me)

      Implemented in (insert favorite language here), this code is optimized to a shift operation. Implemented in (insert rival here), this uses the processor's divide function. The favorite beats the rival, we declare victory!

      Except that we have only really shown that our favorite is better then its rival in one case. It would be better to explain that case so that others can make reasonable decisions based on the job at hand. For example, in this case is it Java that is slow? Is it the Spring/Hibernate thing? Is it method calls? Is it math operators? Is it networking?

      I wish I could read the site, but it seems that this was really just a fanboy saying he is better than the other fanboys... I would like to know in what edge cases one is better than the other...

      --
      while (sig==sig) sig=!sig;
    22. Re:any comparison like this... by Anonymous Coward · · Score: 2, Funny

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

    23. Re:any comparison like this... by WhiplashII · · Score: 1

      Arg! That was supposed to be:

      for (int cnt=0; cnt<100000000; cnt++) f=f/8;

      --
      while (sig==sig) sig=!sig;
    24. Re:any comparison like this... by Anonymous Coward · · Score: 1, Interesting

      Uh, but he didn't even really know Ruby well before starting. And he is an extremely experienced Java programmer. I would say those cancel each other out.

    25. Re:any comparison like this... by snorklewacker · · Score: 1

      What about if your data comes from a stored procedure?

      Granted, it's kind of painful in java O-R mappings too (I admit much ignorance of Hibernate however), but they are possible.

      --
      I am no longer wasting my time with slashdot
    26. Re:any comparison like this... by snorklewacker · · Score: 1

      > Notice that Slashdot is written in Perl, with nearly all dynamic pages.

      I would not be holding up slashdot as an example... Anyway, the pages are spit out to a squid cache that's refreshed on change. That's a good way to design a blog or CMS, but I wouldn't try it for the inventory parts of e-commerce (should work fine for the product descriptions though).

      --
      I am no longer wasting my time with slashdot
    27. Re:any comparison like this... by swimmar132 · · Score: 1

      No idea. Sorry. Ask the mailing list for rails if you really need an answer.

    28. Re:any comparison like this... by Samus · · Score: 1

      From what I've read ruby uses an internal threading implementation aka "green threads" This will of course lead to being bound to a single processor so without the use of forking a dual cpu box wouldn't really benefit much. I don't know if it suffers from the python equivalent of the GIL (Global Interpeter Lock). The gil in python effectively eliminates any meaningful multi-threaded capability since only one thread can process byte code at a time.

      Another thing there was a comparison between hibernate and active record on theserverside a week or two ago. Active record can easily fall prey to the n+1 query problem where as hibernate is much more mature. You don't have to use active record. It's possible to plug in another orm implementation but the scaffolding code that is generated will use it.

      Note this may not be entirely accurate but it should be close enough.

      --
      In Republican America phones tap you.
    29. Re:any comparison like this... by zardo · · Score: 0, Offtopic

      Dude, you have no idea, why are you even commenting? Do you just comment because you have nothing better to do? You're a troll... where are my mod points when I need them?

    30. Re:any comparison like this... by dubl-u · · Score: 0, Troll

      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.

      Having seen the guts of a fair number of alleged enterprise-scale Java applications, I encourage people not to believe the hype.

      If you have a really good understanding of what it means to build a scalable web app, some of the J2EE stuff may be of use to you in some circumstances. But unless you really know which pieces to use and when, you're better off not using any of it. Why? Two reasons:

      First, if you use the wrong pieces or the right pieces in the wrong places, you'll make things much worse than they'd be otherwise. On several projects I have made an application run 10x faster, consume a tenth the memory, and become much easier to work on by ripping out all the EJB nonsense.

      Second, most projects just don't need massive scalability right now, and very few of them will ever need more than you can squeeze out of modern commodity hardware. By paying for scalability too soon, you slow development, forgoing features or spending capital that could mean the difference between success and failure for your project.

    31. Re:any comparison like this... by killjoe · · Score: 1

      I don't want to get into a pissing match here but...

      Sure ROR has soap support but it's rudimentary, for example it does not support complex objects.

      I also don't disagree that there are messaging and remoting technologies available for ruby but they are not integrated into the framework that is ROR. This is in marked contrast to J2EE in which the framework is comprehensive and unified.

      As for the database design as I said right now it does not support field name mapping. That is kind of a minimum requirement for working with existing data. I am sure it's possible to make it work but it should work out of the box if ROR hopes to compete with other frameworks.

      "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."

      I agree. It's certainly suitable to a class of problems. It does need to mature a bit though before it can compete with the java based frameworks.

      --
      evil is as evil does
    32. 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)
    33. Re:any comparison like this... by Anonymous Coward · · Score: 0

      I actually would... Remember 9/11? Slashdot was the ONLY american "news site" I could get into, and news snippets was posted all day by /.'ers. Ok, so /. obviously don't have the visitor potential that CNN has, but still... I was most impressed... CNN was completely dead.

    34. Re:any comparison like this... by ralphdaugherty · · Score: 1

      without reading TFA, any comparison of this sort does not have much value. Maybe if he reimplemented his app using same Java he would get 50% speed and codebase improvement? Maybe the original was just too poorly coded /overengineered / whatever? Ruby on Rails MAY be much better but any evidence like this is hardly valuable, that's why I would not even bother to RTFA

      This was modded insightful. What is actually insightful is TFA.

      rd

    35. Re:any comparison like this... by teromajusa · · Score: 1

      no doubt it might, the point is that the example in the article is pretty meaningless/ does not prove anything...

      Its a shame you weren't able to read the article. He's well aware that the fact that this is a second implementation makes comparisons problematic. He thinks theres more to it though.

      Regardless, that difference comes out to show the Rails app at ~30% faster than the Java version when caching isn't taken into account. If I am generous and say that half of the difference is due to optimizations in the model, that still leaves us a 15% better performance in Rails.

      I think its pretty clear from the article that he's not out to prove anything. He's giving his impressions of how they compare.

    36. 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.

    37. Re:any comparison like this... by Pflipp · · Score: 1

      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.

      Hibernate also completely stinks with existing databases. In my experience, there's nothing structurally wrong with a good O/R mapping (where data can always be reached in a non-OO way), but you simply can't expect to reach non-OO data in an OO way. There's SQL for that.

      --
      "We can confirm that Debian does *not* ship the version with the trojan horse. Our version predates it." [CA-2002-28]
    38. Re:any comparison like this... by snorklewacker · · Score: 1

      I attempted to reply to your reply earlier, but kept getting 503 errors. Slashdot seemed to be running smoothly in 2001. It's been less reliable ever since.

      --
      I am no longer wasting my time with slashdot
    39. Re:any comparison like this... by dubl-u · · Score: 1

      I'm not sure why my previous post got marked "Troll". But for the record, I'm sincere, and I think my many previous posts here on server-side development bear that out.

      I like Java and do most of my professional work in it, but I think EJBs were overhyped, and a lot of their use, along with fancy application servers, was managerial pursuit of silver bullets, rather than sound technical work.

    40. Re:any comparison like this... by davegaramond · · Score: 1

      True. I've been getting 50x errors at random for countless number of times in recent months.

    41. Re:any comparison like this... by harikiri · · Score: 1

      There are also technologies that can sit around the server that can boost speed, dependant on typical pages being served. A proxy can sit in front of a server (or collection of servers), and provide the cached, static data to visitors. Heavy load combined with backend queries would be the hardest to cache this way.

      --
      Man watching 6 MSCE's around a sun box, looks alot like the opening scene's of 2001:space odyssey...
  7. 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. --
    1. Re:Not fast enough for Slashdot... by zorander · · Score: 1

      It just loaded in 500ms for me on my crappy wireless connection--what are you talking about?

    2. Re:Not fast enough for Slashdot... by Anonymous Coward · · Score: 0

      Actually, the link is to a WordPress blog. I believe WordPress is PHP (?).

      Besides, it appears that the database died, not the application. MySQL sucks.

    3. Re:Not fast enough for Slashdot... by Anonymous Coward · · Score: 0

      I don't suck, YOU suck!

      -MySQL

  8. Nah by Anonymous Coward · · Score: 0

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

    Nah, that couldn't happend, could it???

  9. 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.

  10. 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: 1

      True. Hibernate uses xml heavily. I believe Spring does too. I couldn't get to the site mentioned to check out what he did with these, but I would guess the turtle-speed Xerces xml parser was used with the application launched from the Tomcat (which is only a reference server).

      These arguments against Java performance have been used before. Some programmer builds a Java web application with bundled, titan sized frameworks and wonders why their pure code based application in some other language dusted it and has a smaller size. Microsoft did this by comparing a pure .NET Petshop against the Java pet shop which was using Java Beans, several other frameworks, and a questionable setup.

      There are better ways of doing programming language comparisons. Web applications with bloated frameworks is not the way.

    3. Re:Ruby on rails performance by Anonymous Coward · · Score: 0

      Huh. I just looked at some EJB 3.0 examples that used attributes, and there wasn't a lick of XML to be seen. Maybe you just need an app server like Resin that doesn't make you do the work it should be automating for you.

    4. 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.

    5. Re:Ruby on rails performance by espressojim · · Score: 1

      Spring is really a bunch of toolkits with one branding. I do all my database work with spring, and I have only one XML config file that tells my software what/where the database is. If I was running in a container, then I wouldn't need any XML (aside from the configuration stuff for the container, but that's a write once type deal) to connect to my DB and run all my querries, stored procs, etc.

      I haven't yet jumped on the hibernate bandwagon yet, because I often do very complicated sql queries on large data sets, and tuning them for speed is important - and once you do that, it seems like you miss out on much of the power of hibernate, but you get all the bonus work of implementing hiberate. Spring is extremely easy to use, and makes my life a whole lot easier.

    6. 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. Re:Ruby on rails performance by swimmar132 · · Score: 1

      He was comparing the RoR and Java implementations of this particular application. In this case, a sort of non-trivial web app, RoR seemed to be the best fit.

    8. Re:Ruby on rails performance by sbrown123 · · Score: 1

      OS X uses Sun's JVM code

      Apple uses Sun's Java class library (1.4.2). The actual virtual machine (JVM) is completely done by Apple and is optimized for OSX. Apple does not (and is not required to) return any modifications to Sun as their virtual machine contains proprietary code owned by Apple. This is why you can not go to Sun's site to download a version of Java that runs on the Mac. You have to go to Apple (http://www.apple.com/macosx/features/java/).

      From my experience, and those of others, the Mac JVM is one of the slower implementations (I am only comparing IBM's, Sun's, and Apple's here). Much of this, in my opinion, is due to the fact that Apple offers Java more as a feature and probably does not dedicate the same level of commitment to the language as Sun. This is not a bad mark against Apple, since despite being slightly slower it seems to run perfectly on Apple's products.

    9. Re:Ruby on rails performance by sbrown123 · · Score: 1

      In this case, a sort of non-trivial web app, RoR seemed to be the best fit.

      There are people who see the reverse being true, where Spring+Hibernate are better suited for the non-trivial apps and Ruby on Rails is best for simple CRUD apps. Heres a quote from a comparison recently done between Hibernate and Rails:

      If you stick to the simple cases like single tables with a few associations, and you name your tables and columns right, Rails will likely do just fine, but for more complicated object models, Hibernate will be a better choice.

      http://www.theserverside.com/articles/article.tss? l=RailsHibernate

    10. Re:Ruby on rails performance by sbrown123 · · Score: 1

      and I have only one XML config file that tells my software what/where the database is

      I am not very familiar with Spring. That is why I stated that I was only guessing that it used XML heavily. I know Hibernate enough to now that it, on the otherhand, uses XML quite a bit. Thanks for the information on Spring.

    11. Re:Ruby on rails performance by curunir · · Score: 1

      Those are good points, but I think the larger critique of this benchmark is that the application he created isn't as complex as real-world webapps. Java's strength has never been running simple/small applications.

      Java's strength comes as complexity increases when other languages/frameworks breakdown due to their inability to scale (from a machine resources perspective and/or a developer maintenance perspective). It isn't until you've developed a webapp with 5+ developers and millions of lines of code that you truly begin to appreciate the power of the Java/Spring/Hibernate combination.

      But you're right...for a true comparison he should have used something like Resin (for XML and AppServer).

      --
      "Don't blame me, I voted for Kodos!"
    12. Re:Ruby on rails performance by swimmar132 · · Score: 1

      Did those people ever TRY using Rails on a complex application? The author of this article actually DID. And strongly preferred RoR.

    13. Re:Ruby on rails performance by mccoma · · Score: 1
      from my OS X box:

      java version "1.4.2_05"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_05-141.4)
      Java HotSpot(TM) Client VM (build 1.4.2-38, mixed mode)
      Apple ships Java with the machine and updates it via software update (this is why Sun does not need to have a download). Apple does some tuning, but the code starts as Sun's. Apple has given back some of its optimizations (some memory optimizations that I can't remember now).
    14. Re:Ruby on rails performance by Anonymous Coward · · Score: 0
      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.

      The speed to parse the XML configuration file is irrelevant. That parsing happens once per servlet context. Only things which happen once per request make a noticeable speed difference.

      True language performance comparisons should never be done with web applications.

      This isn't a language performance comparison. It's a comparison of two different ways of developing a web application. Look at the title of the article - it's not "Ruby Showdown with Java", and that's for a reason. And performance is only a small part of it; he basically demonstrated that RoR was sufficiently fast and left it at that. He stated that he could have optimized the Java code further, had he cared.

    15. Re:Ruby on rails performance by sbrown123 · · Score: 1

      from my OS X box:

      Wow. You can enter "java -version". Nice. Where does it say "Sun JVM"?

      Apple ships Java with the machine and updates it via software update

      Actually we can go round and round about who created wrote the code for the JVM for Apple computers. It still does not dispell the original argument that the Apple JVM is not the latest (1.5) or that it is slower, which is the point I mentioned in the post. Unless you can find proof on this otherwise.

    16. Re:Ruby on rails performance by sbrown123 · · Score: 1

      The speed to parse the XML configuration file is irrelevant. That parsing happens once per servlet context. Only things which happen once per request make a noticeable speed difference.

      There is nothing in my post about servlet contexts, when xml is parsed, or how often this is done. The point I was giving was that Xerces is not the quickest parser if speed is a concern. Both Hibernate and Spring both, at some point, read from a XML file or files.

      This isn't a language performance comparison.

      No, its not. Thats why if you fully read my post you would have read this:

      I know this was not your intent (doing language performance comparisons), but that is how your article is being viewed by others.

      There are hordes of Slashdotters who viewed the article that way, even though that was not the intent of the author.

      He stated that he could have optimized the Java code further, had he cared.

      Why even do a comparison than? I can write really crappy C code that can be beaten by optimized Python script. Posting results of a comparison would not be fair and thus shouldnt be done in the first place.

      A true performance comparison between languages should not be done with web applications. There is too much code that could be optimized better, frameworks used instead, in various parts that make true comparisons impossible.

      Again, language performance comparison was not the intent of the author. Its just being viewed by others as such.

    17. Re:Ruby on rails performance by Anonymous Coward · · Score: 0
      There is nothing in my post about servlet contexts, when xml is parsed, or how often this is done.

      I noticed. There should have been. If you don't consider these things, you'll waste a lot of time optimizing things that aren't bottlenecks. Following your advice and replacing Xerces would have been a waste of time, because the Java application does not spend a significant amount of time parsing XML.

      Why even do a comparison [if both aren't fully optimized]? I can write really crappy C code that can be beaten by optimized Python script.

      Because at some point the speed doesn't matter. He established that both were fast enough and moved on to other factors. This is particularly significant because many people perceive RoR as too slow. (Including myself, so I found this interesting.)

      There are hordes of Slashdotters who viewed the article [as a performance comparison], even though that was not the intent of the author.

      Maybe so. You had an opportunity to correct them with "this is not a performance comparison!" but instead you said "this is a crappy performance comparison!*" with a footnote of "* - I know it wasn't meant to be one". That should be your headline, not your footnote.

  11. Security by duffbeer703 · · Score: 0, Flamebait

    I recall one of the rather trivial Ruby on Rails tutorials having a remote code execution exploit.

    RoR is a cool concept, but definately not ready for any kind of real deployment.

    --
    Conformity is the jailer of freedom and enemy of growth. -JFK
    1. Re:Security by Anonymous Coward · · Score: 0

      Thank you for this completely worthless comment.

      Do you have a link to back up this claim? Or did you hear it from a friend of a friend of a friend?

      And how does having a remote code execution exploit in some tutorial somewhere make RoR not ready for real deployment? I'm sure I could come up with a trivial remote code execution exploit with C, but I've heard that some enterprises deploy their software using that!

    2. Re:Security by Anonymous Coward · · Score: 0
      Bullshit.
    3. 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

    4. 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?

    5. Re:Security by CatGrep · · Score: 1

      RoR is a cool concept, but definately not ready for any kind of real deployment.

      Here, Here! And since the earth is flat we can't have crazy people going out and sailing off the edge of it because they think it might be spherical.

    6. 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.)
    7. Re:Security by SporkNet · · Score: 1

      Nope, basecamp was the first "Rails" application. It was actually the application that Rails was extracted from.

    8. Re:Security by SporkNet · · Score: 1
      How did it start? Basecamp, a project-management tool by 37signals/Next Angle, was the original Rails application.
      -From rubyonrails.com
    9. 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.

    10. Re:Security by maxwell+demon · · Score: 1

      Well, there's no danger of sailing off the edge, because there's land at the edge of the earth. Proof: Otherwise the ocean water would run away over the edge.

      --
      The Tao of math: The numbers you can count are not the real numbers.
    11. 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
    12. Re:Security by swimmar132 · · Score: 1

      How is this different from any other web framework?

      It's not hard to sanitize your input in Rails. So do it.

      The FUD on this article is simply amazing.

    13. Re:Security by Michalson · · Score: 1

      While I can't speak for JSP (seen it do nice things, never worked with it), ASP.NET will, by default, filter HTML inserted by users (you can turn it off with a simple option in the page header). PHP could easily do it at some future date (it already can do it with single quotes), even though the developers would likely flip the install default setting between versions just for kicks.

    14. Re:Security by paulpach · · Score: 1
      I agree the tutorial thing is not specific to ROR. But:

      scaffold is ROR specific, and is vulnerable. So you either don't use scaffold (which is one of the biggest selling points of ROR) or your app is vulnerable. There is a patch for that here. The fact that such an obvious security bug exists is worrying.

      Their bug tracking system is ROR specific. and it is also vulnerable.

    15. Re:Security by Anonymous Coward · · Score: 0

      Can't trust you. Your $$$ depends on RoR succeeding.

      You're just trying to sell your consulting services.

      You should add a disclaimer to your sig
      "I have personal interest in you using RoR and therefore you cannot trust what I say unless backed with verifiable evidence." (which you haven't provided so far)

    16. Re:Security by Anonymous Coward · · Score: 0

      So we can discount any pro-Java comments as well, since the programmers who use it obviously have a personal interest in it being popular? Great! Glad it's settled then.

    17. Re:Security by Anonymous Coward · · Score: 0

      The java fanboys are simply feeling threatened and would like to put a bullet into the young upstart known as Ruby. If that means lies and disinformation, so be it!

    18. Re:Security by cjs · · Score: 1

      Rails is very secure by default (uses pepared statements and things like this).

      What put me off was that Rails can't run with $SAFE = 1 or higher, and the author appears to have no intention of making it do this. That makes me nervous.

      --
      The world's most portable OS: http://www.netbsd.org.
  12. 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 pj-allmod · · Score: 0

      In my experience, you can develop applications much faster using RoR. I had an app written in PHP that took me close to two months to write and I had it rewritten in RoR in a little over a week. It's easier the second time around, but I didn't even know how to program in Ruby before using Rails.

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

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

      --
      Slashdot. It's Not For Common Sense
  13. 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 Hard_Code · · Score: 1

      And languages are not incapable of specifying requirements that result in implementations which perform the same taks more slowly than other languages. That shouldn't be hard to understand.

      --

      It's 10 PM. Do you know if you're un-American?
    2. 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.

    3. 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.

    4. Re:You are all wrong by Anonymous Coward · · Score: 1, Interesting

      Right, except that this is all nonsense. For instance, due directly to Python's nature, Python will always be slow. Python HAS to do a lookup for variable names. This will always be slow.

      Java is slow. How much of this is due to the nature of the language, and how much due to its implementation? I dunno, I really don't know much about Java. I do know that every interactive Java program I have ever used has been hilariously, stupidly, ridiculously slow. Practically speaking, the point is, right now, if performance is a significant issue, Java is not the right choice.

      I disagree with this nonsense about "C++ is not the way to go." C is almost never the right choice. Most of the people currently writing C would be better off with a much higher level language (whether it be Python, Ruby, Lisp, whatever), and the rest would be better off with C++. Exactly what do you gain by using C rather than C++? Nothing. C has NO benefits over C++.

      (In case it wasn't clear, I do agree that performance often isn't the issue that people think it is.)

    5. Re:You are all wrong by DrXym · · Score: 1
      And most server side code spends its life serving requests and talking to back end business objects / databases. This means there is a lot of built-in latency with most of the code sitting around waiting for something to happen.


      That's the reason in the first place for Java to be attractive. It doesn't have to be as fast as C++. What's more important is that it doesn't crash, has an extremely powerful set of APIs for doing all kinds of enterprisey things and runs just about everywhere.


      There's no doubt either that you could do the same in Perl, Python or Ruby but speed is generally the least of your issues. I'd rather have code that is readable and that it has the tools for the job it is doing. If it works already in Java I see zero gain in moving it to another language, especially as Java already has fantastically good web serving functionality with numerous commercial and non-commercial standards implementations to choose from.

    6. Re:You are all wrong by Anonymous Coward · · Score: 1, Interesting
      Now, what we can compare is the implementation of a particular language

      Well, I think it's pretty obvious that we're talking about the Ruby on Rails implementation of Ruby and Sun's implementation of Java here, so in effect we are comparing implementations, not the languages themselves. That's just the way programmers talk about stuff and most are easily able to make that connection without requiring explanation.

      What you said is absolutely correct and I totally agree, but it's not really applicable in this situation.
    7. Re:You are all wrong by Anonymous Coward · · Score: 1, Insightful

      Let me know more about those mysterious purely functional languages that can't be optimized.

      Oh, and read Boquist 99, I think it covers producing optimized code for lazy functional languages.

    8. Re:You are all wrong by Bellyflop · · Score: 1

      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) ). While I don't disagree with your assertion that people ought to pick the right language for the job, there are many situations where a constant time increase isn't acceptable. Web programming generally isn't one of them, but consider the world of scientific and financial calculation. In those situations, any time increase can be very detrimental.

    9. 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.

    10. 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.

    11. Re:You are all wrong by mikera · · Score: 1

      Interesting approach - thanks for the reference!

    12. 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.
    13. 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!
    14. Re:You are all wrong by Anonymous Coward · · Score: 0

      > Python HAS to do a lookup for variable names

      Unless you use psyco.

      > I do know that every interactive Java program I have ever used has been hilariously, stupidly, ridiculously slow.

      Huh. I find Azureus to be quite responsive, actually. Granted, it's largely because it doesn't use Swing however...

    15. Re:You are all wrong by snorklewacker · · Score: 1

      > A lookup is still constant(ish) time

      Actually, since it has to blow away a register then reload it as opposed to simply using the existing register, you can think of the overhead as a fractional reduction in the number of available registers and thus it's more like cutting efficiency at least in half, and that's generous considering how many cycles it actually takes to fetch. This is pretty significant when your code isn't pipelined, because you don't have many registers to work with on the x86 architecture (pipelined code gets register renaming, x86's have lots of those registers that you can't otherwise get to)

      You don't really have to think about this too much if the performance isn't that critical, but you really should be thinking in terms of how many *times* slower interpreted vs compiled is, not just how much slower.

      Still, I much prefer doing things in python or ruby.

      --
      I am no longer wasting my time with slashdot
    16. Re:You are all wrong by ajs · · Score: 1

      " Let me know more about those mysterious purely functional languages that can't be optimized."

      You'll have to tell me, since I'm unaware of any such mysteries, and I never said that purely functional langauges can't be optimized. I didn't even say that they can't be optimized to at least match the performance on non-functional languages. What I did say was that you could not do so practically (i.e. the compute resources required are disproportionate to non-purely-functional languages by orders of magnitude).

      This is something that those of use who LIKE functional programming languages have been aware of for decades. I don't know why it's a shock to you.

    17. Re:You are all wrong by 0311 · · Score: 1

      Donald Knuth? Is that you?

    18. Re:You are all wrong by Anonymous Coward · · Score: 1, Interesting
      You'll have to tell me, since I'm unaware of any such mysteries, and I never said that purely functional langauges can't be optimized. I didn't even say that they can't be optimized to at least match the performance on non-functional languages. What I did say was that you could not do so practically (i.e. the compute resources required are disproportionate to non-purely-functional languages by orders of magnitude).
      What a bunch of crap. You don't know what you're talking about. Functional languages are *easier* to optimize, not harder. I challenge you to provide a reference. You won't be able to, because you are a poser.
    19. Re:You are all wrong by dubl-u · · Score: 1

      Plus, managers like technology that is generally popular in case you get hit by a bus.

      Professional programmers should like that, too. There's something very pleasant about going on vacation, leaving your cellphone behind, and knowing that your team can happily keep going with the project while you're gone.

    20. Re:You are all wrong by yasth · · Score: 1

      You really don't get constant time expansion do you? Basically the cost of scaling up is O(n) in Pythoin or in C. Basically you can think of it as a machine that can make one greeting card per hour vs one that can make 4 per hour. One is faster then the other but in neither case are you going to hit a hard wall scaling. The ratio of slowness is important but so long as it is a relatively fixed ration, well it is liveable.

      --
      I'd do something interesting, but my server can't handle a slashdotting.
    21. Re:You are all wrong by ClosedSource · · Score: 1

      "In C you can "see" every single clock cycle in your program."

      I see what you're saying, but I think talking about clock cycles can be misleading. The number of clock cycles consumed for a particular section of code is not consistent on most modern computing platforms due to interrupts, caches, etc.

      That's why platforms like the PC aren't really appropriate for hardcore real-time software.

    22. Re:You are all wrong by Anonymous Coward · · Score: 0

      Another hilarious thing is that a small, obscure functional language named "clean" kicks ass in the language shootout on several benchmarks. So clean, in its "can't be optimized" state is screamin' fast.

    23. Re:You are all wrong by Effugas · · Score: 1, Interesting

      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 ).

      You are incorrect.

      It has become quite difficult to ignore the reality that for advanced GUI coding, C++ has established itself as one of the few languages that truly scales to operational use. From an operational standpoint -- meaning, roughly, that the output is actually something you want to run, only the following toolkits have responsive, shell-integrating output:

      1) MFC (C++)
      2) Qt (C++)
      3) WxWindows (C++, and something I've only recently been convinced of by NessusWx. I haven't seen anything fairly mature out of Perl/Python Wx bindings yet. There's a reason everyone's waiting for Open Source Qt4.)
      4) Delphi (Very noticably not C++, not exactly Pascal either.)
      5) VB (Also not C++, but has an entirely different set of scalability problems)

      That's pretty much it. However Swing is to code for, it's more painful to deploy and just a beast to use. (It's 2005 and, like PKI, Java on the Desktop is an expensive joke that's no longer funny.) I keep wanting to see good things from SWT, but however the system looks it's just not very responsive -- either in boot time or in actual use.

      The only thing I actually vacillate on is GTK in C. Scite and GAIM provide acceptable, even very good output. It sure doesn't look very nice to code for though.

      I reserve judgement on C#'s Windows.Forms for now.

      Ultimately, surveying the field, C++ is really doing something right, and it's time people stop repeating the Alice-In-Wonderland myth that you wouldn't want to use it for GUI development. GUI's are one of the big reasons *to* use C++...everything else can hide its performance problems on a remote server, or by the lack of need for interactivity.

      Incidentally, don't discount the problems introduced by interpreters. You know why Flash still fails as a GUI hosting platform, despite appearing to be a perfect choice? Event loop speed. Flash updates events only a couple times a second, meaning you're sitting there, waiting hundreds of milliseconds for your change to get noticed. Java has had similar problems.

    24. 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

    25. Re:You are all wrong by pthisis · · Score: 1

      For instance, due directly to Python's nature, Python will always be slow. Python HAS to do a lookup for variable names. This will always be slow.

      That's BS. There are well-known methods for optimizing dynamic languages with late binding. Smalltalk has the same issues to deal with, yet there are extremely efficient smalltalk implementations.

      --
      rage, rage against the dying of the light
    26. Re:You are all wrong by Twinbee · · Score: 1

      Nice post. I'll just add that it's harder to write a compiler for something like BASIC compared to C, if speed is an issue. But maybe not impossible.

      Am I right in saying that given the perfect compiler, you could write BASIC code that would run as fast as assembler code?

      --
      Why OpalCalc is the best Windows calc
    27. 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.

    28. Re:You are all wrong by snorklewacker · · Score: 1

      I do get the constant factor, yes, O(n) and O(3n) are the same order. However, I also see too many people say "well, it only took a few seconds longer to do 10 concurrent requests, so it should handle 1000 and only be just a little bit slower too". That constant actually matters then.

      --
      I am no longer wasting my time with slashdot
    29. Re:You are all wrong by Anonymous Coward · · Score: 0

      Maintainability

      Maintainability is not something that is inherent in a language. Maintainability is a philosophy of programming, at best. If the developers don't care about maintainability of a project from the start, then no language is going to save them.

      Also maintainability depends a lot on the view of followup developers. Every developer has probably had to wrestle with a main function in C that was thousands of lines long, but have you ever had to deal with an over-engineered class heirarchy in Java? How about an inappropriate class heirarchy?

      Which is easier to deal with? Having been in both situations, I would say that it is easier to break Humpty-Dumpty up then to put him back together again.

      The moral of my story is that you can write poor code in any language.

    30. Re:You are all wrong by pkhuong · · Score: 1

      Actually, purely functional languages are much easier to optimise better. No aliasing, volatile, etc. problem. No side effects to mess things up. Conversion to SSA form, something that most optimising compilers will do to _enable_ a class of optimisation, is conversion to functional code (I believe Wadler has a paper on that). Basically, both functional and imperative languages have access to the same bag of optimisation. The difference is that, for some of these optimisations, it can be very hard to know if the compiler can apply them without changing the behaviour of the program. Of course, lower-level languages are often imperative and can describe fully optimised programs better.

      In short, lower-level, more imperative, languages are better if you, the programmer, feel like doing more of the compiler's job (safety checking, low-level optimisations). Higher level languages, on the other hand, gives the compiler more information to do its job, leaving less tedium and less room for stupid mistakes for the programmer. When using a lower-level language, the compiler must somehow retrieve that information to be able to apply the same transformations. It is often possible, but, obviously, compilation loses information (one needs only look at decompilers).

      Oh yeah, unlike you, I can point to references: OCaml, Stalin (scheme) and SBCL/CMUCL (Common Lisp).

      --
      Try Corewar @ www.koth.org - rec.games.corewar
    31. Re:You are all wrong by Anonymous Coward · · Score: 0

      What's more important is that it doesn't crash

      Can you clarify this? Do you mean it throws an exception that the JVM catches and the JVM shutsdown nicely? Oh wait I have seen JVM's core dump before so that can't be it.

    32. Re:You are all wrong by yasth · · Score: 1

      It does make a difference, but a suprsingly small one. Esp. when you are dealing with DB backed websites, most of the time the real work is done in the DB, and it is the DB that falls over first. If the constant matters you take the portion of the code where it does and drop it down to native code, and move on with life. Most of the time though it really doesn't matter or isn't worth the programing time to do so. The constant isn't that large, and servers are cheaper then people.

      --
      I'd do something interesting, but my server can't handle a slashdotting.
    33. Re:You are all wrong by Anonymous Coward · · Score: 0

      Shucks, I was hoping to see "handbags at dawn" between you two guys, but all we get is a well-reasoned reply. :(

  14. 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*

    1. Re:Article Text by Anonymous Coward · · Score: 0

      In the non-cached java performance benchmark that was conducted, it mentions that full restarts were done in between tests. One question I have with this is were the JSPs pre-compiled? If they were not pre-compiled during deployment then a significant amount of time (relative to JSP execution time) would be spent on compiling the JSPs as they were being loaded (which seems to go hand in hand with the comment about the more complex functions taking longer).

      In regards to the caching tests it seems that this is just static page caching instead of data caching. For some apps this might be great (apps that are mostly static or have a large static component) but for completly dynamic apps this doesn't mean anything. In fact, for completly dynamic apps the observer/cach-sweeper design pattern to expire your cache is flawed and inadequate for an enterprise application. If something needs to be expired from the cache then you have to do it in real time and across all of the application servers.

      Of course, always use the right tool for the job. And in this case Ruby seems like the right tool.

  15. Java compared to Ruby by nitinshantharam · · Score: 0

    So how is java compared to ruby? Is ruby a lot faster or on par with the speed of Java (on most systems)? And how does ruby compare to java at the moment? I wonder if its worth switching over from java to ruby..

    1. Re:Java compared to Ruby by gregarican · · Score: 1

      Since Ruby is an interpreted language and Java is typically JIT compiled I don't think certain studies stating ROR is faster is a totally resounding victory. But in terms of code being concise, readable, totally OO, etc. I choose Ruby hands-down. Just check out a handful of the Ruby tutorials and compare the code with Java. I wouldn't use anything else but Ruby now that I've discovered it and have gotten into it...

  16. Mirror by blackmonday · · Score: 4, Informative
  17. Ruby is a toy by ahmetaa · · Score: 0, Troll

    RoR is a toy comparing to Hibernate and Spring. There is no serious caching, no serious transation capabilities, or messaging mechanisms. hype and buzz. Also, Check this page for a comparison of RoR and Hibernate. However, it is probably better than Php. http://www.theserverside.com/articles/article.tss? l=RailsHibernate

    1. 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
    2. Re:Ruby is a toy by swimmar132 · · Score: 1, Flamebait

      Yes. There's no way Ruby/Rails could really do any of the serious! and important! work that enterprise Java developers do every day.

      But wait, isn't that what this article is about? Hm.

    3. 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.

    4. Re:Ruby is a toy by CatGrep · · Score: 1

      Yeah, you definately shouldn't even try RoR out. Let the rest of us profit while you keep your head buried under the sand.

      "No one is blinder than he who will not see" Bono

    5. Re:Ruby is a toy by killjoe · · Score: 1

      In java you can specify that a method takes place in it's own transaction, or that it can only be called by member of one group or another.

      In ROR you can't do that.

      Again not everybody needs those features but if you need them you have to use java.

      --
      evil is as evil does
    6. Re:Ruby is a toy by swimmar132 · · Score: 1

      I'm not sure what you mean by "method takes place in it's [sic] own transaction" or "it can only be called by member of one group or another".

      But why would you HAVE to use Java? Are there no other alternatives? Are these things IMPOSSIBLE to do in Ruby?

    7. Re:Ruby is a toy by mattgreen · · Score: 1

      Am I the only one who finds it amusing that someone defends Java by saying Ruby On Rails is all hype and buzz?

      Pot, meet the kettle.

    8. Re:Ruby is a toy by davegaramond · · Score: 1

      So what do you define as "serious" caching or "serious" transaction capabilities? From what I read, you are just throwing buzzwords at people's face.

      Oh and RoR is really the buzz nowadays, while Java has been perceived as 'old'...

    9. Re:Ruby is a toy by davegaramond · · Score: 1

      I think the grandparent post defended Java by saying that RoR *lacks* hype and buzz. Well, Java is not really hyped and buzzed again these days (at least not as much as in the 1990s).

    10. Re:Ruby is a toy by renoX · · Score: 1

      You're not the only one..

      I still remember the hype of Java for everything, everywhere..
      What's fun is that even Sun is not able to make fast Java GUIs: in Solaris9, they have ported their tools to Java, which made me learn the command-line tools because the GUI was slow as hell (and was cumbersome to use).

      I don't know if they've improved the tools on Solaris 10, since we've switched to Linux in the meantime..

  18. Re:News Flash! by Anonymous Coward · · Score: 0

    Java is big and slow! But would it have survived the slashdotting?

  19. 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.
    1. Re:I couldn't agree more by snorklewacker · · Score: 1

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

      That was a mighty succinct way of putting it. Now try telling me the same thing in latin. Make sure you get all your declensions right. Dealing with Java is like being back in Latin class.

      "The Romans they go to the house?"

      --
      I am no longer wasting my time with slashdot
    2. Re:I couldn't agree more by Anonymous Coward · · Score: 0

      Latin was easy. Stolidi rident verba latina!

      Java, however, makes me want to bang my head against the nearest hard surface.

    3. Re:I couldn't agree more by hugg · · Score: 1

      I don't know -- any AC post with the subject "You are all wrong" does not merit my mod-up.

  20. 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
    1. Re:First Post! by Anonymous Coward · · Score: 0

      The Ruby on Rails First Post Bot already beat you to it.

    2. Re:First Post! by Anonymous Coward · · Score: 0

      Perhaps there is a Perl First Post Slammer Bot at Slashdot that automatically mods anything with the words "first post" as Troll or Offtopic.

      If not, then there are some seriously humorless/nonobservant modders out there... This was pretty funny, people! HELLO? Look closer next time!

  21. Re:Wait..... by Anonymous Coward · · Score: 0

    Well, the thing about Ruby vs. Java is that Ruby is a general purpose programming language (unlike PHP).

  22. 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 LiquidCoooled · · Score: 1

      Having an application compllete its task 25-30% quicker than before obviously saves you the hassle of throwing extra hardware at the problem.

      If the increases you see still aren't enough, then you add more hardware, but faster apps = more value for (hardware) money.

      Its stupid to NOT see that.

      --
      liqbase :: faster than paper
    2. Re:Application by Anonymous Coward · · Score: 1, Interesting

      For a great analysis look here: weblog [rubyonrails.com]

      You call that an analysis? You must have serious problems.

      And please tell me what the Rails version does more. I'm very interested. The Java version does more imho since it uses ordinals for every entry and keeps them always ordered, the Rails version sets the ordinals to null if the entries are done and relies on the database natural ordering.

      Screenshots like this are totally useless since they compare things that can't be compared. Rails handles lists well because it was written for Basecamp that does to-do lists (and more). So of course it's shorter since the functionality has simply been moved to the core framework (Acts -> List).

    3. 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.

    4. Re:Application by Tobias+Luetke · · Score: 1

      The other way around. The rails version was the original tadalist

    5. 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
    6. Re:Application by Anonymous Coward · · Score: 0

      never worked with siebel, huh?

    7. Re:Application by swimmar132 · · Score: 1

      And bla-bla uses Flash for the UI. Which makes the UI horrible and unusable for me.

    8. Re:Application by gbevin · · Score: 1

      That has nothing to do with a server-side framework, now does it. Bla-bla has currently a UI that's built with OpenLaszlo as an experiment to see how development with that goes. I'm not a Flash fan either, but imho the result is quite acceptable if you put your flaming aside. OpenLaszlo is going to target other runtimes soon and the Laszlo UI merely uses Bla-bla list's REST API. So it's just one client, others will follow since I'm actually interested in the possibilities of RIA technologies and really want to try them out instead of just talking into thin air and shooting something out of the sky without even knowing what I'm talking about.

      --
      Geert Bevin
    9. 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.

    10. Re:Application by gbevin · · Score: 1

      Btw, I duplicated and corrected some parts of my reply on my blog:
      http://rifers.org/blogs/gbevin/2005/4/5/blabla_lis t_criticisms

      --
      Geert Bevin
    11. Re:Application by Anonymous Coward · · Score: 0

      tadalists was extracted from basecamp, so the problem was already solved in basecamp

  23. Ruby Rocks ! by james_in_denver · · Score: 1
    If you haven't used it, you might want to give Ruby a try.

    I was stunned when I used the Ruby on Rails package and had content driven web-apps up and running in a few hours, without the headache of deployment descriptors and no need to wrap them up in War/Jar/Ear files.

    The language and it's syntax are VERY lean and elegant. It's almost as if Ruby is what Java could have been (without the bloat)

    And with the GUI, Database, XML, Network, and the rest of the other bindings it is fairly complete runtime environment.

  24. Re:Wait..... by Anonymous Coward · · Score: 0

    So, the point of this study is to show that Java is inefficient?

    Yes. A Java developer intentionally set out to show that his preferred language was inefficient.

    I don't mean to troll

    Are you sure about that? You don't seem to have read the Slashdot summary, let alone TFA.

  25. 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).

    2. Re:No need to be pedantic by jfengel · · Score: 1

      Java has a bias towards Solaris (because that's what Sun sells) and Windows (because that's the cheap-readily-available-desktop). Which is too bad, because I've found that Java is far more useful as a server-side application than on the client side, so treating Linux like a bastard stepchild is inappropriate.

      Which make OS X the favorite of only very few. It's got a hard road ahead with respect to Java. Macintosh has long been known as a favorite for client-side, user-facing apps, so even though its Mach kernel is super-duper for a lot of things it doesn't have the pentration that Linux does (which runs on cheapo hardware and is free itself).

      So I'd love to see Apple make Java a top-of-the-line system, because it would be great to have an OS X box for Java developers: all the solid user feel of a Mac with the flexibility of a Unix.

  26. wtf... by Anonymous Coward · · Score: 0

    just write it in C if speed and size are issues.

  27. Mod Parent Up! by saintp · · Score: 1

    +1, Embarassingly stupid

    1. Re:Mod Parent Up! by northcat · · Score: 1

      Actually that mod is appropriate for you. You didn't get the joke.

    2. Re:Mod Parent Up! by saintp · · Score: 1

      D'oh!

  28. 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 swimmar132 · · Score: 1

      Ever hear of the DRY principle?

      "Don't Repeat Yourself"

      Why should you have to generate the getter/setter methods when they can be automatically made for you?

    2. Re:Line counts, method counts.. all lies. by Anonymous Coward · · Score: 0

      Wow, you certainly are a long-time slashdotter since TFA specifically discusses how he does his LOC count, and it's nothing like what you think. But please, keep up the good work of demonstrating the essentials of reading Slashdot.

    3. 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.

    4. Re:Line counts, method counts.. all lies. by fishbowl · · Score: 1

      >Author talks aout line counts and method numbers..

      Also, it's a data-driven design. If you aren't using a code generator to create most of your value objects automatically from your DB schema, you're working too hard - and you shouldn't be counding those objects as lines of code.

      --
      -fb Everything not expressly forbidden is now mandatory.
    5. Re:Line counts, method counts.. all lies. by be-fan · · Score: 1

      The fact that you need an external tool to do boiler-plate crap is a weakness of the language. If the language was more expressive, boiler-plate wouldn't be neccessary. To analogize: it's like saying you shouldn't complain if HTML didn't have hyperlinks, but had an easy tool to let you copy in the target. It'd still suck.

      --
      A deep unwavering belief is a sure sign you're missing something...
    6. Re:Line counts, method counts.. all lies. by metamatic · · Score: 1
      From TFA:

      The LOC counts used here do not include comments or unit tests, nor do they include simple punctuation lines (lines with just a "}" or "end").
      --
      GCHQ Quantum Insert installed. If only our tongues were made of glass, how much more careful we would be when we speak
    7. Re:Line counts, method counts.. all lies. by Kismet · · Score: 1

      How about a public setter and a private getter? :)

      I don't know anything about Ruby.

    8. Re:Line counts, method counts.. all lies. by Anonymous Coward · · Score: 0

      You prefix it in the class with public, private or protected.
      Yes, ruby does go to eleven.

    9. Re:Line counts, method counts.. all lies. by ajwitte · · Score: 1
      Why do you need a private getter?
      Buf if you do:
      class Foo
      attr_writer :bar
      private
      attr_reader :bar
      end
      --
      chown -R us ~you/base
    10. Re:Line counts, method counts.. all lies. by Kismet · · Score: 1

      Well, I probably meant the opposite scenario.

      Interesting, this Ruby.

    11. Re:Line counts, method counts.. all lies. by Tim+C · · Score: 1

      No need for a 'modern Java IDE'

      But Eclipse is free, JBuilder foundation is free, and (as a Java programmer doing server-side stuff, gamer and all-round computer freak) I already have a PC perfectly capable of running both (at the same time, should I desire). Syntactic sugar is nice, but it is neither necessary nor sufficient.

      That said, I certainly do intend to have a look at Ruby myself when I get the time to do so (project crunch time at the moment, and lots going on at home too...)

    12. Re:Line counts, method counts.. all lies. by Anonymous Coward · · Score: 0

      (defclass foo ((bar :accessor foo-bar) (baz :accessor foo-baz) (foo :accessor foo-foo)))

      1 line is less than 3.

      By Ruby logic, this makes Lisp 3 times better. Please start using Lisp now instead.

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

      Syntactic sugar is nice

      the attr_* methods are not syntactic sugar. They are methods defined on class Class (or maybe it's class Module, now I'm not so sure). I'm even pretty sure they weren't in Ruby initially. Someone wrote the methods and said "hey isn't this cool and doesn't it save a lot of typing!", matz liked it and included it (I believe that's how it happened, but I could be off).

  29. 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.

    1. Re:Horses for courses by swimmar132 · · Score: 1

      You can EASILY do SOAP and RMI-like stuff on Rails.

      http://dev.ctor.org/doc/soap4r/RELEASE_en.html
      http://www.ruby-doc.org/stdlib/libdoc/drb/rdoc/

      Not sure what you mean by Queues (in relation to a web app).

    2. Re:Horses for courses by 16K+Ram+Pack · · Score: 1

      I hope you understand, it was in reply to a comment. I wasn't dissing Rails, it's just that often I've heard everything drawn in terms of massive enterprise applications, and not everything is such an application.

    3. Re:Horses for courses by zardo · · Score: 1
      Well by trying it out it sounds like you spent about 10 minutes with it. It's the ruby language itself that makes rails so efficient, and you need to spend some time with ruby to get the hang of the ruby way of doing things. Take the xml builder class and compare it to java's DOM style XML generation techniques:
      builder = Builder::XmlMarkup.new
      xml = builder.person { |b| b.name("Jim"); b.phone("555-1234") }
      xml #=> <person><name>Jim</name><phone>555-1234</phone></p erson>
      I wrote a custom XML api for the ebay API in no time using this package. SOAP would have been MUCH more work.
    4. Re:Horses for courses by goynang · · Score: 1

      SOAP? Easy!

      Just implemented local Google search on my little Rails project using the Google API, SOAP, and half a dozen lines of code.

    5. Re:Horses for courses by 16K+Ram+Pack · · Score: 1

      To be honest, I didn't know how easy SOAP was or otherwise. It was more a comment on the notion that everything has to be scalable and have all the features of the biggest languages around. Sometimes, features don't matter - speed of development and simplicity of maintenance do.

    6. Re:Horses for courses by 16K+Ram+Pack · · Score: 1
      Actually, 10 minutes was about right on top of reading about it. And I'm not dissing it, because I'm trying it out for myself. I was thinking more along the lines of how people often look for things a language doesn't do (eg scale up, offer certain enterprise features) when sometimes they aren't important.

      I'm a few hours into RoR now, having been through a tutorial and got a CRUD form customized with a table and all that and whilst I don't understand a few things about it, current feeling is a big WOW!

      And yes, I'm picking my way through Ruby, which I already like the feel of. I already feel that I'd never want to go near PHP again.

    7. Re:Horses for courses by Anonymous Coward · · Score: 0



      Can you share that?

    8. Re:Horses for courses by zardo · · Score: 1

      PHP is the biggest load of horse shit I've ever tried to eat, errrr... yeah. It's like eating horse shit!

  30. Re:Java Problems on my Mac... by Anonymous Coward · · Score: 0

    I see the masters are still at work. bravo.

  31. 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.

    3. Re:Mojavi by Anonymous Coward · · Score: 1, Informative

      After studying and playing with mojavi for a month or so, I went ahead and built an app in it, only to decide afterwards that, even with all the comments and documentation I left in the code, noone would be able to maintain it besides myself. For someone who doesn't already *know* mojavi, getting up to speed on how it all hangs together to make things work is a really steep curve.

      Admittedly, however, I learned a whole bunch of things about php that I never considered before playing with mojavi. I think if I were to build an app which I knew I would be the only developer that would have to revisit it in the future, I would do it in mojavi, but it is sort of overkill for most small projects.

      Now, if only that zestic cms built on mojavi was done....hehe.

    4. Re:Mojavi by rffrff · · Score: 1

      you mean people actually like php? ;)

  32. 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
    1. Re:Ruby marketing vs Cherrypy by abigor · · Score: 1

      Thanks for the link. I'm working with Python these days, and we rolled our own transaction-based app server with mod_python and zodb. But it was a lot of work, and I'd like to see if there's something better available.

    2. Re:Ruby marketing vs Cherrypy by davegaramond · · Score: 1

      Well, the Cherrypy guys should start publishing blogs and saying how Cherrypy kicks {Java,J2EE,Hibernate,Spring,Struts,JWhatever}'s ass.

  33. Re:Wait..... by Bellyflop · · Score: 1

    When was the last time that you used and evaluated Java?

  34. Re:Wait..... by LnxAddct · · Score: 1

    Thats all well and good until your clients reach 4 digits, maybe even 3 digits. Java is also quite fast and makes an excellent server platform. It is constantly optimizing its own code on the fly, how cool is that? It is also purposely verbose as it makes large projects involving many members in different teams easier. Comments are sure nice, but in the end the code does the talking. So many ignorant people that have never been involved in enterprise really need to read up.
    Regards,
    Steve

  35. Re:Java Problems on my Mac... by Anonymous Coward · · Score: 0

    1) How is that a Java problem?

    2) I've run OS X since the first Public Beta and never had that type of issue on a lot slower of machine. Even my new Powerbook does not have that issue. Sure nothing else is bringing your computer to a halt?

  36. 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?"

  37. 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: 1, Insightful

      Apparently you didn't evaluate it all that closely, or you'd have noticed that you don't have to autogenerate schema from the objects. You have full control to manually write the db-to-object mappings.

    2. 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?

    3. 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.
    4. 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
    5. 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.

    6. Re:Hibernate too hyped by Anonymous Coward · · Score: 1, Informative
      I'm only in the process of learning Hibernate, so I'm by no means an expert. However, a couple comments:

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

      You can generate tables from your objects, or generate your objects from your tables. Either way is possible with Hibernate. Personally, I create the tables and generate the objects from them.

      "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."

      Hibernate does the same. In fact, I did that very thing yesterday. You put your named queries in the mapping file and reference them in your code. Works beautifully.

    7. 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.

    8. Re:Hibernate too hyped by nettdata · · Score: 1

      That's not the case at all... you can actually override just about anything using Hibernate.

      For instance, we use DB-specific tuning objects, as well as special type handlers (BLOB on Oracle, for instance) that allows us complete control of how the DB is dealt with.

      --



      $0.02 (CDN)
  38. Why Rails will win by Anonymous Coward · · Score: 0

    Rails will win with the market because it is easy to find cheap hosting for Ruby on Rails. Not as cheap as PHP currently, but very reasonable already. Java lacks in this department.

    Apache + FastCGI = cheap hosting

    1. Re:Why Rails will win by TrekCycling · · Score: 1

      There could be *some* truth to this. I think some cheap hosts are loathe to allow Java development because of memory issues.

  39. 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.

  40. Second Time Around by Doc+Ruby · · Score: 1, Insightful

    Every time a good coder rewrites an app, it gets better. Especially a large, complex app. Ususally the new design insights afforded by a "warmup" cycle have to battle the tedium of repetition. But rewriting in a new language, especially one in which you're fluent, and interested in exploiting for performance, is a real motivator for optimization. I'd like to see comparitive benchmarks for another rewrite, *in Java*, to see how much performance gain is from the language, and how much is from the educational rewrite cycles. Deriving the motivator of "interest" is going to be harder, though still a factor.

    --

    --
    make install -not war

    1. Re:Second Time Around by Slashcrap · · Score: 1

      Isn't this all covered in the actual article?

      Surely a Slashdotter wouldn't comment without actually reading the article would they? Even though the article text was posted in a comment?

      No, I just can't bring myself to believe it. There must be some other explanation.

    2. Re:Second Time Around by Doc+Ruby · · Score: 1

      Yes, these "discussion threads" are appropriate only for bashing other Slashdotters' posts. Discussing an issue presented in the article is offtopic.

      --

      --
      make install -not war

    3. Re:Second Time Around by Slashcrap · · Score: 1

      Apologies, it looks like it was me that didn't read the article properly. My initial understanding was that he had reimplemented the original project in both Java and Ruby in order to remove any bias. Reading it again, I'm not so sure.

      That said, he does deal with your point in the first few paragraphs of the article.

    4. Re:Second Time Around by Doc+Ruby · · Score: 1

      Yes, but I want to discuss it with fellow Slashdotters. If Gehtland is lurking here, he can quote himself, or elaborate. If Slashdot weren't interactive, it wouldn't even be worth mocking.

      --

      --
      make install -not war

  41. Ruby DeRailed by roman_mir · · Score: 1

    with the awesome /. powers

    and now I can't read the article.

  42. 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
    1. Re:This is a flawed recollection. by duffbeer703 · · Score: 1, Redundant

      I stand corrected... I looked on the machine where I ran through some of the rails tutorials and found where I found the hole -- it was caused by exactly the problem you described.

      I thought that I had read that it was a bug in one of the rails libraries... but I must have been incorrect.

      A thousand apologies to the rail'ers out there.

      --
      Conformity is the jailer of freedom and enemy of growth. -JFK
  43. 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

  44. 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 Anonymous Coward · · Score: 0

      For most purposes Ruby can be considered a better Perl. As a Perl programmer I had no problem picking up Ruby. Ruby cleans up the syntax and adds a whole bunch of features but is otherwise very similar to Perl.

      Ruby has the RAA which is similar to and serves the same purpose as CPAN. It doesn't have the huge source base that CPAN does, but there isn't anything for any language that can match CPAN. Perl has been around for a long, long time.

    3. 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.

    4. Re:Meta-application issues by Black+Perl · · Score: 1

      Ruby has the RAA which is similar to and serves the same purpose as CPAN

      Does it? (This is a serious curiosity question). Does RAA come with Ruby as a command-line executable? Does it automatically download, extract, build, and test a module/app before installing? Does it identify dependencies and do the same with them? Are there test results available by an independent testing team so you know if it should work on your platform before you even download it? Does it automatically extract and build local documentation for the module? Is there even a module documentation standard that I can rely on? Is there a place I can look up ratings and/or reviews of the modules?

      --
      bp
    5. Re:Meta-application issues by Anonymous Coward · · Score: 0

      Have a look at RubyGems which does most of that. It comes with Ruby on Win32 and other platforms.

    6. Re:Meta-application issues by pepicek · · Score: 1

      The community is outstanding!
      And library wide :-)

    7. Re:Meta-application issues by Anonymous Coward · · Score: 0

      Ruby Gems:
      "gem install" will download, extract, build, test and install a gem. It will then build rdoc documentation. It will also identify dependencies and do the same with them.
      "gem rdoc" generates RDoc for pre-installed gems.
      "gem update" will upgrade currently installed gems in the local repository.

    8. Re:Meta-application issues by Black+Perl · · Score: 1

      It's closer than I thought. Offhand I see a couple of differences:

      1. There doesn't seem to be a culture of providing tests. CPAN will refuse to install a module unless its tests pass, and you need to have them, preferably covering all your code (there's a module, Devel::Coverage I believe, that will tell a module author what % of the code is covered by tests). It seems that many RubyGems don't even have tests, and all of them will install by default without even running them.

      2. There's no organization. The packages seem to have one-word names. There's no way to browse by category. This will quickly get out of hand unless you institute a package category hierarchy.

      --
      bp
  45. Re:Wait..... by TrekCycling · · Score: 1

    Actually what you just pointed out is that you won't or *can't* "admin a huge corporate dynamic website". A good technologist could make RoR or Java work just as well as your "stack" of Pico, PHP and MySQL (which, as we all know is inherintly easier to maintain than a Java app).

  46. Re:Wait..... by Landak · · Score: 1

    Ahh, okay. That makes a lot more sense. However, what about clustering your boxen, *then* running all your company's IT needs from it; thereby eliminating issues such as that? Couldn't you make damn sure everything you were using, and were likely to use, ran on that "One machine", then optimise it through the teeth to allow you to do more?

    Though I do really see where you're coming from.

    --
    My UID is prime. Is yours?
  47. Ruby + Captain Crunch by trosenbl · · Score: 1

    Does anyone know about the feasability of using Ruby on Rails for the Captain Crunch method of object serialization? I've heard good things, that there's a lot less code to write, but it's harder to understand for a novice.

    Has anyone had any experience with this?

    1. Re:Ruby + Captain Crunch by Zach+Baker · · Score: 1

      Not sure I can answer the question because I'm still working on my first project in Rails, but could you provide a link that describes the method? I've not heard of any methods named after the Cap'n that don't involve whistling into phones.

    2. Re:Ruby + Captain Crunch by trosenbl · · Score: 1

      It's a method of obfuscating a serialized object so that it can be passed through a public channel (ie: a url) without revealing meta information or contents of the object.

      I don't know if it's widely known, but a few other people in my office have heard about it.

  48. Re:Java Problems on my Mac... by Anonymous Coward · · Score: 0

    Java sucks on Macs.

    It is a problem because it sucks on Solaris, on Linux, on HP-UX and on Windows.

  49. Re:Wait..... by Anonymous Coward · · Score: 1, Informative

    PHP is a general-purpose scripting language. You can write shell scripts in PHP. You can write GUI applications in PHP. It started off as web-only, but that hasn't been the case for years.

  50. 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.

    1. Re:Hibernate Vs. Ruby on Rails- flame free! by james_in_denver · · Score: 1

      That's a pretty shallow review..... It doesn't take into account several different factors such as each "Unit Of Work" typically will only access a handful of tables, and not the 40-50 that the author suggests. Secondly, (and this is coming from my DBA perspective) the author makes the case that "changing the code" in Java is easier/better than changing the Data Model in the underlying DB. Though in reality, from DB performance and normalization perspectives, it's usually better to optimize the tables and their relationships, than to "fix" things in code. Thirdly, the author of the article talks extensively about data "caching" in the application layer. This is usually not an issue for most databases as they already have their own data caching management schemes in place.

  51. Re:Wait..... by Taladar · · Score: 1
    It is constantly optimizing its own code on the fly
    Java is using genetic algorithms for the VM and JIT Compiler Code?
  52. The Ruby Buzz by matchboy · · Score: 1

    Planet Ruby on Rails (bunch of RSS feeds). The Ruby community is growing like a wild fire. :-)

    --

    Robby Russell
    PLANET ARGON
    Robby on Rails
  53. 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 lux55 · · Score: 1

      I can't comment too much on Python, but Ruby does have some pretty dynamic features that make frameworks like this much easier to do. Python has many similarities, as does Perl, so it should be possible in those to a large degree as well.

      I've recently written things along similar lines with PHP, but the language flexibility is much lower (better in PHP5 at least), so you have to work via workarounds at times.

      As for something like Java, without getting into serious bytecode-level work, I can't see a Rails-like framework being viable at all.

    2. 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?

    3. Re:looks interesting, but does it have to be ruby? by Anonymous Coward · · Score: 0

      Well, you see a lot of bitter $LANGUAGE_X fans who say $LANGUAGE_X can do just the same stuff! Unless they are using Lisp or some other highly dynamic language, they are fooling themselves.

      One big thing about Rails is that the framework inserts new dynamically generated code into the classes at runtime. You can't really do this in Python as elegantly.

      Another big win for Rails is that the template language is Ruby, not some weird half-baked language. Again, you can't do this with Python at all because of the whitespace thing. Some people don't like this, of course, but it ties into Rails' simplicity and uniformity.

      For years now I also have been using (private, for my clients only) custom dynamic frameworks written in PHP and Perl which are very "rails-like", as much as practical. I'm an old Lisp fan so high-level refactoring and simplicity of code is important to me. The Perl version comes pretty close to Rails but is SO much less readable. For instance instead of "foo :bar" in perl you have to do something like "__PACKAGE__->foo('bar')" .. just subtle stuff like that makes Perl maddening.

      So in conclusion, if you want *Ruby* on Rails, you gotta use Ruby. It's not hard to learn and if you are solving problems for clients, who cares what language it's in?

      If you want more efficient, well-designed frameworks, they are possible in any language, but I don't think any of them come close to Rails (except of course languages like Lisp, Smalltalk, but those are "dead languages".. sorry fans).

    4. 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.
    5. Re:looks interesting, but does it have to be ruby? by CatGrep · · Score: 1

      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 (and there are also the syntactical issues which would make it difficult in Python). Python folks always seem to minimize the importance of this Ruby feature, but in practice it is very useful/powerful and it can lead to very natural looking DSLs in Ruby.

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

      I'm sure it would be possible in Python. But as you say the implementation would be very different (and perhaps I could even add that it would be much more difficult and it would probably require a significantly larger code base).

    6. 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.
    7. 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).

    8. 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.
    9. Re:looks interesting, but does it have to be ruby? by Anonymous Coward · · Score: 1, Funny

      Well, you see a lot of bitter $LANGUAGE_X fans who say $LANGUAGE_X can do just the same stuff! Unless they are using Lisp or some other highly dynamic language, they are fooling themselves.

      Wup! Lisp has been mentioned. Let the Giant My Meta Features Can Beat Up Your Meta Features fights begin.....

    10. 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...

    11. Re:looks interesting, but does it have to be ruby? by Narchie+Troll · · Score: 1

      You can take a codeblock as an explicit argument. Make the final argument to the function something like &fnc, and fnc will be a Proc representing the passed block.

      yield is just syntactic sugar, really. matz pulled it in from some other language he liked.

    12. Re:looks interesting, but does it have to be ruby? by Abcd1234 · · Score: 1

      So, I presume you can pass multiple blocks?

    13. Re:looks interesting, but does it have to be ruby? by Narchie+Troll · · Score: 1

      In the proc style, you can.

      func(n, y, proc do .. end, proc do .. end) works fine.

    14. Re:looks interesting, but does it have to be ruby? by horza · · Score: 1

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

      Ouch. I thought we'd just spent the last decade trying to separate logic from presentation?

      Phillip.

    15. Re:looks interesting, but does it have to be ruby? by Fess_Longhair · · Score: 1
      Also, can you embed Python in HTML? (seems that the whitespace issue would cause a lot of problems with doing that)

      Try spyce

    16. Re:looks interesting, but does it have to be ruby? by angel'o'sphere · · Score: 1
      This discussion and especially the blog the article refers to is very interesting.

      However his post here, its parent and one of the answers makes exactly clear why I use neither Python nor Ruby but stick to Java and Groovy.

      Syntax matters. Grammar matters.

      Both languages have in my mind a brain dead syntax.

      The comment to the post above:
      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...
      makes me happy.

      Finally a guy who has he same "feeling" like I have about Ruby. Lots of nice features thrown together but messed up by a complete ugly syntax and semantics.

      I *want* a language where I can define my own "my_while". But I want a language where the definition is as easy to read (and write) as the usage.

      What is my_while? A "function" with 2 arguments. One is a condition one is a block. Both are "callable" statements, no? If we assume the language more C like in syntax, then we define stuff like we want to use it later.
      my_while (cond) {block} =
      if (!cond()) return;
      do {
      return block()
      } while (!cond());
      Now we have defined a function which takes one argument wich needs to be surrounded by "(" and ")" and one argument which needs to be surrounded by "{" and "}".

      If we had to write the same thing in (extended) Java it would probably look like this:
      my_while (java.lang.Syntax.Expression<Boolean> cond) {java.lang.Syntax.Block block} {
      if (!cond()) return;
      do {
      return block()
      } while (!cond());
      }
      A matter of taste ...

      Anyway back to topic. Why is the Ruby app server faster and why is the Ruby solution cleaner? The answers hopefully will lead to better Java app servers in future and better app frameworks.

      I have no problem with the fact that my favourite language lost the competition in this topic currently.

      I'm keen to see optimizations, better understanding, more new ideas going into that matter.

      Ha, why is no one writing a C++ servlet engine or web app framework like the Java and RoR guys do?

      A far more interesting question imho :D

      angel'o'sphere
      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    17. Re:looks interesting, but does it have to be ruby? by Abcd1234 · · Score: 1

      Incidentally, I noticed you mentioned Groovy. My personal fascination, right now, is Scala. The grandparent's example would look like this in Scala:

      def my_while(cond: => Boolean): WhileBody =
      new WhileBody(cond);

      private class WhileBody(cond: => Boolean) {
      def run(body: => unit): unit = {
      if (cond) {
      body;
      run(body);
      }
      }
      }

      var i = 0;

      my_while { i < 10 } run {
      Console.println("i = " + i);

      var j = 0;

      my_while { j < 10 } run {
      Console.println("j = " + j);
      j = j + 1;
      }

      i = i + 1;
      }

      Tail recursion is good... :) If I could only think of a project to write in it. It's melding of functional and object oriented programming into a single, consistent, well-organized language is really quite beautiful... see, they rewrote Smalltalk the right way! ;)

    18. Re:looks interesting, but does it have to be ruby? by angel'o'sphere · · Score: 1

      Looks intersting. I will dig into it.

      My main point is: what does def mean?

      Is it a function, a method, a class ?

      Why is it not named like that then? now I only see definition. Nice.

      Either ommit keywords like def and make a c like syntax where the "wording" alone defines the structure or invent correct keywords.

      How often do you write def? 3 or 4 or 10 times per file?

      Should not be a problem to call it class, function/func or even method/meth then, IMHO.

      angel'o'sphere

      P.S. to understand what the difference between a definition and a declaration is, some ppl need to study CS. Language designers should know better than to use def as a keyword.

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    19. Re:looks interesting, but does it have to be ruby? by the+quick+brown+fox · · Score: 1
      I believe in Ruby, "def" only ever means "method". If you mean class, you say "class". There are no functions per se in Ruby. Those things that look like functions are actually methods on the Object class, and those things that look like function calls are method invocations on the implicit Object that your script executes in (much like JavaScript usually runs in the context of an implicit Window object).

      Anyway, C++ and Java are also guilty of overloading keywords. How many places does C++ use "virtual", and in totally varying ways? And Java has "final" which means immutable for fields/variables but "not overridable" for classes.

      P.S. to understand what the difference between a definition and a declaration is, some ppl need to study CS. Language designers should know better than to use def as a keyword.

      Tell that to Guy Steele, Gerald Sussman, John McCarthy... I don't know what difference you're referring to, as I don't have a CS background, but those guys used "define" or some variant thereof. So if it's a mistake, it's not a rookie mistake.

      Anyway, if I am guessing correctly about what the difference is, it may help to know that functions (or for Ruby, fake functions) can be defined and re-defined repeatedly in these languages. And at runtime, before a function definition is executed, that function is not defined. Very different than C/C++/Java, if that's what you're used to, where function declarations are a compile-time construct.

    20. Re:looks interesting, but does it have to be ruby? by angel'o'sphere · · Score: 1

      Late but worth to be answeed.

      I don't want to argue wetehr a particual language is better inusage of keywords than the other.

      I want to argue that a (rather) new language like python should not make the same mistakes older languages did.

      *I* know that def means fully written definition. So, but it is not a simple definition but the definition of a method. So the keyword is simply WRONG! So if the designer absolutely needs a abreviation because he can not stand to wrie a long keyword like method they should ahve chosen meth instead of def.

      Same for Ruby. A even newer language. Same mistake a gain.

      With pointing out what C++ does with virtual and Java does with final (and finally also :-/) you basically hit the same point I want to make.

      As soon as you have understood what a virtual method is (member function), virtual inheritance makes absolutely no sense.

      A modern language should look something like a more OO directed Pascal ... probably a little bit like Eiffel, or a little bit like AppleScript; in case you like verbose languages.

      If you don't want them verbose, make them more like C++/Java but use clear keywords, or take some similarities from SmallTalk ... look at Groovy, e.g.

      A method is a method is a method and is not a def.

      angel'o'sphere

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
  54. Don't read too much into this. by tvaananen · · Score: 1

    Don't read too much into this. Ruby is a nice language and Active Record is a nice ORM solution, BUT... There are severe limitations for RoR. It can't work with legacy databases, since it relies on the object model based on the database tables and their relations. There is no caching of data either. Simplistic performance comparisons are very naive. People are jumping into conclusions based on a tiny toy demo. It only proves that: Ruby is good for small apps. It is better than Java in this scope, but only when you get to create the whole application from ground up. There is no proof beyond that, and there won't be any time soon because Ruby does not have support for many critical features that larger applications require. Ruby is a scripting language, meant for scripting. Do not try to imagine anything else.

    1. Re:Don't read too much into this. by swimmar132 · · Score: 1

      Weird, I could've sworn that the author of article tested Rails caching in his article. But nevermind, I must've imagined it, since it doesn't exist!

      Yes, a "scripting language" can't do anything serious and important and enterprisey. Except, not. People are writing large scale Ruby apps all the time.

    2. Re:Don't read too much into this. by be-fan · · Score: 1

      "Do not try to imagine anything else". I take it you're a Java or C# programmer?

      --
      A deep unwavering belief is a sure sign you're missing something...
    3. Re:Don't read too much into this. by Anonymous Coward · · Score: 0

      Ruby is a scripting language, meant for scripting.

      C'mon, it's 2005, drop this nonsense. Ruby is a *programming* language.

      There are those of us, by the way, who think *all* web apps are "toy" applications. Which they are, when you consider the universe of possible apps.

      Ruby makes those apps (small OR large) easier to write, understand, and maintain.

      PS: there are plenty of big sites written in Ruby as well as PHP and other "scripting" languages. What exactly does Java do that they don't?

    4. Re:Don't read too much into this. by tvaananen · · Score: 1
      Active Record offers no viable caching. The test application might have had caching on the web tier, not the database tier.

      Hibernate sweeps the tables with Active Record when it comes to caching and scalability. Hibernate supports two caching layers - which the author failed to use in his article as his numbers show, and what he openly admitted.

      Active Record also loads everything lazily. Hibernate can do this but also offers other options. Lazy loading is one of the biggest fallacies of ORMs and will lead to n+1 loading problems. Since Active Record does not support outer joins, its performance is pitiful once the object graph grows. You have to write piggypack queries by hand with Rails to get the performance out and this gets extremely messy with larger databases.

      Loading data lazily is good only if you did not need to load the data on the first round. This however is hardly ever the case when your object model is a little bit more complex. Very simple databases can have these problems as well depending on the object relations.

      The test numbers obviously do not show pure Java vs. Ruby performance. The application is but a thin layer serving database stuff, and hence there is no significant 'logic'. But I can tell you that the fastest Ruby XML parser implementation is 50 times slower than Java.

      That said, the author probably had a good reason to use RoR, which is fine. I am just saying that do not read too much into this.

      Do not forget that he can not prove any of the numbers nor can anyone really dig in and verify any of his numbers, nor can anyone criticize his tests or get any idea what he was actually testing without the full source code available.

      While the numbers probably mean something, they do not prove anything, nor should they be a reason for over-hyping this technology.

    5. Re:Don't read too much into this. by swimmar132 · · Score: 1

      Wow, you're good at regurgitating serverside articles. Active Record does have a (very) simple cache. Anyways, Active Record solves different problems than Hibernate. For the vast majority of web apps, AR is probably just fine. And it's still being constantly tweaked and added to (since Rails is not 1.0 yet).

      Link to the "fastest Ruby XML parser implementation"? I'm guessing it's not the C extension one.

    6. Re:Don't read too much into this. by tvaananen · · Score: 1
      It's good information, isn't it - better than plain hype and illusions of grandieur.

      If Active Records solves different problems, why are people trying to compare them. And might I add that they are making a mess of it.

      But I agree, it solves different problems and is not suitable to all tasks that Hibernate solves. As long as you remember that, you might be fine.

      I am not saying RoR sucks, because it does not. I am just saying that people forget its limitations and try to apply it to situations where is does not work.

      And finally, I thought we were talking about Ruby, not C. If Ruby has to be dependent on C because of performance reasons, it is trying to be more than it is worth.

    7. Re:Don't read too much into this. by swimmar132 · · Score: 1

      Who's trying to apply RoR to situations where it doesn't work?

      The point is try to figure out what tool is going to work best in what situation. For the application mentioned in the article, it's clear that RoR is the best fit. For all my applications, RoR is the best fit. And I don't think anyone's tried yet to put RoR in an application where it wouldn't fit.

      It's pretty trivial to create C extensions to Ruby if performance becomes an issue. And using the C extensions is no different than using pure Ruby code. So, from the user's standpoint, there's no difference between using Ruby to access an xml C library and a pure Ruby xml library.

    8. Re:Don't read too much into this. by tvaananen · · Score: 1
      Sure it is the point to choose the right tool, but according to some Ruby fanatics, it is always Ruby for everything. Ruby replacing Java, toasting J2EE, diminishing .NET - Kaboom! Illusions of grandieur. You have heard it. If not, go read some TSS threads where the fans are eroding any credibility that Ruby might have had.

      There is always an excuse or explanation - it will be there in the next version, it is already beta, it is being planned, hype hype hype. The fact is that the enthusiastics would so very much like Ruby to be what Java is or what .NET is, but it is not - and they know it.

      So they are creating incredible cover stories about invincible feats of low row counts and immense scalability, and then forget to turn the Java caching on when comparing applications, and btw, we can't see the application either just the compelling numbers - yes, Java empire has fallen!

  55. The instructions Java does by Anonymous Coward · · Score: 0

    is going to be the same as what Ruby does and maybe more. Lean java might outperform Ruby, but Java/Spring/Hibernate (heck, toss in Struts), is so bloated with framework, I'd wager that its trying to do more than Ruby, in order to get the exact same result in the end (serving web pages).

    -Phantom of the Operating System

  56. Re:C is still the King !!! by Anonymous Coward · · Score: 0

    Why isn't this modded up?

    This has been the only valuable contribution so far.

    Listen up, Ruby-fanwhores who think they know something about "teh computer stuff": your shitty toy language is ugly and slow. It may be enough to run your blog with 2 visitors (you and the virtual stalker that wanks off to your profile-picture), but it just does not cut it in the real world.

  57. 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.

    1. Re:Is it just me or... by swimmar132 · · Score: 1

      By "Rails codebase", the author means the rails application. Not the code for the Rails framework.

  58. 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.

  59. Re:RoR == the mysql of web servers by andreas1245432 · · Score: 1

    FUD. Where is Rails missing scalability or distributability? You can distribute it over as many servers as you like. What's wrong with Rails' caching? Please explain.

  60. Re:Wait..... by markv242 · · Score: 1
    You're talking about the Google farm, I assume. Yes, I suspect that we will see a lot more of this as time goes by, but even in a grid layout, I would still pick Java as my development environment due to portability.

    As it stands today, I can work on my Java app on my Wintel desktop, or my Mac laptop, and then deploy it all to the mixed-Solaris/Linux environment that is our production cluster. Web apps under Java are extremely portable-- much, much moreso than even the simplest PHP application.

    Imagine a PHP application where all of the PHP server config, PHP app config, all the PHP files, required libraries, images, etc etc, were in a single zipfile and could be moved from machine to machine without any modification. That's what a Java WAR (Web ARchive) file is, and that's how hot deployment works.

  61. Re:Kneejerk by bwy · · Score: 1

    And most of the posters admit they haven't even read the article yet.

    Haven't read, because the site crashed. Always embarassing when that happens.

  62. 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?

    1. Re:RoR sounds great, but... by tvaananen · · Score: 1
      RoR does not suck. People are just over-hyping it and jumping into conclusions.

      RoR can not be successfully used with legacy databases that do not honor any kind of 'object' structure. I am not saying that Hibernate is any better, but you can not use RoR in this case, period.

      As what comes to performance:

      Active Record offers no viable caching. RoR has web tier caching but not data tier caching.

      Active Record also loads everything lazily, which means that it suffers badly from N+1 loading problems. In other words it performs very badly with comples object graphs.

      Also pure performance differences between Java and Ruby are clear. Take XML parsers for example, where Java is 50 times faster.

      Having said that, you can use RoR for many things but don't think there are no severe limitations, because there are!

    2. Re:RoR sounds great, but... by wackysootroom · · Score: 1

      RoR can not be successfully used with legacy databases that do not honor any kind of 'object' structure. I am not saying that Hibernate is any better, but you can not use RoR in this case, period.

      Can you back this up? I think you're mistaken.
      Antithesis

      I've used rails in some small test cases with legacy databases. It's not as easy to set up but it's still easier than hibernate.

    3. Re:RoR sounds great, but... by tvaananen · · Score: 1
      Sure. Take an arbitrary database with weird field names that make no sense until after readin the documentation. Now let Ror map the fields to accessors and you get a nice alphabet soup that nobody can understand nor read. And guess what, most of the tables will be so abstract or do not have enough abstraction that the objects make no 'real-life' sense.

      I am just saying that unless you as a developer are desiding what the database is going to look like, you are wasting your time with RoR.

    4. Re:RoR sounds great, but... by unDees · · Score: 1

      Okay. I'm using Rails in the real world and enjoying it, so let me take on your question.

      RoR follows the double-edged-sword philosophy of convention over configuration. So, instead of specifying your ORM in a config file, you set up your database table/field names to follow certain conventions. That, in the view of many, is both a pro and a con of the framework.

      If you're starting from scratch, and you can name your tables as you please, then it's no extra effort to name them the "Rails way" and save a whole lot of typing in your code. But the downside is that if you have a complicated, non-Rails-like, or legacy mapping, you'll have to do more work to bring it into Rails. Not to say that it can't be done, of course, just that it's extra work.

      Rails is also a young framework, so you get all the attendant disadvantages that go with that (lack of buy-in, not as many books/courses available, missing some sophisticated SQL optimizations, etc.).

      Please understand, people get really enthusiastic about Rails for a reason -- many find it a pleasure to use. So their enthusiasm naturally becomes superlative-laden exclamations on the Web. But there are plenty of others who use Rails not because it's today's buzzword, but because they've stared its disadvantages soberly in the eye and are willing to accept them in return for the benefits (rapid development, good-enough performance, and an aesthetic that fits the problem at hand).

      --
      "I call a baby goat a 'goatse.'" -- my non-Internet-savvy 6-year-old stepdaughter
    5. Re:RoR sounds great, but... by Anonymous Coward · · Score: 0

      I'd be happy to add my $0.02 to this discussion. Check out my blog entry on RoR that I wrote because of the blatant overlooking and shouting down of anyone with a negative comment on slashdot back when the second tutorial for RoR was posted.
      <Disclaimer>:
      I'm not against RoR or Ruby and I don't care much how good it is compared to any other language. I simply want good tools.<Disclaimer>
      Regarding the tutorial, I did make one assumption, that it would work as the author (and others on slashdot) posited that it would with legacy databases. From my experience, it *DOES NOT* play nicely with legacy databases. I tried to hack up an app based around my mythtv database and see whether I could throw together a little interface for transcoding the recordings through RoR. After following all the documentation I could find (actually pretty scarce for figuring out how to work with legacy dbs) and finally managing to get my web app to act like it might be working, I discovered that it had been truncating the data in my mythtv database every time I loaded up the web app.
      Now, to be fair, I know *very* little about Ruby and could possibly have caused this (unlikely), but according to everything I read, I hadn't actually ever instructed the Active Record to delete any data so I have no idea how it was that every table in my mythtv database was being truncated each time I loaded up the webapp.
      For those who would call me a troll, idiot, or clueless, you may be correct on one or more of those counts, but you cannot call me a liar. I saw what happened and I intentionally ran a few tests to reproduce it and was successful with those tests. I didn't keep any of the code around and so you'll have to take my word on this one.

  63. Re:Wait..... by MemoryDragon · · Score: 1

    You never really had to deal with the issue to attach to one of those big irons did you? You never had the issue to develop for an RS6000 which was a very valuable production machine and no software install basically was allowed, and you never really until install time you were able to even get access to the machine? Java is not the best solution to quickly hack the average guestbook, but it definitely shines once you have to cross platforms.

  64. Just plain wrong. by Anonymous Coward · · Score: 0

    Speed matters.

    Period.

    Why is your browser/OS/emailclient/imageprocessor/compiler etc. written in C or C++.

    Speed, baby.

    Sorry, but as the flamebaiter AC mentioned above, C is still the King !!!

  65. 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.

    1. Re:Wrong attitude. by swimmar132 · · Score: 1

      Um. Tell me, how can you make a function that takes raw SQL and automagically makes it secure?

      You don't have to use the raw SQL functions, but they're available. And there's no way to make them secure.

    2. Re:Wrong attitude. by swimmar132 · · Score: 1

      Oh, and all the automatic SQL code generated by Rails IS safe.

      It's when the user wants to send raw SQL to the database that security problems could exist.

    3. Re:Wrong attitude. by Some+Random+Username · · Score: 1

      Um. Tell me, how can you not read, but can reply? I specifically said the SQL that rails makes. Rails does not make any guarentees about safety, and you can pass arguments unsafely. A patch was proposed to fix this, and David refused it because people who somehow guessed to use the function safely would be inconvienced by changing the semantics of the function to protect people who didn't have the psychic abilities to use the function safely.

    4. Re:Wrong attitude. by swimmar132 · · Score: 1

      Link please. I think you've got things confused.

    5. Re:Wrong attitude. by Anonymous Coward · · Score: 0

      >It's when the user wants to send raw SQL to
      >the database that security problems could
      >exist.

      And pretty much any web application worth its salt will need to sent raw SQL with Rails, or else you're going to get the N+1 speed issue with ActiveRecord.

      http://www.loudthinking.com/arc/000235.html

  66. A Legitimate Question by MightyMartian · · Score: 1

    I'm primarily a GUI programmer, particularly in accounting situations. I've been moving over to Java (slowly) from VisualBasic, but am not so dedicated to it that I couldn't switch. How well do the Ruby GUI libs work, and have platform independent are those libs?

    --
    The world's burning. Moped Jesus spotted on I50. Details at 11.
    1. Re:A Legitimate Question by swimmar132 · · Score: 1

      ruby-gnome2 is pretty good. all i've used. there's also tk and wxwidgets.

      GUI programming's probably not Ruby's strong point though, especially on Windows.

    2. Re:A Legitimate Question by Anonymous Coward · · Score: 0

      try wxruby or wx* that way you can switch or combine languages and still use the same window tool kit.
      wxw
      wxruby

  67. Site Crashing by jgehtland · · Score: 1

    Yeah, the site crashed. Its, ummmm, well, Mambo and WordPress, if you must know. I'm trying to get a hold of the good folks at TextDrive to see how to handle all you slashdotters.

    1. Re:Site Crashing by Anonymous Coward · · Score: 0

      Ah, so you're the fellow responsible for the slashdotting. :-)

      (Another customer on the same server.)

  68. Re:Wait..... by ramone1234 · · Score: 1

    It is also purposely verbose as it makes large projects involving many members in different teams easier. Comments are sure nice, but in the end the code does the talking

    Errrr... so the more code there is, the easier it is to read and understand? That flies in the face of ideas like logical abstraction ( http://c2.com/cgi/wiki?OnceAndOnlyOnce ), code reuse , and higher-level languages in general and certainly doesn't agree with my experience...

  69. parrot ? by Anonymous Coward · · Score: 0

    ...Ruby is getting a new optimized bytecode compiler for its upcoming 2.0 release. ...

    Wasn't (or rather isn't) parrot supposed to be some wiz-bang bytecode interpreter for scripting languages, designed to be an underlying bytecode engine for multiple scripting languages?

    I find it kind of sad that we could have a good framework for a common bytecode engine.

    We could write different parts of something in different languages if we wanted, with common bytecode for each. Someones ruby code could work with someone elses php/perl/rexx/??? code.

    Portions that need high optimization could be written in the lower level "psuedo-assembler"

    But... we never actually see anything like this in practice. It's always 15 different languages and 15 different sets of libraries.

    Sure would be nice to write *portions* of something in ruby and other portions in another language. We'll never see this, because the ruby people would probably not want to cross boundaries with the "others".

  70. Exactly. by Some+Random+Username · · Score: 1

    Its an internal server error.

  71. Re:RoR == the mysql of web servers by swimmar132 · · Score: 1

    Man, there's so much wrong FUD being thrown around here, it's not even funny.

    Rails DOES have caching. Rails CAN DO I18N. Rails can scale. Rails does have documentation (and a few books are coming out in a couple months).

    http://manuals.rubyonrails.com/read/book/16 for how to use gettext with Rails.

  72. He used tomcat for a benchmark? by Some+Random+Username · · Score: 1

    Tomcat is certainly not known for performance, well, not known for it in a positive way anyhow. How about doing the same benchmarks using resin or a commercial java server instead of tomcat?

  73. 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: 1

      Sorry you misquote me. I said share nothing environments scale because you can just put up 100 web servers to take part in serving the application.

      Im well aware that J2EE apps or apps which are based on multi threading dont scale easily. You cannot easily distribute them over many servers because they rely on internal state. And if they don't the overhead of the internal communication channel will take up 100% of the resources at a certain point in scaling.

      Saying that only trivial apps scale well gives away that you obviously never pursued the share nothing approach to scaling. Its the technology employed by google, amazong, ebay, blogger, live journal and so on.

      Here is what you do when your typical lighttpd/apache rails application hits its one cheapo server limit ( at around 60 pages/sec currently, so the volume of about 1% of all web applications):

      You get one extra server, configure lighttpd or mod_fcgi to use external fcgi servers and point it to the new machine.

      This means that if more processes are needed to handle the incoming requests more rails instances are spawned on the machine which has the lowest current load. You can add and remove any amount of computers at any given time. What do you do when the web server is overloaded ( at around 1.7k requests/s ) ? You add another using round robin dns. What do you do when your database cant cope anymore? Add caching using memcached, get lots of ram for all the boxes available and add it to the memcached cluster, do like livejournal which has a 30gb cache going on. What do you do if your DB still is too slow? Segment it. Clients A-M on one DB, Clients N-Z on another, thats what ebay does.

      Scaling stuff is incredibly easy if you dont buy into flawed technologies. Whats even more important is that it can easily be retrofitted and doesnt need to clutter up your development process with unnecessary complicated crap.

    2. Re:Application scaling by dubl-u · · Score: 1
      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.
      Perhaps you should ammend that statement to be "There is nothing easier in the world to scale than trivial webapps".

      Amen to that. If there's an app that actually shares nothing, there's not a lot of need for it to be a web application; you can run it at home. Most apps actually share quite a bit, and the essential question of scaling is which bits really need to be shared and by how much.

      Further, it's pretty silly to say that throwing hardware at something is easy. It may be easy for the programmer, but it can be hell on the sysadmins and the CFO. Especially when the throw-hardware-at-it approach requires ever-larger boxes, where $/performance increases exponentially.
    3. Re:Application scaling by cthrall · · Score: 1

      > I said share nothing environments scale because
      > you can just put up 100 web servers to take part
      > in serving the application. ...
      > Its the technology employed by google

      Wait, do you think Google's implementation is not technically complex?! Cause...that's kinda what you just said. Find the 30min. Google video that's out there that covers the technical bits of what they're doing.

      Scaling is not trivial in any dynamic application...especially when they have 2500+ boxes, like Google does.

    4. Re:Application scaling by Tablizer · · Score: 1

      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).

      What is wrong with the second approach: each user is assigned a particular server for a given session.

      It may not be a trivial feat, but doable without hiring a Nobel winner. It is just a matter of keeping track of stuff. One simple approach is to divide up servers based on user's last name. All A-to-G's go to server 1, all H-to-P's go to server 2, and the rest to server 3, for instance. (If a girl gets married in the middle of a web-session and gets a new last name, well, she is screwed :-) Or do a hash on the iser-ID number.

      However, what seems a more difficult issue is *shared* active data, such as auction info. The database can then be a bottleneck, but that is more the realm of a DBA or DB tuner than web server admins.

      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

      I know I will probably get slammed for stating such, but this seems mostly a problem with OOP designs, which tend to create mini roll-your-own navigational databases in memory. A more RDBMS-centric framework that uses more declarative techniques tends to push such resource management off to the RDBMS. Sure, this creates its own performance issues, but DB tuning is a better-understood art at this stage. You can always buy a big-ass Oracle or DB2 system/cluster and hire a performance expert(s). That is more commoditized then the web-server-side so far. Relational is better understood and has more road-tested products than navigational.

    5. Re:Application scaling by multi+io · · Score: 1
      Very interesting posting.

      If your app must support user sessions, where do you store the sessions' data? I know that rails (or cgi.rb) by default reads and dumps the session data on each request using Ruby's object marshalling/unmarshalling facilities. Does that scale well to your 1000 req/s scenario? do you use NFS or something among the fcgi server machines then? Or do you use a database?

      Methinks that storing the sessions in memory wouldn't work because each request may be handled by a different Ruby interpreter running on a different machine.

    6. Re:Application scaling by reaper · · Score: 1
      What is wrong with the second approach: each user is assigned a particular server for a given session.

      Nothing... I was just stating that it's one of the most common ways to do it... sorry for the confusion. The "no-state" doesn't work in complicated apps, and the 3rd-party session server just creates a different bottlneck somewhere else.

      I know I will probably get slammed for stating such, but this seems mostly a problem with OOP designs, which tend to create mini roll-your-own navigational databases in memory.

      Actually, I see it mostly in Windows webapps using DCOM. The problem seems to be they push the simplicity of designing complicated apps with that framework, but slack on the hard-core docs on how to manage memory, persistance, and caching.

      --
      - Dan
    7. 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.

    8. Re:Application scaling by multi+io · · Score: 1
      The best solution for this is memcached.

      When using fcgi? How does that work? You have multiple Ruby interpreters, and each request may be handled by a different one (or not?). So there's no shared memory in which to store the session data...

    9. Re:Application scaling by reaper · · Score: 1

      All of these are good suggestions. My biggest problem is that the share nothing approach isn't always available. I'd love to slap some of my clients for some of their technology choices, but that was specifically listed as a "Don't" in Selling for Dummies.

      Share nothing is also not a good strategy in certain applications where your have to carry around a ton of persistant information. Even if you put it all in the database, you're just moving the problem around. I guess it comes down to where you feel it's cheaper to require the power. In eBay's case, ya it was a much better idea to throw money at a fantastic DB system, and let the crappy web servers hit it with some descent caching. In the case of data entry/retreival services, it may make more sense to keep the databases crunching reports, and hold state in the (much cheaper) web servers.

      Anyway, this is going off topic quickly, but I will say that I don't disagree with what you're saying about share-nothing technologies scaling well by adding more hardware. They do. It's just that many systems of complexity require the session state, and when you do that in a share nothing farm, you shift the session load to a back-end system.

      --
      - Dan
    10. Re:Application scaling by Tobias+Luetke · · Score: 1

      Thats exactly what memcached fixes. memcached is a cluster of memory segments. You just fill up all your server with cheap memory and add them to the memcached pool which leaves you with gigs and gigs of ultra quickly accessible data.

      memcached

      This is what powers slashdot as well

    11. Re:Application scaling by multi+io · · Score: 1
      memcached

      Wow. I see. Thanks a lot.

  74. 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
    1. Re:Spoke to Justin about this... by jgehtland · · Score: 1

      Thanks, Scott! psssttt -- the check is in the mail.......

    2. Re:Spoke to Justin about this... by iwadasn · · Score: 1


      wow, every top notch java programmer you know spends their time writing web pages? Maybe this says something about you?

      Not to be insulting, but that's a pretty broad brush you're painting with.

    3. Re:Spoke to Justin about this... by scottsevertson · · Score: 1

      LOL... It just ticked me off to see people questioning your Java implementation skills.

      By the way, mind if I borrow a bit from your Secure Web Services talk? I'm doing Wisconsin WebSphere Users's Group in a couple weeks, and I'd like to nail them with the pillars: Confidentiality, Integrity, Authentication, Authorization, & Non-Repudiation. Credit given, of course :)

      --


      Scott Severtson
      Senior Architect, Digital Measures
    4. Re:Spoke to Justin about this... by scottsevertson · · Score: 1

      Did I even indicate they were working on "web pages"? OK, maybe I should have said "Ruby and/or RoR", but obviously both Java and Ruby can be applied outside of the web domain.

      --


      Scott Severtson
      Senior Architect, Digital Measures
    5. Re:Spoke to Justin about this... by jgehtland · · Score: 1

      Feel free. Just leave the "how to hire us" slide in there. :)

  75. What Hibernate is not by greg_barton · · Score: 1, Interesting

    I love Hibernate. Hibernate is not a speed demon. It's a scalability demon. It's a OR mapping demon. It's a flexibility in persistence demon in spades.

    It ain't fast. It's not dog slow, but you've got to pay the piper somewhere. If you cache out the wazoo you can get some decent performance, but then you pay in memory. (and if you're clustering, in multicast interserver network traffic)

    So get over it and use the tool for what it was meant to be used.

  76. 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.
    1. Re:Hardly by mikera · · Score: 1

      And more importantly than that, you wouldn't be using a lame old general purpose processor. You'd have rolled your own vector processing chip with a custom instruction set specifically optimised for web browsing.

    2. Re:Hardly by Anonymous Coward · · Score: 0


      All C compilers let you use inline assembly to optimize trouble spots.

      So yeah, if speed becomes a problem, you generally should be dropping to assembly.

  77. Ruby rocks compared to java maybe. by Some+Random+Username · · Score: 1

    Rails is not special or impressive. The only people who seem to like it are people who were using huge bloated java stacks. Try comparing rails to something good like seaside and then see how much it "rocks".

    1. Re:Ruby rocks compared to java maybe. by zardo · · Score: 1
      LOL, nice, a smalltalk developer speaks up. LOL!!!

      I looked at this seaside homepage, looks interesting, I've always liked the concept of programatic HTML generation, I'd like to see this sort of stuff ported over to ruby, I f***** hate writing HTML, and I hate dreamweaver and all those wysiwyg editors, I'd like to create inheritable structures and stuff...

      Very doable in rails. Rails is a pretty new framework and stuff is constantly being added. I aint switching over to no smalltalk framework, smalltalk has been around for what, 20 years, and its still struggling for acceptance, I want something with momentum, you know? Rails has definately got momentum.

    2. Re:Ruby rocks compared to java maybe. by Elendur · · Score: 1

      Interestingly, there is a ruby framework based on seaside. It's called Borges, and can be found here.

  78. Re:C is still the King !!! by fishbowl · · Score: 1

    Fortran still wins on numerical integration methods.

    --
    -fb Everything not expressly forbidden is now mandatory.
  79. Marketing. by Some+Random+Username · · Score: 1

    The rails guy is constantly pushing rails at every opportunity, and is smart enough to start lots of java flamewars to get even more attention. Once you start like that, you end up with other people getting excited and pushing it at every opportunity too. Before you know it, every other story on slashdot is about rails.

    Nobody has really made any serious attempts to push seaside, or any of the python frameworks, so obviously they are less well known. That's ok though, you don't have to use rails just because its the latest fad.

    1. Re:Marketing. by abigor · · Score: 1

      Is there a good comparison of the various Python frameworks available? Like, what are the strengths/weaknesses/purposes of Twisted, Zope, CherryPy, etc.?

      I'm familiar with Zope because I've used zodb a lot (recommended, by the way). But I know nothing about the other frameworks.

    2. Re:Marketing. by alex789 · · Score: 1
      That's ok though, you don't have to use rails just because its the latest fad.

      Well. You're sort of right. But you're also completely wrong. Large mindshare translates into large userbase which translates into good community support and a multitude of add on modules and more mindshare and so on. And anyone who's using an unknow pythonic framework will be missing out on all that.

      I just did my first project in CherryPy and it's been a very nice experience. But already now I'm thinking of doing my next project in Rails.

      And of course, the guys behind Rails are to blame for this.

      --
      http://flosspick.org finding the right open sour
    3. Re:Marketing. by alex789 · · Score: 1
      --
      http://flosspick.org finding the right open sour
    4. Re:Marketing. by abigor · · Score: 1

      Wonderful, thanks very much.

    5. Re:Marketing. by idlemachine · · Score: 1
      Is there a good comparison of the various Python frameworks available?

      There's the PyWebOff: http://pyre.third-bit.com/pyweb/index.html

      "PyWebOff is a compare-and-contrast exercise to evaluate the strengths and weaknesses of some of the major Python web application frameworks."

      Not all of the frameworks have been assessed yet but it still seems pretty active.

  80. You can try, or it works? by Some+Random+Username · · Score: 1

    There's a big difference between "you can put identical copies of your rails app on many servers and it works if everything is normal" and a real distributed app. What happens to the users in the middle of doing something on one server when it goes down? And rails caching is per server, which is a complete waste and starts to look really stupid when you have a big app running on a few dozen machines.

    1. Re:You can try, or it works? by andreas1245432 · · Score: 1

      What happens to the users in the middle of doing something on one server when it goes down?

      Nothing happens, because the application state is contained in the database.

      And rails caching is per server

      Wrong. You can choose between 2 distributed caching systems (DRb and MemCached).
  81. 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
    1. Re:Out of the box by Anonymous Coward · · Score: 0
      In 10 years Ruby will be supplanted as well -- and we'll be talking about the NEXT great language.

      Do you really think Arc will be ready so soon?

  82. Re:News Flash! by northcat · · Score: 1

    You see your post modded down? That's because you pissed off Java programmers by saying that you think that an aspect of something they do is not very perfect. You insulted their egos. Bad bad Kimos. Go sit in the corner.

  83. No, it doesn't. by Some+Random+Username · · Score: 1

    There are already similar or even better (seaside) frameworks in other languages, including both python and perl. Rails is well marketed, that's all.

    1. Re:No, it doesn't. by Junta · · Score: 1

      Then list them for the sake of comparison...

      I know I'm getting bombarded with rails rails rails and no one else seems to bother to talk about what other things are similar in other languages..

      --
      XML is like violence. If it doesn't solve the problem, use more.
    2. Re:No, it doesn't. by Anonymous Coward · · Score: 0

      Perl has Maypole among a few other solutions (which I can't recall). For the most part I wouldn't be so concerned about the framework comparison, I'd be concerned about the language.

      Personally I think Ruby wins there before you even lookat Rails and the compeditors.

  84. sincere newbie asks.... by Anonymous Coward · · Score: 0

    what is the difference between python and ruby ?
    what is the difference between ruby on rails and zope ?

    1. Re:sincere newbie asks.... by Anonymous Coward · · Score: 1, Informative

      Python and Ruby are different programming languages.

      http://en.wikipedia.org/wiki/Python_programming_la nguage

      http://en.wikipedia.org/wiki/Ruby_programming_lang uage

      They are both good languages, with useful features and libraries. If you've never tried either before, just take your pick of which one seems the best from a tutorial. They have some overlap with what type of stuff you can do with them (webapps, command line scripts, administration automation, etc).

      Ruby on Rails and Zope are different web application frameworks. Zope is written in Python and you use Python to program with it.

      With Ruby on Rails, you can get up and running pretty quickly. Zope has a bigger learning curve, and some would argue it is more powerful. That's really a matter of personal taste.

      Ruby on Rails uses the "Model-view-controller" approach to software. This is a traditional way to do things, and IMHO Ruby on Rails does a good job of implementing it for web applications.

  85. Re:C is still the King !!! by Anonymous Coward · · Score: 0

    If you're writting web applications in C... uh, you need help. You're just making it way harder than it needs to be.

  86. 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 :-)

  87. RE: 5 years of J2EE is already irrelevant by Anonymous Coward · · Score: 0

    Now, the question is how long with the job they hold last before it is farmed off to some middle eastern-ish country or is given in to a new mandate at the company to switch to RoR. I give them 6-12 months job security at the most.

  88. Re:Wait..... by LnxAddct · · Score: 1

    No, actually it sees which parts of code are used more often then others and dynamically changes it's bytecode to optimize for the most reoccuring situations. If you start a server and measure performance after an hour, it'll (99% of the time) be faster a week later.
    Regards,
    Steve

  89. No. Speed is the most important. by Anonymous Coward · · Score: 0

    Sorry, but it is.

    Yes, they teach you in sophmore programming that speed is not important. And if you don't know what the fuck you're doing, then , yeah, you need to concentrate on readability and correctness first.

    In the real world, fast is important.

    And you're right. If it's not fast enough, use assembly. Any good C compiler will give you an escape to assembly.

  90. 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 andreas1245432 · · Score: 1

      Rails sucks because David thinks security is your problem, and leaves in functionality that can easily be misused to create a security problem

      Where? Tell me.

      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".

      You know what the term "beta version" stands for?
    2. 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
    3. 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.

    4. Re:Sure. by Anonymous Coward · · Score: 0

      > Rails sucks because its development is incredibly mysql centric, and doing anything beyond the basics with real databases will result in tons of bugs

      That was my impression. Who uses just a single query on a single table *per page*? ROR is kind of neat, but I've got many queries per page spanning several tables, calling subqueries, etc. etc. etc.

    5. Re:Sure. by rho · · Score: 1
      What I'd like to know is whether offering support for MySQL means that it is forced to use workarounds for 3.x versions of MySQL that are still scattered around on Web hosting services. Things like a lack of foreign keys, stored procedures, transactions (or full-text indexing, if you use InnoDB for the transactions), etc.

      When a PHP/Ruby/Perl/Whatever Web API tool gets built, it assumes a connection to a half-ass DB like MySQL, which it then uses as a less-dangerous way to store stuff on the filesystem. This utilizes a RDBMS's strengths not a whit, and makes your data modelling a joke.

      Rails' ability to sniff out a schema and make intelligent decisions about it is very neat. But if you have a complex data model, how well does it do then? Or are you limited to the showy demo things I've seen in the reviews. If I want a recipe app, there are billions already coded. I'm not interested in using Ruby just for fun.

      --
      Potato chips are a by-yourself food.
    6. Re:Sure. by cjs · · Score: 1

      Basically, if you're using a an RDBMS rather than MySQL, and you really want to use it, Rails--or to be more precise, ActiveRecord--is not going to make you happy.

      ActiveRecord is not smart about sniffing out schema information. In fact, beyond table and column names, it pretty much ignores your schema. Be prepared to re-specify all of your database constraints and relationships again.

      ActiveRecord defaults to non-relational "single table inheritance" (rather than more relational class table inheritance) for hacking around the "O/R impedence mismatch." Backwards approach: this "mismatch" comes from programmers using an RDBMS outside of their code, and then trying to map the schema to something you could put into a hierarchical database internally. Well of course it can't be done easily, and sometimes not at all: that's why we're using RDBMSes instead of hierarchical databases these days.

      ActiveRecord (and this is very silly) uses some tricks to use class inheritance to indicate that you want Single Table Inheritance, which means that you can't use class inheritance to move functionality around. This means that some very simple refactorings, such as pull up method, are forbidden to you. And you have to do some nasty tricks to disable this.

      In short: if you really use the power of an RDBMS, ActiveRecord will hurt you. If you don't even use an RDBMS, as most ActiveRecord users don't (they use MySQL instead), it's fine.

      cjs

      --
      The world's most portable OS: http://www.netbsd.org.
    7. Re:Sure. by rho · · Score: 1
      Your answer was helpful, informative and educational. I instinctively fear it.

      Why are you on Slashdot?

      --
      Potato chips are a by-yourself food.
  91. not any more by Anonymous Coward · · Score: 0

    Seems it was recently converted to PHP... check the site.

    1. Re:not any more by Anonymous Coward · · Score: 0

      The information site is but the actual web application "BaseCamp" is not written in PHP but in RoR.

    2. Re:not any more by Anonymous Coward · · Score: 0

      Then the link the poster gave is wrong.

      Give a proper link please. Or are you afraid it will be Slashdotted/hacked out of existence?

  92. This guy's browser is written in Java. by Anonymous Coward · · Score: 0

    Hey, how's your Javagator working?

    How 'bout that ol' JavaOs you're running?

    Is it fast?

  93. You don't use PHP much huh? by Some+Random+Username · · Score: 1

    If I have a "stock" PHP and I want the gd libraries, I don't do either of your nonsensical choices. I compile the PHP gd module, uncomment the php.ini line that loads the PHP gd module, and reload apache. You don't need to compile everything into PHP you know, and in fact its pretty dumb to do so. Not trying to defend PHP for a large project or anything, I'm not crazy. But you shouldn't challenge people to tests you don't understand.

  94. Fortran is slower. by Anonymous Coward · · Score: 0

    check out the link. Fortran hasn't been faster since -O3

  95. Part of the Reason by vivin · · Score: 1

    Well, I think I know what part of the reason is. In a lot of Universities, they switched from C++ to C++ around 1998 or 1999. A lot of these people are coming into the workforce now. They are loathe to study anything else, since they only depend on what the university taught them. Basically, they are just tailormade computer scientists/engineers. They do not have the drive or urge to go out and learn something new. They basically don't even try to find out what's new because they only know what their courses taught them. A lot of them also joined the CS programs because "there's money to be made in computers". There are certain techonologies I like better than others, so as a personal choice I will use the one I like. But if I'm told I need to use the other technology (the one I don't particularly like, or know), then I'll poke through documentation and try and learn it. For example, I don't particularly like ColdFusion. But I had to use it once because that's what the department used. In another scenario, they were using CF, but I suggested that they change to PHP, which they did.

    Anyway, so these "fanboys" know Java like the back of their hand, but don't want to switch to anything else. Which is why, just like the GP said, they will attack anything that could invalidate their "experience".

    --
    Vivin Suresh Paliath
    http://vivin.net

    I like
    1. 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.

    2. Re:Part of the Reason by Anonymous Coward · · Score: 1, Insightful

      Hmm, HTML, javascript etc are not programming. And as far as "all these college kids learn now-a-days is java" posts, that is total crap. The paticular language is meaningless, it is the concepts behind CS that are important, not the flavor of the month language. Heck, MIT teaches its intro courses (until sophomore year I believe) in scheme, which outside of AI, is used by no one.

      So I repeat, the language doesn't matter. If someone just out of school is any good, any good at all, then he or she can jump from one language to another with no paticular attachment. Maybe after 5 years stuck on the same language (I'm talking to all you C people out there), then there may be a reluctance to learn something new.

    3. Re:Part of the Reason by SageMusings · · Score: 1

      You're dead wrong,

      Ask any HR department in the country; You are no good unless you have 8+ years of every language on every platform and references to back it up.
      What's that you say? You have a firm grasp on the basics? Thank you for your interest in our organization. See us again in 10 years when you have all the insane experience we're demanding for that entry-level job for next to no money.

      --
      -- Posted from my parent's basement
  96. I was unclear about YARV. Let me clarify by Paradox · · Score: 1

    YARV is Rite, now (I linked the announcement Matz made).

    The point of YARV is to make Ruby run faster (as in, the VM itself is optimized and has JIT support being built), and help reduce memory footprints (Ruby code-as-text is reduced to ruby-code-as-bytecode). It moves towards both these goals with "superinstructions", which are statistically common groups of instructions that are made into one.

    Before people mention it, RISC architectures are considered by many to be best for hardware, but in VMs, CISC architectures are generally better (and that's why YARV is a CISC system).

    YARV may not speed up rails all that much though. Rails allready can cache and serve pages at the limit of the web server's caching ability, and with action caching (which is slightly more set back from page caching) you get nearly the full speed (1000req/sec instead of 1500req/sec).

    --
    Slashdot. It's Not For Common Sense
    1. 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.
    2. Re:I was unclear about YARV. Let me clarify by jericho4.0 · · Score: 0, Troll
      Language is a living thing. Witness Chaucer, and his multiple spellings of one word in the same work. The 'right' way to say or spell something is largly the invention of 1800's school teachers and acedemics who thought they were better than the vulgar man on the street.

      IMO, focusing on such aspects of a persons comunication is a sign of intellectual hubris. "Well,I know several phrases in Latin." means nothing.

      --
      "A language that doesn't affect the way you think about programming, is not worth knowing" - Alan Perlis
    3. Re:I was unclear about YARV. Let me clarify by kiltedtaco · · Score: 1

      teh ponite es tat fi u wnate 2 talcker aboot sumethin, eu meyeght wahnt to acteuale canvey waht u gotz 2 sey affectevely.

      It's like brushing your teeth, standing up with decent posture, wearing clean clothes, i.g... You can say it's big bad academics who are at fault for not listening to every malpropism-ridden sentence anyone has to say, but if you present yourself like an uneducated bum, you're going to be treated like one.

      You can appeal to Chaucer all you want, but you negate the effect with your very own statement that language changes. We have dictionaries, and relatively standardized spelling now, much unlike the 15th century. Do you propose we recind the Great Vowel Shift just because it occured after Chaucer?

      "I know several phrases in Latin" is a strawman argument. Nobody's saying knowing Latin is the greatest thing in the world. More important is the statement "I can communicate effectively," which is the entire point of language. In some circles it's necessary to know the (correct) Latin to communicate with other people. If this isn't your circle, then nobody's forcing you to learn the Latin, but you can't claim knowing the correct Latin is universally irrelevant or a "sign of hubris".[1]

      Final point: yes, language changes. But the ultimate definition of what a word means comes from what others will understand it to mean. If I said "o.k." when I meant "No," then I would clearly be in the wrong. You can argue that "ok" is starting to be understood as "no" by some people, but the question of whether it's "right" or "wrong" lies ultimately with how people will interpret it. That's why (good) dictionaries have usage panels.[2]

      [1] Cf. http://itre.cis.upenn.edu/~myl/languagelog/archive s/001843.html
      [2] I happen to trust what these people believe to be "right": http://www.bartleby.com/64/12.html

    4. Re:I was unclear about YARV. Let me clarify by computational+super · · Score: 1
      Language is a living thing

      Actually, I beleive all changes to the Latin language were finalized over a thousand years ago.

      --
      Proud neuron in the Slashdot hivemind since 2002.
    5. Re:I was unclear about YARV. Let me clarify by ahdeoz · · Score: 1

      by and by, you may be proven wrong> Consider the following exchange, already in common usage:

      "How are you?"
      "O.K."
      "What's wrong?"

  97. Not that I found. by Some+Random+Username · · Score: 1

    You kinda have to try them all and see if you like them, which can be quite annoying when sparse documentation makes trying things take longer than it should. I don't actually care for python though, so I'm not the best person to ask.

  98. Good for Ruby! by helix_r · · Score: 1


    I'm tired of over-complicated J2EE messes.

    A few years from now, people are going to re-visit the legacy j2ee junk that was written today. They will just junk it and start from scratch. Why? Because no one will want to muck around with the endless unreadable globs of declarative configuration that comprises a j2ee application.

  99. 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)

    2. Re:Zope 3 by Lodragandraoidh · · Score: 1

      Thanks. That puts it in perspective for me.

      I've been using Zope 2 for about a year now - and just starting to dig into the guts of it (for example, I've built simplified applications through the interface and as external methods - but have not built a full-blown zope product as of yet), and have been trying to figure out the Zope 3 'lay of the land'. I love the object database - it does things simply that took much time and effort using SQL DBMSs and java or perl. However, some things that are straightforward via the command line (perl/python) are another matter when trying to interface with the ZODB through the web interface.

      I've had experience with java - but not J2EE, or Beans or any other java development environment/libraries. Everything I've done with java has been either using what was already available in the base classes, or building my own - so these extended frameworks/classes/libraries have always been questionable in my mind from a productivity standpoint (it was many times easier for me to build it than to figure out how to use a library). Add to that my encounters with several venders who used proprietary (black box) libraries which ended up causing problems which we had to code around, and you can probably see why I am not fond of java solutions.

      On the other hand, I have had nothing but good things happen as a result of using Zope 2 - I've been able to acquire or build some fairly complicated interfaces relatively easily - and quickly, and save money and time.

      My hope is that Zope 3 will be an improvement over Zope 2; at the same token, I am worried that much of my assumptions regarding how Zope 2 functions will be useless with Zope 3. Either way, I'm comfortable where I am; I refuse to go back to Java and Perl for web application development - so will make the best of it. I can't afford to start over from scratch either from a development standpoint, or from a learning curve standpoint (language mostly - debugging python is way easier than perl - and framework secondarily).

      I'm swamped now, but once I get into maintenance mode, perhaps next year I can devote some time to examining Rails - or who knows what will be available by then?

      --

      Lodragan Draoidh
      The more you explain it, the more I don't understand it. - Mark Twain
    3. Re:Zope 3 by Lodragandraoidh · · Score: 1

      PS -

      I wonder if there is a single document that really describes the differences between all of these approaches? That would be worth buying.

      --

      Lodragan Draoidh
      The more you explain it, the more I don't understand it. - Mark Twain
  100. They have, the example in question just didn't. by Paradox · · Score: 1

    Rails has everything you need to make the webapp secure. Everything.

    The bug was in a wiki'd tutorial and was only up for about 30 minutes before corrected but you'd think that every single Rails developer has horns now. Most people never even saw the tutorial during that transition.

    If I call your SQL line directly, isntead of going through the framework, how exactly can said bypassed framework protect you? Rails gives you a trivial way to safely execute arbitrary SQL, and several ways to execute specific types of common SQL qualifiers on common actions (like find-by-id or find-by-field).

    Please, stop FUDing.

    --
    Slashdot. It's Not For Common Sense
  101. It doesn't matter. by Some+Random+Username · · Score: 1

    You don't need to alter objects at run-time to make a rails like framework. That's a rediculous way to try to make ruby seem special. The question is "can problem X be solved by language Y?" and your answer is "no, you would have to do it differently". There's nothing wrong with doing it differently, it still solves the problem. Just because you don't like the perl or python way of doing something, does mean they are wrong and ruby is right. Different strokes for different folks.

    But showing how uninformed you are with the lisp flamebait, and the lies about not being able to use python for templating really adds to your credibility, nice touch.

  102. I already did. by Some+Random+Username · · Score: 1

    Seaside. That is the list. Nothing else makes the list because they all (rails included) look sad and pathetic in comparison. I do not care for python, so I can't really comment on the quality of various python frameworks except to say that I hated zope (not really a framework, I know).

    1. Re:I already did. by Anonymous Coward · · Score: 0

      > Seaside. That is the list

      It's hard for me to gather any kind of take on Seaside because the documentation looks pretty thin. Just after a brief glance at it, it also appears Seaside uses code to generate HTML instead of templates. I'd be shocked if that's considered the best practice for Seaside

      Let me know if I'm just missing something.

  103. Caching strategy by cca93014 · · Score: 1
    Having read TFA I noticed (if I read it right anyway) that the two caching strategies of each stack were very, very different.

    RoR was taking the entire page output of a new request, caching it, and then sending that entire result for subsequent, similar requests.

    The Java stack, OTOH, was using some fairly complex middle and data tier caching inside Spring and Hibernate.

    These are VERY different caching strategies. I'd be interested to see the results if the author had used something like OsCache on the Java stack.

    My company powered the site for a very large UK awards show, and used OsCache heavily; the results were fairly impressive, allowing us to soak almost half of the server's 100Mbit network pipe at peak traffic without putting a great deal of load on the server (I think top was showing around 0.5/0.6 at peak load, although I realise that this is not a good indicator of load).

  104. Re:Wait..... by krumms · · Score: 1

    People keep telling me this, but where's PHP's threading implementation? You're going to have a pretty limited range of GUI apps if every application can only have a single thread of execution.

  105. But should you? by teknomage1 · · Score: 1

    I've written my fair share of php web applications and I'd say I've given it a fair evaluation but I don't think it's good for general purpose scripting. I'm not saying it's not capable by any menas, but you don't really leverage its strengths in a shell script. PHP has some acknowledged syntactic flaws that can surprise you if you're not careful. These flaws are tolerated in a web environment because you get a performance boost from php's web feature set, but there's no reason to put up with them in a shell scripting situation when you have perl, python, ruby, and even awk at your disposal.

    --
    Stop intellectual property from infringing on me
  106. Rails Transactional support by Paradox · · Score: 1
    Rails has flexible support for database transactions.You can trivially implement them however you desire.

    Of course, you don't need me to tell you this, you could just check the documentation yourself.

    C'mon, can you even pretend to look into things before you FUD them? There are plenty of valid criticisms for Rails, if you care to find them.

    --
    Slashdot. It's Not For Common Sense
  107. Trails vs Rails by Channing · · Score: 1

    Perhaps another comparison worth making is Rails versus Trails for Java? From the trails site: "Trails is a domain driven development framework in the spirit of Ruby on Rails or Naked Objects."

    Channing

  108. DJ Ruby Rails? by Anonymous Coward · · Score: 0

    All I could think of when i read this headline...

    "And now we enter what must the most beautiful concert hall of all the universe. A perfect replica of the old opera house...but who cares?" --DJ Ruby Rhod, The Fifth Element

  109. 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
  110. stupid question??? by advocate_one · · Score: 1

    can I use this Ruby on Rails to write ordinary applications like I can with java... you know, ones that you don't require a browser or a server for... totally standalone, ordinary, quick and dirty personal type programs, like I used to hack up in superbasic in the good ol days on my QL???

    --
    Donald 'Duck' Dunn: We had a band powerful enough to turn goat piss into gasoline.
  111. 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.

  112. Re:RoR == the mysql of web servers by Anonymous Coward · · Score: 0

    I find the publication of books hardly validating to a technology. RoR delivers, it is fast and rather easy to comprehend and use. The #rubyonrails channel on Freenode.net is FULL of technically capable and able people that will immediately answer questions interactively (using pastebot and your own webby for code and sample pages) in seconds. There is no excuse for people to ignore Ruby cause there are no books available now or available down the road.

  113. Not convinced by Anonymous Coward · · Score: 1, Insightful

    I have nothing to say about the cache performance differences except that a 15-fold increase cannot be explained by language choice but must point to algorithmic and library decisions.

    But more importantly, the reason I'm not convinced is that the author's methodology is rather unsound. He took a first-generation Java application and *reimplemented* it. When you do that, you get to add in all sorts of improvements that you hadn't thought about the first time around. You're not so close to the trees any more. It's entirely possible that the improvements in performance and number of lines were largely due to the fact that he wrote a second generation rewrite, and had less to do with the fact that he wrote it in Ruby. Ruby is a significantly slower language than Java -- I don't think even RoR advocates would debate this. Isn't it possible that the fact that he got his RoR code to run as fast as Java in non-cached mode due to second-generation improvements which countered Ruby's natural computational pokeyness? And the cached mode improvements due to his choice of library?

    You can write dang fast stuff in Java if you're careful (and sacrifice Sun's stupid slow libraries). It's not nearly as easy to write dang fast stuff in Ruby or Python. Indeed, all one really can say about them performancewise is that they can outperform highly lazy code in Java -- which is of course what the vast majority of Java coders write, so maybe that's not so back-handed a complement as it sounds.

  114. Parts of it by Paradox · · Score: 1

    You can use parts of Ruby On Rails, usually the ActiveRecord component, to do app dev with Ruby. Ruby does have FX, GTK and even Qt bindings if you so desire to use them.

    However, much of Rails's work revolves around web work, and so besides ActiveRecord, there isn't much else you can use.

    Ruby is a viable choice for building applications, though. Rails is just one expression of this.

    --
    Slashdot. It's Not For Common Sense
  115. Re:Wait..... by Anonymous Coward · · Score: 0

    sudo apt-get install php4-gd

  116. 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.
    1. Re:Show me the code by shutdown+-p+now · · Score: 1

      So, you mean you can't even manage to write a hundred lines of code by yourself (which is more than enough for a simple testing Rails app) and witness how it performs in person?

  117. No, you start reading. by Some+Random+Username · · Score: 1

    I am not talking about whatever tutorial thing that guy was. I didn't hear about that. I am also not talking about bypassing the framework for the 3rd time, please take the time to read before you jump to defend someone else's baby that you want to live vicariously through.

    I am talking about a few months ago when I looked into using rails, there was a mailing list discussion I came across where passing args to a rails function could be done in two ways. One way protected you from SQL injection, the other did not. A user proposed a patch to disable the unsafe way, since he, and many others didn't even realize that way was unsafe. David refused that patch because it might inconvenience people who were using the insecure way, but protecting themselves manually. This is the exact same attitude that prevents me from using microsoft products. I don't care who is writing the software, if they consider convenience more important than security, I will not use it.

  118. 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.

    1. Re:Here's why Ruby is not an option by Ian+Bicking · · Score: 1
      Python has excellent Unicode support, and I'd say that its general i10n/i18n support (which is really a vague category of support, but common in Python apps) is a big part of why it's caught on well in Europe. Also, there is some auto-completion available in Python IDEs, and in quite a few interactive interpreters (rlcompleter2) is a neat implementation of this). It isn't the same as in a Java or C# IDE -- that's just infeasible in a dynamic language -- but there's some help available there.

      Anyway, you don't need Java to handle these issues.

  119. Find it yourself. by Some+Random+Username · · Score: 1

    I am not digging through the mailing list archives that have no search to find it for you. I am not confused, however if you would like to believe I am than that is fine. I am not asking you not to use rails, I am saying some of us refuse to use it because the attitude of the main developer is that convenience trumps security, and we feel that attitude is harmful.

    1. Re:Find it yourself. by swimmar132 · · Score: 1

      No search? http://news.gmane.org/gmane.comp.lang.ruby.rails

      You are confused and the other posts in this thread do confirm it. Feel free to take a couple seconds to search the archives and prove yourself wrong though.

  120. JSP isn't a framework, stupid comparison. by Some+Random+Username · · Score: 1

    JSP doesn't do that because JSP isn't a framework. He's not complaining about using mod_ruby + eruby and it not sanitizing input, he is complaining that a framework built on top of ruby technologies doesn't make any attempt at being secure.

    Nobody is expecting languages to do these things, but its pretty reasonable to expect a framework specifically built to make dynamic website creation easier would deal with the specific problems that plague dynamic websites.

    1. Re:JSP isn't a framework, stupid comparison. by swimmar132 · · Score: 1

      "No attempt at being secure"? And you're basing that off of one place in AR that could be used wrong?

      Good god. Stop with the FUD.

    2. Re:JSP isn't a framework, stupid comparison. by Some+Random+Username · · Score: 1

      No, I'm basing that off the attitudes of the developers who repeatedly dismiss and/or ignore security issues, as well as the multiple security issues that have been pointed out here. Why is scaffolding vulnerable to XSS? Its not a matter of using it wrong, you can't use it safely at all. And of course, the developers think that's perfectly fine, you shouldn't be using scaffolding for real stuff anyways apparently.

    3. Re:JSP isn't a framework, stupid comparison. by swimmar132 · · Score: 1

      No, you shouldn't use scaffolding for real stuff. It's for development only.

      Is that the only other thing you can come up with?

  121. RoR "facts" by Anonymous Coward · · Score: 0

    Leave it to RoR to claim an obviously PHP-site as their own...

  122. 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
  123. Re:Wait..... by prockcore · · Score: 1

    You can write shell scripts in PHP.

    Yup! I can't emphasis that enough. We have started moving away from perl to php for shell scripting.

    I have a PHP script that converts a Quark XPressTags document into XML. I have PHP scripts that convert EPS images into jpegs (via ImageMagick).

    PHP runs our content management system. Taking things directly from quark and putting them into databases.

  124. I was referring to FreeRIDE by melted · · Score: 1

    And no, it doesn't have code completion. Plus, it uses FOX UI toolkit. Why not GTK? I have no idea whatsoever.

  125. Re:RoR == the mysql of web servers by swimmar132 · · Score: 1

    Uh, ok. You seem all worked up.

  126. Hype vs momentum. by Some+Random+Username · · Score: 1

    I don't care if smalltalk is the current fad or not, that has no effect on me. I care about what framework allows me to be the most productive, which is very clearly, by a large margin, seaside. If someone else does better someday, then I'll certainly consider switching. But flaming java frameworks and developers isn't what I consider "doing better", and that's all that rails seems to care about right now.

    1. Re:Hype vs momentum. by Narchie+Troll · · Score: 1

      Unfortunately, Seaside can't run on any common HTTP servers, and it requires the use of the mind-poppingly bad Squeak user interface for some operations.

      Other than that, I completely agree -- Seaside is an amazing piece of software that makes most other frameworks look primitive.

  127. We get it, you LOVE seaside and HATE ruby and RoR by Anonymous Coward · · Score: 0

    Why all the venom? This is the fourth or fifth post of yours bashing RoR and praising Seaside. Do you contribute to Seaside or do you just hate that something you like isn't similarly appreciated by others?

    Either way it makes you come off looking like a bit of a nut.

    Ruby is Cool. Ruby is Fun. Lots of folks are starting to play with it and that means they're going to develop apps and frameworks that compete with current alternatives - that doesn't mean we all have to turn this into a bloodsport.

    I like Smalltalk too - but you've got to tone it down if you expect anyone to listen.

    Heck, check out Borges, the Ruby framework that's related to Seaside. ;-)

    Kevin

  128. Well, Rails leverages this. by Paradox · · Score: 1

    You're right, you can do things different ways to emulate what Ruby is doing naturally. But, then you begin to lose the beautiful meta-language-syntax that makes ActiveRecord and ActionPack so attractive.

    Python is a great language, and is very powerful. But it lacks true lambdas and closures (yes, you get baby-lambdas, and no, they aren't enough). It also lacks the powerful meta-programming features that Ruby has. Of course, Python has other strengths, but they're not topical here.

    Subway will have to discover what is the natural "Python" way for doing what Rails does (which is a great example of the "Ruby Way"). This may or may not be as beautiful and pleasnt as the Ruby way.

    This doesn't condemn Subway or Python. It remains to be seen what they can do. So far, I don't think many people have been impressed so far, but we're all waiting to see what happens.

    --
    Slashdot. It's Not For Common Sense
  129. No, you just think I am completely wrong. by Some+Random+Username · · Score: 1

    See, the larger user base argument has never held any water. Most of the users are just that, users. They do not contribute anything, and as such do not matter to me. And of course, you might think rails has alot of people, but it mostly has alot of hot air. There are way more java developers, so rails really isn't the best example of "choose this because everyone else is", you should be advocating against rails if you care about marketshare. I would be using windows and GaySP.net if I cared about what is popular. Instead, I use whatever makes me most productive, while still meeting the requirements of the project at hand.

    1. Re:No, you just think I am completely wrong. by Anonymous Coward · · Score: 0

      See, the larger user base argument has never held any water. Most of the users are just that, users. They do not contribute anything, and as such do not matter to me. And of course, you might think rails has alot of people, but it mostly has alot of hot air. There are way more java developers, so rails really isn't the best example of "choose this because everyone else is", you should be advocating against rails if you care about marketshare.

      I strongly disagree with this. Sure, a large percentage of a large user base are 'just users', but a large user base either attracts a lot of real developers or has a lot of developers to begin with. In Rails' case, there's a large fluent community, not 'just users', who are building documentation and providing support. This isn't some backwater Python framework. Rails is a framework with the right mixture of people behind it to have decent documentation, good exposure (blogs, etc), and the right attitude to attract people who actually develop cool stuff (Odeo, BaseCamp, etc).

  130. Actually... by Paradox · · Score: 1

    Code completion via IRB is in the works. It's just a very hard problem.

    As for why not GTK? Compatibility with Windows, Linux and OS X.

    --
    Slashdot. It's Not For Common Sense
  131. Interesting perspective. by Some+Random+Username · · Score: 1

    So, when the entire page is filled with people blindly praising rails, that's all good. But when I say I don't care for rails, and I can't really comment on any other frameworks besides seaside and zope, I am "a bit of a nut"? Honestly, I don't care for python or perl, so I really can't make any comparisons of the various frameworks in those languages, sorry.

    To answer your question, no, I do not contribute to seaside, I am just a user. I do not hate that it isn't as well known either. I am simply advocating it, just like dozens of people are advocating rails in this same discussion. I kinda wonder why you feel that pushing software you like is crazy, but only when I do it.

  132. 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.
  133. No, you are missing the point. by Some+Random+Username · · Score: 1

    You can do things different ways to emulate what ruby is doing naturally, but that would be dumb. There is no need to emulate what ruby is doing, just step away from ruby and rails for a second, and think of the problem, instead of one particular implimentation of the solution. In ruby it may be natural to solve this problem using techniques rails uses. In other languages its natural to do it different ways, which may be more, less or equally "elegant" depending on the perspective of the person reading the code.

    1. Re:No, you are missing the point. by Paradox · · Score: 1

      Uhh, hi. Reread what I said.

      I said to do exactly what you're saying they should do. Step away from your defensive attitude for a second.

      It may just be that, some languges are better at expressing certain patterns. This is not a bad thing.

      --
      Slashdot. It's Not For Common Sense
  134. What... the... heck.... by Paradox · · Score: 1
    A user proposed a patch to disable the unsafe way, since he, and many others didn't even realize that way was unsafe. David refused that patch because it might inconvenience people who were using the insecure way, but protecting themselves manually.


    Umm, closing off arbitrary SQL statements would be an incredibly bad idea. ActiveRecord is great, but it is not the Alpha and Omega of all things you could want to do. It's not developer convienience we're talking about here. If you removed that feature there would be some things you just couldn't do.

    This isn't about discarding security, it's standard practice. Unchecked SQL queries are unsafe. They're unsafe because they're the final level of the database layer. If you don't know this, you're at a novice level of web programming and shouldn't be using that feature anyways.

    Maybe one day ActiveRecord will be so good that you'd never want to use that feature, but that's not now. Sorry.

    But you're holding an unreasonable standard with, here. Keep that in mind.
    --
    Slashdot. It's Not For Common Sense
  135. Anonymous and hidden? by Tablizer · · Score: 1

    The project itself is not open-source; the client is now and shall remain anonymous.

    Nobody is going to be convinced either way if the code is hidden from the public. Maybe he used bad Java coding practices. We won't know 'til we see the code.

  136. No, you are simply ignoring what I am saying. by Some+Random+Username · · Score: 1

    The other posts in this thread have nothing to do with this. I am not talking about any tutorial that was exploited, and I know nothing about that case, never heard about it before now. I am talking about a patch David refused. Thanks for the search link though, didn't realize the newsgroup and mailing list were the same. Here's the link for you:

    http://article.gmane.org/gmane.comp.lang.ruby.rail s/749/match=sql+injection

    As you can see, David refuses to make things secure for people who didn't magically guess to do it the "right" way, because it might inconvenience people. This is the wrong attitude, and I do not trust software written by people who feel convenience trumps security.

    1. Re:No, you are simply ignoring what I am saying. by swimmar132 · · Score: 1

      Hm. Interesting.

      Anyways, Rails is not 1.0. Changes are to be expected. It's not supposed to be perfect yet. And the developer should know the quoting rules for the DB that he/she's using.

      And it's not like there's no documentation out there for securing your web app. Oh wait. http://manuals.rubyonrails.com/read/book/8

  137. No, you aren't understanding me. by Some+Random+Username · · Score: 1

    This has nothing to do with letting people use arbitrary statements. I don't know how you could think that after me already saying repeatedly that I am not talking about users running their own SQL queries. Thanks to the poster above for the search link, this is what I am talking about:

    http://article.gmane.org/gmane.comp.lang.ruby.rail s/749/match=sql+injection

    That is a bad attitude for a developer, and I do not use software written by people with that attitude. I'm not sure why this was such a big deal for you guys to understand, but some people care about security, not just when its convenient.

  138. point of view? by Anonymous Coward · · Score: 0

    jesus. don't cover more bullshit with bullshit. get the facts. ruby parrot effort is dead.

    and have you even *used* ruby or are you just karma whoring?

  139. I started with a quote from your post. by Some+Random+Username · · Score: 1

    And its not a very ambiguous quote, its pretty clear. You claimed ruby is better for making a rails-like framework because ruby is like ruby and python and perl aren't.

    However, I did reread what you said just to be sure, and in fact the quote is still there, and is still the same. If I read it over and over will it change or something?

    1. Re:I started with a quote from your post. by Paradox · · Score: 1
      I hate quoting myself, but...
      Subway will have to discover what is the natural "Python" way for doing what Rails does (which is a great example of the "Ruby Way"). This may or may not be as beautiful and pleasnt as the Ruby way.


      Grandparent of this post. Look what I said. Python needs to find the Python way to do it. This way may or may not be more elegant than the Ruby way. Yes, elegance exists as a meta-language property, it's not tied to any one language.

      No, disagreeing with that doesn't help Python's case very much.

      Now stop trolling and go about your day.
      --
      Slashdot. It's Not For Common Sense
    2. Re:I started with a quote from your post. by Some+Random+Username · · Score: 1
      I don't mind quoting you:
      You're right, you can do things different ways to emulate what Ruby is doing naturally. But, then you begin to lose the beautiful meta-language-syntax that makes ActiveRecord and ActionPack so attractive.
      See, you misunderstood me, because I didn't say emulating what ruby is doing naturally was a good idea. That's why I said that you aren't understanding me, and explained again that I never said emulating ruby was good. The rest of your post was you agreeing with me, after saying that you disagree with me. I was trying to point out that we aren't disagreeing, you simply misunderstood me. Why are you trying so hard to turn an agreement into a disagreement?
  140. 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.

  141. 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.

  142. non-CRUD? by Anonymous Coward · · Score: 0
    Everything I've seen on RoR talks about its auto-generation of CRUD pages. I'm having a hard time envisioning how you'd build something like Slashdot with that. I've asked about applying RoR to a stored-procedure-based app, and the reply's basically been "um....yeah you could just skip the auto-coding stuff...but then you're missing out on the cool part."

    It's easy to get dramatic productivity when your app fits well with what the framework auto-generates.

  143. Performance is tricky by rmm5t · · Score: 1

    Performance is a tricky thing to measure accurately here. Unfortunately, Sun spends more time optimizing its Virtual Machine for Intel architectures than it does for PowerPC architectures. This is simply because Intel accounts for more of the market. The result of this is that Java apps often run faster on Intel than they do on PowerPC or even Sun's own SPARC processors.

    I'd be interested to see some performance numbers on an Intel based architecture.

    However, I'm most compelled by some code maintenance aspects of Ruby. As a Java and .NET developer, maybe it's time I take a look at Ruby.

  144. Ruby supports unicode. by andreas1245432 · · Score: 1

    It does not support Unicode. No unicode strings, no unicode regexps.

    Wrong. Regexes support Unicode, and the standard library provides Unicode string functions. A lot of Rails apps are using UTF-8 without any problems. Switching my app to UTF-8 took two lines of code.
    1. Re:Ruby supports unicode. by Ian+Bicking · · Score: 1
      But UTF-8 isn't Unicode. It's an 8-bit encoded version of Unicode.

      Everytime I learn something new about Unicode, I recognize a New Hard Aspect of it. It's true, in many ways UTF-8 is a workable way to handle Unicode without real Unicode objects (and I know nothing about Ruby's Unicode support), but there are subtle aspects where a standard encoding is not the same as real support.

    2. Re:Ruby supports unicode. by andreas1245432 · · Score: 1

      Care to explain what these subtle aspects are? I prefer to deal with the problems when they appear; for me unicode + ruby works fine.

  145. Of course it requires less coding... by Anonymous Coward · · Score: 1, Interesting
    it's a frickin' framework + code generator!

    The Ruby folk go to extremes sometimes to get developers' attention: here they're presenting Ruby on Rails as something as wonderful and new,whereas every language has such code generators: Perl has Mason, MayPole and many others that do everything RoR does but without the insane premise that "everything is an object" (which Ruby is based).

    Ruby is one man's honest effort to objectify Perl. A good effort, I might add, but because it's derived from Perl and has such a small user base, Ruby will remain a niche language.

  146. Java vs. Ruby? by Anonymous Coward · · Score: 0

    How about Java Ruby? ;)

    http://jruby.sourceforge.net/

  147. SWT by Earlybird · · Score: 1
    From an operational standpoint -- meaning, roughly, that the output is actually something you want to run, only the following toolkits have responsive, shell-integrating output: [...]

    You forgot SWT.

    1. Re:SWT by Procyon101 · · Score: 1

      no he didn't

  148. Re:Wait..... by mikis · · Score: 1

    Hypotheticaly speaking, is there any reason you couldn't rewrite GD libraries in PHP itself, and then include them?

  149. "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?

    2. Re:"Normal Spring/Hibernate" by rdean400 · · Score: 1

      When someone tries to imply the result is generally applicable (even if it wasn't your intention to generally apply the findings), then yes, it's a problem.

    3. Re:"Normal Spring/Hibernate" by jgehtland · · Score: 1

      That's all well and good, but if by "someone" you mean me, I'd be interested in seeing where I implied that. In fact, I didn't "imply" anything in the original article. I said exactly what I meant to say. I'm reminded of an interview with Robert Frost. The interviewer asked him how he came up with all the hidden symbolism in his poetry, and he said "What symbolism? Its about stopping by the side of the road while its snowing." I think these numbers are interesting, and there aren't a lot of other concrete numbers out there, so here are some. They tell an interesting story, but only one of many (here in the naked city....).

    4. Re:"Normal Spring/Hibernate" by rdean400 · · Score: 1

      I was not talking about you. I'm sorry if I gave you that impression. I was talking about the submitter of the /. article (Paradox). You said you weren't looking to make any indicative statements, but by reporting it as frontpage-worthy, /. implies that this might be an expected result for any Ruby vs. Java project.

    5. Re:"Normal Spring/Hibernate" by jgehtland · · Score: 1

      Ahhh, got it. Sorry, I was getting a little touchy, what with all the "he must suck out loud" posts around here today. :) You'll have to pardon me, its my first /.'ing.

  150. You can stop making excuses now. by Some+Random+Username · · Score: 1

    I didn't say it was 1.0 or that it should be perfect. That particular instance isn't my problem, just an example. The attitude that security is something to pawn off on users instead of taking responsibility for is my problem. I was very clear about this, you refused to believe me, and now you are trying to pretend it doesn't matter. If it doesn't matter for you that's fine, but I do not use software written by people who don't take security seriously, and rails is one such piece of software.

    And the developer knowing the quoting rules for the DB they are using has nothing to do with this, rails could and should prevent errors like this. Also that documentation did not exist at the time this happened, and it still doesn't excuse the attitude. There is no reason at all to make things potentially exploitable by default, and expect users to know enough to avoid the problems themselves. The whole idea of a web framework is so I don't have to worry about the details.

  151. You wouldn't be missing the "cool part" by Paradox · · Score: 1

    Okay, there is CRUD and then there are CRUD-screens.

    Rails automates CRUD class generation. This is a popular and useful pattern. Rails has an outstanding implementation of this. It does have a few performance weaknesses, but they don't seem to inhibt many applications.

    Rails also has a CRUD-screen generator set called "scaffolding". Scaffolding isn't really meant for production use. It's a nice way to force the app to get started. You then add things as you go, overiding the generated pages with real pages. It's unfortunate that many demos use scaffolding, because its really a very tiny part of Rails development.

    The Rails framework does indeed auto-generate some other things. But they're extrmely generic.

    --
    Slashdot. It's Not For Common Sense
    1. Re:You wouldn't be missing the "cool part" by Anonymous Coward · · Score: 0
      Now it's starting to sound a little more interesting, thanks. Those scaffolding demos have led me astray.

      Seems to me that similar class generation could build objects from stored procedure output...

  152. You want programmatic generaton of HTML? by Paradox · · Score: 1

    Rails comes with this. Indeed, it's preferred for many situations. The template method is best when you're not working with web designers who don't know any programming language and want to make mockups.

    It's called XML::Builder, and it's pretty neat. Check it out at this link.

    It's nice for generating "Semantic Web" markup.

    --
    Slashdot. It's Not For Common Sense
  153. Because... by Anonymous Coward · · Score: 1, Informative
    They saw it, Geert. And they were dully impressed, but you didn't really do what you said you'd do.
    1. You used Lazlo. Your templates are 10x bigger than Tada lists. You may not count this, and that's great for you, but it's still code you have to maintain. If you were to add Tada's templates in with the count, the code count wouldn't go up nearly as much as Bla-Bla's would.
    2. You didn't implement Ta-da list. You implemented something kinda like Ta-da list optimized for RIFE. Were Ta-da list to be rewritten as a standalone app leveraging the current Rails (instead of being ripped out of Basecamp and used as a marketing tool for it)? 340 lines. Don't believe me? Check out taskTHIS! (and source)*.
    3. You have to maintain your configuration, but you fail to mention that massive size as well. In rails there is almost none.
      [*]Please don't make too many comments about the quality of that code, it's a demonstration. It is not as perfect as it could be, and that works for and against it. It probably cold be smaller, it probably could be more bug free.
      So yeah, Geert. You won a contest you yourself made, set the rules for, and gamed appropriately. You are now eliagable for a cookie.
  154. Hey troll... by Anonymous Coward · · Score: 0

    Go to the site, click "Try Basecamp Free" and set up a free account. The external stuff is PHP, probably for legacy reasons.

    Basecamp itself is 100% ruby-on-rails, and it's easy to verify once you enter the webapp.

    1. Re:Hey troll... by Anonymous Coward · · Score: 0

      I can't seem to get it to work. Is the site down? If not, do you have a login/password I could use? :(

      -John.

    2. Re:Hey troll... by Anonymous Coward · · Score: 0

      Go to http://guest.updatelog.com/ and login with guest, guest.

      Be warned though, it's quite slow! This is probably why they use PHP on the main site.

    3. Re:Hey troll... by Anonymous Coward · · Score: 0

      Nice spin, but I believe the real reason was that RoR has to be restarted every one or two days because it is leaking memory. Obviously this is bad for the main site so it uses PHP.

  155. WTF does "Rails" mean? by Anonymous Coward · · Score: 0

    OK, I'm a programmer, I've used database, I've used high-level languages (Perl), and I've done some web programming. And I've also read through a lot of the comments on this slashdot article, and I've read through several pieces of the tutorial at rubyonrails.com, and I read virtually the entire About page at rubyonrails.com (which had lots of comments about Rails and how wonderful it is).

    After all that, I still have no idea what "Rails" is supposed to mean. Is it some kind of analogy? Am I supposed to think it's a kickass mechanism that makes Ruby really fly (productivity-wise), so that it's like Ruby is a high speed train on rails? Is it some kind of analogy to Struts? Does the term "Rails" signify that there is a framework that provides abstraction to conceptually support things? Or is it an analogy with transportation? Or maybe an analogy with +5VDC power supply rails?

    Why does rubyonrails.com make it so hard for me, as a developer, to learn what it is that Rails does and what it promises to be? I get that it's an application environment for web programming that makes it easy to use Ruby to do some web programming tasks. But there are lots of environments and software systems that aim to make web programming easier, so that's not very useful information. What I want to know when I look at a site that is trying to promote some new thing is what that thing is. I want to know something more specific than "it helps you do web programming" without having to spend 2 hours going through the tutorial. So far all I can gather beyond "it helps you do web programming" is that it helps you do it in Ruby, and that it seems to involve databases (which not all web programming does, of course).

  156. Ever hear of reading posts you reply to? by Some+Random+Username · · Score: 1

    He very plainly and clearly pointed out that he doesn't have to repeat himself to make getter/setter methods in java, its less work than it is with ruby, because he doesn't do it at all, that's what your editor is for. Comparing the final output code isn't a fair comparison, because the java developer doesn't write all that code, lots of it is generated for him/her automatically.

  157. Are you guys really that incompetent? by gbevin · · Score: 1

    Yes I did exactly what I said I'd do and a lot more. I keep having to explain things over and over again to you Rails activists, but you seem to be unable to understand anything that is only just slightly different from the concepts that you use.

    1. So you're saying that you actually manage to look elsewhere than the src/templates directory? You look in the web directory instead and call .lzx Laszlo files, templates. Even though they have nothing to do with templates? They are a SEPARATE application, and everything can be done without it. Oh, and btw, Ta-da Lists's template line count was not taken into account into the 600 lines, so stop whining. Rails' templates contain logic and loops, RIFE's not. I actually included those loops in the line-count instead of leaving them out.
    2. You guys continue to amaze me, so you write an even more simple to-do list with Rails that does some Ajax eye-candy and only does account management and list editing. Let's take a look, will ya:
      • no public sharing,
      • no private sharing,
      • no RSS,
      • no item reordering,
      • no list reordering,
      • no different presentation of done lists,
      • no 'nice shrinking/growing' icon,
      • no list emailing,
      • ....

      and you still manage to let it be a hefty 340 lines in you awesome concise framework? You just confirmed that you never take the time to check ANY of your statements and just troll on senselessly in the direction of whoever is leading you. SAD! Btw, I'd wouldn't call Bla-bla a RIFE-optimised application at all. Quite the contrary in fact, almost nothing is used of the important features of RIFE. The application is so simple that you never get to leverage any of the benefits since there's never any data flowing around. They are all single actions. I'd rather call Ta-da optimized for Rails since you have your List Act which does all the list handling automatically in the framework. We don't consider CRUD operations a core feature, but will soon release RIFE/crud as a separate packages that address this without any code generation. Bla-bla List doesn't use any of that btw.

    3. Which configuration? This is what you call configuration? I hate to bring it to you, but it's not configuration. It's separation and declaration of the application's logic and data flow which brings an enormous collection of features that you wouldn't even understand since you marvel at your pityful one-dimensional controllers. Once more, you seem to be totally deluded since I DID COUNT the lines of that file in the final line count since I checked with my friend Brian McCallister, who knows Rails quite well, to see if I should include it. I'm still not that sure I should have since the features it gives you are completely impossible to do with Rails. If you're interested in that, start using a real name, be a man and we'll have some extensive chat about that elsewhere.

    Oh, don't worry, I don't comment on your code with micro comparisons as Rails activists seem to love to do. I do comment on the fact that you only implemented 15% of the application and did none of the complicated stuff. /golfclap you just made a total jerk out of yourself, Matt McRay.

    Last time I checked, I didn't win the contest (since I came out 300 lines more), but even more, I never did one. All I did was show Java developers that things can be concise and don't have to be totally convoluted. Which rules did I set? I faithfully cloned Ta-da List even though the 'Edit list' part is very stupid and I'll probably re-do it in-line in the GUI. I used Laszlo to build a separated application which has nothing to do with the server-side and merely interfaces with the REST API and interpretes the results that are sent back. It's sad that you don't seem to understa

    --
    Geert Bevin
    1. Re:Are you guys really that incompetent? by gbevin · · Score: 1

      ... and Paradox, please stop saying things without verifying the facts:

      r83 | david | 2004-12-08 16:53:57 +0100 (Wed, 08 Dec 2004) | 1 line
      Changed paths:
      A /trunk/activerecord/lib/active_record/mixins/list. rb (from /trunk/activerecord/lib/active_record/mixins/list_ mixin.rb:82)
      D /trunk/activerecord/lib/active_record/mixins/list_ mixin.rb
      M /trunk/activerecord/lib/active_record.rb

      Rename d from ListMixin and mixins/list_mixin.rb to Mixins::List and mixin/list.rb

      I traced the list act (mixin) back to december 8, thus one and a half month before the Ta-da release.

      --
      Geert Bevin
  158. ...and start using it immediately. by leonbrooks · · Score: 1

    Ruby is dead simple. Ruby on Rails is dead simple. It'll make you wonder why you bother with all of those other languages. /ME is looking forward to Ruby on Greased Rails, the optimised version. (-:

    --
    Got time? Spend some of it coding or testing
  159. RoR is not Access-like by leonbrooks · · Score: 1

    You can "bust out of it" essentially whereever you like and do whatever you like.

    Twenty-five years ago when as a BASIC programmer (think C-BASIC, MBASIC, GWBASIC, sBASIC), I first saw C. It was a revolution. Variable scoping, easy recursion, inline ifs, direct access to all kinds of stuff. Now as a programmer of lots of languages (C, C++, Java, Python, PHP, PERL, BASH, GAWK, assorted BASICs and scripts, assorted assemblers, Forth, yadda yadda), Ruby evokes that same feeling of "Ah! So this is what was missing all along!"

    --
    Got time? Spend some of it coding or testing
  160. The right tool for the right job by bensch · · Score: 1

    So it's pretty clear that Ruby is a pretty good language to write web apps in. But I have a another think: Which languages works best for each problem domain? So far, I've gotten C/C++/Javascript/Java/C# sorted but the rest I'm kinda fuzzy about. I'm trying to sort these out regardless of architectural constraints. (Like IIS requiring VBscript or JScript) Feel free to flame if you think this list is totally off.

    C: Good for device drivers and very small embedded work.

    C++: Good for most embedded work, fast plugin work (ala Maya and Photoshop). Lots of UI architectures
    (now with KDE xplatform, could be a good UI option but definitately not RAD)

    Java: Fast servlets. Fast cross platform UI??

    Javascript: clientsize webpages (duh!)

    C#: Same as Java (fixes some of Java's problems though...), Will be default for windows UI development soon

    Python: More robust servlets

    Ruby: More robust servlets, weakly typed language makes for great RAD, it's where Javascript wants to go. Maybe UI option?

    Effile: ?? no idea what functional languages are good for...

    Haskill: ?? no idea

    Lisp: I personally hate trying to think in it's reverse polish notation schemes. So no idea...

    What do you think?

    --
    Ben Schleimer Life is like a sewer, what you get out of it depends on what you put into it.
  161. Geez Geert by Paradox · · Score: 1
    You just can't stop complaining about this, can you? Didn't you get enough arguments with Rails users last time? Let me try and set the record straight, without being an overzealous fan.
    Oh, and btw, Ta-da Lists's template line count was not taken into account into the 600 lines, so stop whining.
    I'm not sure anyone has told you that a lot of stuff that was included in Ta-da's linecount was done so only because of an ideal of fairness. Caching, for instance, is used for the first time in Ta-da List (and is prepared for extraction). So it goes into the linecount.
    I'd rather call Ta-da optimized for Rails since you have your List Act which does all the list handling automatically in the framework.
    Same with the table-as-list stuff. Ta-da extraction. Extra DB handling. Not too bad, but still. I know I wouldn't have line-counted it, since it was being put in the framework that very version.

    Personally, I wouldn't have included these things. They were extracted into the framework.

    You guys continue to amaze me, so you write an even more simple to-do list with Rails that does some Ajax eye-candy and only does account management and list editing.
    Ooof. Why on earth the AC mentioned that app, I have no idea. taskTHIS! is an Ajax tech demo. It's not meant to be something competiting with Ta-da or Bla-bla. Please discard this comparison.
    I'm still not that sure I should have since the features it gives you are completely impossible to do with Rails.
    Not to belabor any points, but no one argues that Rails does more than RIFE. Most certainly, RIFE can probably out-feature Rails on many different levels. Even when Rails hits 1.0, this will still probably be the case.

    What many Rails fans (and I think the AC above, in typicall trollish AC fashion) are trying to point out is that the end-all-be-all of a framework is not the result of terminal featuritis. Rails is great for small-to-medium kinds of project. Most of us are aware of this. When Rails is applicable, it's incredibly applicable.

    When it's not, we still have RIFE. Rest assured that if Rails ever hits its limits for me, RIFE will be the first place I look (despite your obnoxious behavior, recently). Now, many of the Rails community (including myself) dislike Java strongly. But that doesn't mean we don't know it and aren't prepared to use it if we must.

    So I for one thank you, Geert. You showed me an alternative. No stop being such a dick about it. If you're trying to say that DHH behaved innapropriately when he compared Bla-Bla to Ta-da, your point is not well-served by throwing a tantrum every time Rails gets some positive press. Take the moral high ground.

    --
    Slashdot. It's Not For Common Sense
    1. Re:Geez Geert by gbevin · · Score: 1

      Didn't you get enough arguments with Rails users last time?

      Paradox, I don't remember getting much arguments, I do remember getting much flames and trolls.

      I'm not sure anyone has told you that a lot of stuff that was included in Ta-da's linecount was done so only because of an ideal of fairness. Caching, for instance, is used for the first time in Ta-da List (and is prepared for extraction). So it goes into the linecount. Personally, I wouldn't have included these things. They were extracted into the framework.

      Fyi, I asked details about what went in the linecount exactly in the comments here: http://weblog.rubyonrails.com/archives/2005/01/19/ make-your-ta-da-list-today/

      Oh, and in DHH's 'says-it-all' comparison screenshot, the list act is not in Ta-Da but in the framework, so don't come telling me it was extracted afterwards.

      Your point is not well-served by throwing a tantrum every time Rails gets some positive press. Take the moral high ground.

      I only react to posts that attack me directly, like the one that started the thread, don't pull things out of context again.

      --
      Geert Bevin
    2. Re:Geez Geert by Paradox · · Score: 1
      Paradox, I don't remember getting much arguments, I do remember getting much flames and trolls.
      This may be part of your problem.
      I only react to posts that attack me directly, like the one that started the thread, don't pull things out of context again.
      Do you actually think this matters at all? If I got angry every time someone on Slashdot insulted me, Anonymous Coward or no, I'd have a stroke within 24 hours.

      Grow a thicker skin and let your work rest on its technical merit. To do anything else is a disservice to your hard work.

      --
      Slashdot. It's Not For Common Sense
  162. Database development by Anonymous Coward · · Score: 0

    I'm a developer not a DBA (Although I've installed Oracle and worked extensively with DB2).

    As a developer with many projects that use databases, I'm generally of the opinion is use the database to do what databases do via ODBC. Access data, join tables etc and don't worry about it, let the database worry about the speed. Triggers and other neat DB stuff (usually only available through the DB companies own API) tends to make it hard to move to different databases (Lock in).
    Also database are pretty reliable, but I've seen some bad failures with database code.

    We hate that. We programmers want control.

    Also note the article points out that RNR generates the tables for you. So optimization is a huge leap for those that don't want to create the tables themselves. Creating tables isn't hard but there is a method to table relationships.

  163. Re:Wait..... by prockcore · · Score: 1

    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?

    I do this:

    yum install php-gd

    wow, that was easy! Even if I wasn't using rpm packages, I could compile GD and dynamically load it.

  164. +5 Funny!!! WTF?!! by andyfaeglasgow · · Score: 1

    Have you mods not seen this joke before? WTF has the new Ruby compiler got to do with Gentoo?

    Seriously. This is flamebait/offtopic/unfunny all rolled into one. Possibly the worst post EVER on Slashdot. /me goes back to work in a bad mood

  165. embedding python in HTML by Anonymous Coward · · Score: 0

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

    no problem at all