Slashdot Mirror


Ruby Off the Rails

An anonymous reader writes "IBM DeveloperWorks has an interesting writeup on Ruby that takes a look at the programming language as a stand-alone solution rather than defining it in terms of Rails. From the article: 'Ruby on Rails is just one facet of what makes Ruby great, just like EJB is only part of the Java enterprise platform. Andrew Glover digs beneath the hype for a look at what Java developers can do with Ruby, all by itself. Ruby's syntax is quite different from that of the Java language, but it's amazingly easy to pick up. Moreover, some things are just plain easier to do in Ruby than they are in the Java language.'"

57 of 325 comments (clear)

  1. Re:Get the basic premise right, first by Anonymous Coward · · Score: 4, Funny

    I love it how the Rails fanatics always take great personal insult at even the mere suggestion that code generation isn't its strong point. Even though, surprise surprise, the infamous tutorial video advertises just this very feature throughout pretty much the entire clip. It's like watching a little kid cry and stamp their feet at a grocery store trying to get their parents to buy them cereal.

  2. Re:It's obvious by starwed · · Score: 2, Informative

    Why was this modded up? The article doesn't even mention code generation. It compares Ruby and Java as generic development languages.

  3. Re:What I need to know by arevos · · Score: 5, Interesting
    Before I even consider Ruby: is it faster and less memory hungry than Java.
    If the answer is no, then I'm not going to waste any effort on it.

    If speed and memory usage is your only criteria when choosing a language, why not use C or assembly?

  4. Re:It's obvious by Anonymous Coward · · Score: 5, Informative

    ikkibr is a robot that looks for similar past articles and reposts highly-modded comments from those articles. See http://ask.slashdot.org/comments.pl?sid=171820&cid =14310500

  5. Re:What I need to know by the+eric+conspiracy · · Score: 4, Informative

    Ruby is useless to me because it has no unicode support.

    In this shootout it was found that Ruby had lower memory consumption, but also ran much more slowly than Java:

    http://shootout.alioth.debian.org/benchmark.php?te st=all&lang=java&lang2=ruby&sort=fullcpu

  6. Re:Flamewar.....NOW! by arevos · · Score: 2, Interesting

    I too like Python, but let's put this into perspective. This is an article about Ruby and Java, not about Python. Just because someone starts talking about Ruby doesn't mean they're mandated to mention the alternatives.

  7. Loving complexity for complexity's sake by Man_Holmes · · Score: 4, Interesting

    You just have to love java programmers making the easy more difficult. What I have learned in managing developers is that you have to constantly fight their desire to make things more complicated without a valid reason for doing so.

    He's correct that certain tasks are easier in Ruby than in java, not to mention that the code is more readable. But he is missing in my opinion the most important part of Rails and that the ORM. Use scaffolding or don't use it. But if you bypass Active Record you're just making more work for yourself.

    Man Holmes

    1. Re:Loving complexity for complexity's sake by Decaff · · Score: 2, Informative

      You just have to love java programmers making the easy more difficult. What I have learned in managing developers is that you have to constantly fight their desire to make things more complicated without a valid reason for doing so.

      What a great generalisation! Not everything that looks easy is really easy. Not all code can be 'quick fixes'. Ruby on Rails may have its place, but Java and it's frameworks really shine when you need very high performance and a range of scalability options.

    2. Re:Loving complexity for complexity's sake by Decaff · · Score: 2, Insightful

      Just recently I saw the project that was basically just a few web pages and it was realized as a tasty soup of custom MVC framework, JSPs, JSP tag libs, Velocity (by itself and (horror) inside taglibs), Spring and XML/XSLT thrown in for a good measure.

      Just because some developers make bad choices does not mean that this is any fault of the language, or is a general fault of all developers in this language. Such messes can occur in any language - I have seen some real VB horrors.

    3. Re:Loving complexity for complexity's sake by NumbThumb · · Score: 2, Interesting

      Modern JVMs get very close to the performance of traditional, pre-compiled code. What makes java feel slow in in the client world are two, no, make that three, factors:

      1) the JVM needs to start. That needs time. On a server, it basically starts once, and then it just runs. Also, JIT only really kicks in for long running applications.
      2) Java needs a lot of RAM. If you try to run a java app on a smallish box, chances are it will start swapping.
      3) Swing is Slow, it makes Java GUIs feel cluncky. SWT is much better for the user, it "feels" more responsive.

      --
      I have discovered a truly remarkable sig which this 120 chars is too small to contain.
    4. Re:Loving complexity for complexity's sake by Decaff · · Score: 3, Informative

      2) Java needs a lot of RAM. If you try to run a java app on a smallish box, chances are it will start swapping.
      3) Swing is Slow, it makes Java GUIs feel cluncky. SWT is much better for the user, it "feels" more responsive.


      Both these are now way out of date. Java memory handling has been tidied up. As even a 'smallish box' these days is more than 128MB, memory really is not going to be a problem at all.

      Swing is hugely faster these days, to the extend where it is often reported to be more responsive than SWT on some platforms (such as Linux). Swing is now by default OpenGL or DirectX accelerated.

    5. Re:Loving complexity for complexity's sake by Joey+Vegetables · · Score: 3, Insightful

      Only crappy developers. The better ones understand that software development (not just coding, but analysis, architecture, and design) is actually a process of documenting, managing, and reducing complexity, to the greatest extent possible.

    6. Re:Loving complexity for complexity's sake by dasil003 · · Score: 2, Informative

      He's correct that certain tasks are easier in Ruby than in java, not to mention that the code is more readable. But he is missing in my opinion the most important part of Rails and that the ORM. Use scaffolding or don't use it. But if you bypass Active Record you're just making more work for yourself.

      The article isn't about Rails... in fact it's not even about database-driven websites... or even web programming in general. It's just a comparison of the Ruby and Java languages in general. ORM is neither here nor there.

    7. Re:Loving complexity for complexity's sake by stonecypher · · Score: 2, Interesting

      As even a 'smallish box' these days is more than 128MB, memory really is not going to be a problem at all.

      Amusingly, Java's three strongest positions are the portable market (J2ME,) followed by the server market (EJB,) followed by the embedded market (microcontrollers, especially with the upcoming blu-ray deployment.) Neither J2ME nor embedded average more than 23 meg per device, and for servers where parallelism is a serious issue, the smallest possible memory footprint is desirable.

      For thirty years people have attempted to hand-wave away bloat with "modern" computing power. With age you will discover that it's not the ceiling so much as the margin that's important. Yes, you can use a language which requires 300% overhead, and for lots of things that's okay. But, in industry, where RAND suggests almost m80% of software is actually developed, the cruel reality is that your 300% overhead means that your competition can do four times as much on the same machine. Whereas that may not be important for a word processor, that's hella important to simulators, aggregators, data mining, and the sort of large-scale tasks that dominate real-world developer time.

      There are dozens of higher level languages than Java and dozens of faster languages than Java, all of which predate Java. Java's strength comes not in its speed, but in its low cost of binary portable redevelopment (hence its near-complete redomination of the cell phone world as previously taken wholesale by Symbian and BREW.) Java's "high performance" is a myth; you guys seem to think that C++ is the only speed candidate, when code written in Forth, K, Structure and portable assembly (for some tasks) tend to blow the doors off of both.

      There's a reason Java never took C++ out of the industrial performance market. It has nothing to do with actual performance; that's why C++ took over from FORTRAN even though FORTRAN is essentially faster, and why other languages never took over from C++ despite having relatively complete support libraries. Java is a spectacular example of what a language needs to do to not fail to defeat C++, because Java did everything but one thing.

      The fundamental problem is reliability. Unfortunately, it's really difficult to hammer this into a Java programmer's head, because the first thing you want to say is "Java doesn't have exceptions," at which point the Java programmer absolutely shits themselves, because a third of their language revolves around handling these things called exceptions. The problem is, Java exceptions are an error propogation and handling mechanism, and they're so visually similar to C++ exceptions that it's just dental work and a half to get a Java programmer to believe they're not the same thing (especially since the number of people who came into the occupation was so huge during the dot com boom, when Java was big money central, and so since they've migrated into C++ they're using C++ exceptions the way Java programmers use the word, and since there are as a result so many glaringly badbear uses on the intarweb, where it seems all Java programmers learn their trade.)

      Exceptions in C++ are a very different thing than they are in Java. Properly used, exceptions in C++ are used to handle situations like "hey, where did my disk drive disappear to," or CPU panic conditions. Exceptions in C++ are a last ditch holy shit maneuver to save the information when the moon crashes into the data center. Exceptions in C++ are for ghastly aberrant situations, such as failing hardware, not to handle sloppy programmer problems.

      Of course, I shall receive ten counters from people dredging up code on sites full of badbearery such as geoshitties, codeproject and msdn (to all the peanut-gallery screamers, there's void main() all over MSDN, and if you don't know why that should make you shut up, you're not qualified to comment on quality c++ source and you need to stop reading Herb Schildt books) pointing out egregiously bad uses of exceptions in defense of

      --
      StoneCypher is Full of BS
  8. Go Java! by HillaryWBush · · Score: 4, Interesting
    Moreover, some things are just plain easier to do in Ruby than they are in the Java language."

    Congratulations Java, you've finally proven yourself as the new Benchmark(TM). Enjoy a lifetime of groundless belittlement.

    By the way, if moreover isn't on this list, it sure ought to be. Over.

  9. Re:What I need to know by Geoffreyerffoeg · · Score: 3, Interesting

    Before I even consider Ruby: is it faster and less memory hungry than Java.

    Yes on both counts. It's faster for you to write programs, and requires less of a learning curve.

  10. Re:So, what's it like? by arevos · · Score: 3, Informative
    As a side note, why is it the people so quickly forget what these languages are really for. They are Rapid Application Development(RAD) and prototyping languages. You're not supposed to ship products developed with these languages! You're supposed to prototype the application and if it looks viable, develop it in a real language like C or C++!

    Why? The speed of C and C++ are hardly needed for most applications, and languages like Ruby and Python can leverage GUI toolkits like Qt and GTK. If your Qt Ruby application is indistinguishable from your Qt C++ application, why waste time developing in C++ if you don't have to?

  11. The author of the article, Andy Glover... by tcopeland · · Score: 4, Informative

    ...is a good guy to write this sort of thing since he's been programming Java for a long time and has also branched out into "dynamic Java" things like Groovy. He's done a bunch of stuff on dbUnit (including a dbUnit chapter in Java Testing Patterns), too. So he's had enough experience with Java to know what's what.

    I'm probably biased, though, since Andy also wrote the CPD Ant task.

  12. Re:So, what's it like? by Decaff · · Score: 4, Insightful

    Why? The speed of C and C++ are hardly needed for most applications

    This is the same excuse I have heard for decades when fans of a language try and 'justify' it's lack of performance. Sooner or later a lack of performance really does become a problem - if it wasn't then many Ruby developers would not be working on high-performance VMs for the language.

    There are situations where performance doesn't matter, but this is not true for 'most' applications.

    I really like Ruby, but I will find much wider use for it when it is truly fast.

  13. Re:What I need to know by Decaff · · Score: 2, Insightful

    why spend more time developing a program in Java, when you could develop it faster in Ruby?

    Because not getting the best performance out of hardware, no matter how old or new it is, puts your application at a disadvantage compared to your competitors. No matter how much you may try and justify things, your users don't care about the language you use to develop - they care about performance.

    There are alternatives - you can use both Ruby and Java together (JRuby works on the JVM). I think this 'mix and match' approach will be more widely used in the future.

  14. Erm, hello by m50d · · Score: 4, Insightful
    Moreover, some things are just plain easier to do in Ruby than they are in the Java language.

    That goes for any sane modern language.

    --
    I am trolling
    1. Re:Erm, hello by cnerd2025 · · Score: 2, Insightful

      Java is easy to use, but the creators had a bit of diarrhea of the fingers: it takes like 10 lines to write something that would take about 3 in C/C++. Also, some of the "built-ins" are just freakin' arbitrary. Java, though, isn't as arbitrary as C++. So Java is like the little brother of C++ who still doesn't implement OOP quite well enough, while talking far too much. It had support of its mother to make it known (Sun Microsystems), and it utilizes centralized documentation/codification (a blessing and hinderance). Ruby is truly object-oriented and is in the spirit of Smalltalk, with features not simply academic in nature. After learning Java, I really had a bitter taste for OOP. When I learned Ruby, it was like walking from Kansas to Oz.

  15. Re:What I need to know by badfish99 · · Score: 3, Funny
    Aristotle would have wanted Greek, and Jesus would have wanted Aramaic. So no, ISO-8859-1 was not good enough for them. Nor is it much use for the majority of people in the world today.

    As for Shakespeare, he couldn't even spell his own name, so he didn't care.

  16. What is .Net's competition? by bigtallmofo · · Score: 4, Interesting

    I've often heard comparisons of .Net to Java and for a while there it seemed to me like they were two separate but somewhat equal development environments. Now it seems that several languages/environments have been coming up (PHP/Ruby) and many articles I see compare it to Java or explain how it's competing with Java.

    What does the future hold in terms of what environment will "come out on top" when Java seems to be compared to or even competing against so many languages while .Net doesn't seem to have such competition?

    --
    I'm a big tall mofo.
    1. Re:What is .Net's competition? by OldAndSlow · · Score: 2, Interesting
      .Net doesn't have competition in this arena because it is propriatry. MS has so throughly closed their environment that every would-be Matz will develop on Linux, where there are no taxes to pay to the corporate overlords and no "defend the monopoly" landmines.

      It seems to me that MS is in a position where they will forever be chasing the leaders in language development.

  17. Ruby & Java == Moriarity & Holmes by Maxmin · · Score: 2, Informative

    The ruby crowd positions themselves as none other than mortal enemies of Java and anyone stupid enough to still be using that pathetic excuse for a language!

    Ruby could be just an also-ran if it didn't have Java to kick around. After ten years of spotlight, it's not hard to find detractors. The real question is, can ruby be defined on its own terms, and not Java's? Doesn't seem like it so far, which isn't good news for longevity.

    Also, what you're forgetting is that some programmers like the clarity of a well-defined class hierarchy, and Java's got that. Ruby has got some pretty muddy classes that try to do too much.

    --
    O lord, bless this thy holy hand grenade, that with it thou mayest blow thine enemies to tiny bits, in thy mercy.
    1. Re:Ruby & Java == Moriarity & Holmes by BACbKA · · Score: 4, Insightful

      Wasn't Java itself once defined mostly in terms of C++, and isn't C# now defined in terms of Java?

      --

      VKh

    2. Re:Ruby & Java == Moriarity & Holmes by SmallOak · · Score: 3, Informative

      "The real question is, can ruby be defined on its own terms, and not Java's?"

      I'm not sure this is even a issue. the Disussion on Ruby Vs Java seems to happen totaly outside the Ruby 'community'. I read a lot of Ruby programmer blogs and don't see Java mentioned that much.

      Interesting reading

      http://www.artima.com/intv/ruby.html
      The Philosophy of Ruby: A Conversation with Yukihiro Matsumoto

    3. Re:Ruby & Java == Moriarity & Holmes by JanneM · · Score: 2, Insightful

      The ruby crowd positions themselves as none other than mortal enemies of Java and anyone stupid enough to still be using that pathetic excuse for a language!

      When looking at who is "positioning" Ruby that way, it seems to be mostly Java users, actually - at times to belittle Ruby (there seems to be a few developers that feel threatened by the Rails framework) but mostly, it seems, as a basis from which to highlight shortcomings in Java. Ruby developers don't seem all that interested in these comparisons.

      --
      Trust the Computer. The Computer is your friend.
  18. Re:So, what's it like? by arevos · · Score: 2, Interesting
    There are situations where performance doesn't matter, but this is not true for 'most' applications.

    I find this rather hard to believe. The resources needed to run Halflife 2, and the resources required to run a Instant Messenger application, are on a quite different scale from one another. Clearly, therefore, you can afford more inefficiencies in an IM application, than you could in the latest 3D game. Are you claiming that this isn't the case? That we need the latest graphics cards and processors to run text-editors, personal organisors or IM programs?

    Performance matters up to a point, but it's important to realise that there is a point where it ceases to matter. Where this point is depends on your application. A user isn't going to care whether a function takes 1 millisecond or 40 time as long. So long as it is below the barrier at which the inefficiencies become noticable, these inefficiencies don't matter.

    Programming languages like Ruby, are less efficient from the computer's point of view, but more efficient from a programmer's perspective. If you can develop your product and push it out into production 3 times faster than your competitors, with little noticable performance loss, then you're going to make more money. If you can add more features and adapt to the market 3 times faster, then you're going to make more money. Sometimes the advantages of using a language like Ruby or Python outweigh the disadvantages.

  19. Re:What I need to know by Decaff · · Score: 2, Interesting

    But if your product comes out 6 months before your competitors, and is developed at three times the rate, who's going to have the advantage then?

    I really don't believe it will. Ruby is a wonderful language I agree, but actual language coding is not a major part of any project. Design, testing and debugging are. In these areas, in my opinion, there is little difference between the language (in fact, Java has a wider range of high-quality IDEs and debugging tools).

  20. Smalltalk's inheritance by soundofthemoon · · Score: 4, Insightful

    Most of the things I love about Ruby are qualities that it inherits from the Smalltalk programming language. Typing objects instead of variables, everything is an object, object-based encapsulation, blocks as objects, polymorphic collections with enumerators, and the overall style of programming. Ruby is the first language since Smalltalk that I could really grow to love. It adds a lot that Smalltalk doesn't have, like regular expression syntax and better case statements, modues and mixins, and easier access to metaprogramming.

    In some ways Ruby is a bit too dynamic - one of the strengths of Smalltalk is its simplicity and the predictability of your code. With Ruby it's easy to adopt a programming style that makes it difficult to predict what will happen when you do something in your code. Experienced programmers should be able to avoid those pitfalls, but I worry that some of the features will ecourage neophytes to create code that is difficult to maintain or understand.

    1. Re:Smalltalk's inheritance by AaronLawrence · · Score: 2, Funny

      but I worry that some of the features will ecourage neophytes to create code that is difficult to maintain or understand.

      Sounds like C++...

      --
      For every expert, there is an equal and opposite expert. - Arthur C. Clarke
  21. Use my new language called Booby by Anonymous Coward · · Score: 3, Funny

    It does everything every other language
    does but some things are easier and some things are harder.
    Because its relatively new you get to rewrite a bazillion
    lines of library code and API's that already exists in other languages.
    Furthermore you will become even more multilingual than you used
    to be so you can raise language critique to an even higher (f)art
    form. One profound difference, for example, is that Booby uses braces
    but they are reversed from C++ and Java i.e. the open brace is } instead of {.
    I expect to see a whole book on the ramifications
    of that alone.

  22. Re:What I need to know by arevos · · Score: 2, Interesting
    I really don't believe it will. Ruby is a wonderful language I agree, but actual language coding is not a major part of any project. Design, testing and debugging are. In these areas, in my opinion, there is little difference between the language (in fact, Java has a wider range of high-quality IDEs and debugging tools).

    I must disagree here. I can think of several commercial Java web-based projects that I know could have been done in at least the third the time in Ruby on Rails. And the programmer and author Paul Graham holds his startup's use of Lisp as the major factor in their resulting success. In my experience, the choice of language is far more significant than you make it out to be.

  23. Re:So, what's it like? by Dare+nMc · · Score: 4, Insightful

    > Sooner or later a lack of performance really does become a problem
    my limited history of languages says, a lack of performance is taken care of by compiler/VM writers when a market for such comes about.

    C was unacceptable, and is now the standard for speed. C++ was way too slow now their are 100's of optimizers to turn off all the features that cause it to be slower than C.
    Java started out with horrible performance, but this story talks many times about how fast it is, it has compilers now, and a hundred different optimized VM venders to speed it up.
    I see no reason why Ruby would be slower as a language, except the lack of optimizers, perhaps due to the lack of time in the spotlight, and thus the lack of a market requesting it.

  24. Isn't anything off the rails... by Jeff+DeMaagd · · Score: 2, Insightful

    ...the basic definition of being derailed?

  25. Rails hobbles Ruby by MarkusQ · · Score: 2, Insightful

    I like Rails, but I love Ruby. The hardest part of learning Rails was (for me, an experienced Ruby coder) learning all of the things that you lose when you go to Rails. (One example out of many: in Ruby when you create a Hash you can provide a default function (rather than just a default value) to be used when an element is missing; with Rails, this generally doesn't work since the functions don't serialize).

    Conversely, if you like Rails you really should explore standalone-Ruby to see what you are missing.

    --MarkusQ

  26. Re:What I need to know by marcosdumay · · Score: 2, Informative

    The chosen language is one of the things that the Consumer (maybe they not think the same, but, whatever) is most aware of. Let's see... The Consumer wants programs that are:
    1 - Efficient (memory, processor, net, and disk usage,...)
    2 - Bug-free
    3 - Cheap

    A low level language leads to 1, but not to 2 and 3. A good hight level language leads to 2 and 3, but not to 1. How well received your programs is depends only on how well it fits the Consumer's expectations (and how fat is your marketing bill), so the language matters.

    Also, Ruby + Java doesn't lead to a nice combo. The ideal combinations are with languages of different abstraction levels, like Ruby + C, or Ruby + some excelent hight level framework for web pages, aka Rails. So bad Java doesn't combine well with low level languages.

  27. Re:So, what's it like? by arevos · · Score: 2, Interesting
    Actually, I am.... These applications contain things like image handling, grammar checking, spell checking, file parsing and transfer, and many sophisticated GUI features.

    If your text editor truly takes up as much processing power and memory as the latest 3D chart-topper, then perhaps you should look for a piece of software with a little less weight?

    Having developed with a range of programming languages for 30 years, I just don't believe that this sort of speed different exists between languages. Unless you are using something really awful or verbose, then any competent developer truly familiar with any modern language and it's libraries will be productive. Ruby may well be at least 3x as consise as Java, but raw coding time does not make up that much of the development time of any significant project.

    Ruby's conciseness is a by-product of its power. Working around Java's limitations often isn't a trivial task, and Ruby's powerful syntax makes it possible to design some very flexible frameworks. For instance, one commerical java project I was involved in required a web-based file storage system. When I look back on it, Ruby on Rails would have made the job infinitely easier; once the user and file database tables were set up, Rails would have automagically generated class and html interfaces for them. A login helper would have created the login, and then it would have only required a few lines of code to connect in Rail's file upload handling. The entire project could have done in days what had been done in weeks using Java tools.

    From my own experience, Ruby has been considerably faster than Java.

  28. Ruby has some Unicode support, what's missing? by Anonymous Coward · · Score: 2, Informative
  29. Re:What I need to know by Scarblac · · Score: 4, Insightful

    Because not getting the best performance out of hardware, no matter how old or new it is, puts your application at a disadvantage compared to your competitors. No matter how much you may try and justify things, your users don't care about the language you use to develop - they care about performance.

    Simply not true. 95% of software is developed in-house, by small development teams that don't exactly have time to spare. Managers care about productivity, about getting more features implemented in the same time. An extra server costs what, the same as hiring a programmer for a single month?

    --
    I believe posters are recognized by their sig. So I made one.
  30. Re:So, what's it like? by arevos · · Score: 4, Informative
    With the right tools and a good IDE, Java web development can be fast. Not as fast as getting the initial pages up with Rails scaffolding, sure (although projects like Trails come close), but still fast.

    I'm doubtful. I bump up against the limitations of Java every other day, and it seems like the only way you could get around such things is with an awful lot of code generation.

    For instance, I was recently writing a Java class to convert an XML DOM into a custom object tree. This largely involved writing getters and setters, and for loops to iterate over NodeLists to pull out descendant elements. I couldn't help thinking that with Ruby, I could have written "has_attributes" and "has_descendants" methods, and generated the getters and setters and DOM handling automatically. Instead of my classes being 50 lines apiece, they could have just been 4. It would have taken me far less time in Ruby than I did in Java, because Java hasn't got metaclass-like abilities like Ruby or Python.

  31. How Ruby fits in for my work. by mpn14tech · · Score: 3, Informative

    I work as a java developer, but I still still have plenty of other languages in my toolbox. I have just started with experimenting with Ruby. The biggest thing I see is that Ruby fills gap for me between perl and Beanshell.
    The programming hierarchy I tend to think of for my work,
    1. Shell- Basic scripting. Glueing commands together.
    2. Perl- More powerful sripting features, but not really OO.
    3. Ruby- Still a scripting language, but designed around OO.
    4. BeanShell- Good for quick glueing of java classes together
    5. Java- When I need a full compiled application environment.

    For me each language has its purpose and I use them where it best gets
    the job done.

  32. Re:Flamewar.....NOW! by Tablizer · · Score: 2, Insightful

    Python better add the features that Ruby hypers won't shut up about or risk getting left in the popularity dust. It is not that Ruby is better, but if people keep talking about certain features then people will *expect* them because they hear about them, not necessarily because they really are a Silver Bullet. Hype works, I am sorry to say.

  33. Re:What I need to know by arevos · · Score: 2, Insightful
    You can say that your experience is different, but it doesn't invalidate my evidence. My evidence is based on the study of a large number of projects from many people.

    But if I find that a project done in Rails is N times faster than a Java project of a similar nature I've done in the past, I'm hardly going to discount it based on the unseen evidence of someone on Slashdot. If, in my experience, Ruby proves to be a far faster development language than Java, I'm not going to hum and say, well, what about those project managers who decided language wasn't a deciding factor.

    Add to this the fact that there are many experienced developers who take the opposite of your position; Paul Graham, as I've already mentioned, and quite a few of the chaps at Google. I'd dig up more examples, but it's Christmas Eve and decidedly late.

    In my opinion, people should try out both languages and decide for themselves based on the results, rather than rely upon the experience of others. Wouldn't you agree?

  34. Ways of Using Ruby by TheUncleD · · Score: 4, Informative
    Also, there's many different ways of using Ruby besides Rails. Rails is ONE freamework. Iowa is another here you can find out . Another is just plain eruby mod_ruby. Another is cgikit, a friend of mine uses it exclusively although it has little english documentation at this time.

    Rails as has been said, is a framework. Ruby is the language, and all rails is just ruby with a design in place to make it easier. Some great tools for using rails are becoming available though, due to its increasing user-base. A lot of people are still "trying it, and going back to php" but its got a core user group now and that's what counts.

  35. Re:Purpose of being verbose by Moses+Lawn · · Score: 2, Interesting

    No, verbosity like this serves no purpose whatsoever. It's just like writing: if you want those that come after you to understand it, write clean, spare code with useful symbol names and use comments on the non-obvious parts, for chrissake - that's what they're for. In fact, verbosity does just the opposite - it encourages vast amounts of cut-and-paste monkeywork, and all the attendant bugs and inefficiencies that come with it.

    I've seen enough cryptic, overterse code that was incomprehensible, but I've seen just as many 2000 line monster modules that took a week of tracing through to understand what was going on. What's worse, the more verbose the code, the harder it is to modify and extend it, or - god forbid - try to use it for something else.

    It's not elitist to want to write as little code as possible - it should be your goal. I have a lot of work to do and not a lot of time, and I do not want to write 20 lines where 3 will do. If you have to resort to tools to autogenerate gobs of code to use your language, you're doing something very wrong.

    Excessive verbosity is great if you're a) overly anal retentive, b) not really a very imaginative programmer, or c) getting paid by the hour.

    Oh, and Sun's primary contribution seems to be shovelloads of methodolgies and APIs starting with the letter 'J', thrown aperiodically at the community in the hopes that some of them will stick, most of which are deprecated or outright disappeared when some new strained coffee metaphor comes out saying "No, *this* is the Right Way To Do It!"

    --

    What if life is just a side effect of some other process and God has no idea we exist?

  36. Re:What I need to know by mcrbids · · Score: 2, Interesting

    Because not getting the best performance out of hardware, no matter how old or new it is, puts your application at a disadvantage compared to your competitors. No matter how much you may try and justify things, your users don't care about the language you use to develop - they care about performance.

    Come again? This might be true for a rather small percentage of software, but I don't think it applies even for a majority.

    What I find funny is that I remember these same arguments being made about C because it was so inefficient and "high level", and how assembler was the way to go for performance reasons.

    Most software development is for fixed-function, limited, internal use by a company, organization, or small niche marketplaces. In these environments, getting feature N to work quickly is very important, getting it to work rapidly is marginally important, and the language or platform is irrelevant.

    High-level languages like Ruby, Perl, and PHP (and possibly Java) allow developers to focus on getting the job done quickly, without spending as much time worrying about things like memory management. They allow you to switch types dynamically, so that adding 5 to a character '3' results in an 8.

    If a total of 200 people are using the software, it's very reasonable to expect that the software would perform nicely on commodity software, even if it's not particularly efficient. In this space, all that matters is that it works, and is developed as quickly and cheaply as possible. The cost of development is typically much, much higher than the cost of the total hardware involved - so who cares if it takes a $10,000 server to make it work, if it saves $120,000 in labor expenses for development, and gets to implementation 4 months earlier?

    Where's your smart money going to go?

    --
    I have no problem with your religion until you decide it's reason to deprive others of the truth.
  37. Re:Purpose of being verbose by ealar+dlanvuli · · Score: 3, Funny

    I'm sorry. I've probably written 200kloc of Java in my life. I have never noticed this painful repitition? Where is it?

    Thanks,
    Sean

    --
    I live in a giant bucket.
  38. Is Ruby desperate ? by what+about · · Score: 4, Interesting

    Given the number of posts in java.net and slashdot on how Ruby is the greatest thing of all (and no mention at all of any negative side) I start wondering why is Ruby desperate to move Java programmers from Java to Ruby

    Personally I do not trust a language that has no negatives sides (or at least the Ruby people seems to think so), until it becomes clear what is the other side of Ruby I am not going to use it.

    (Yes, I have visited the Ruby website)

  39. Re:Purpose of being verbose by tunah · · Score: 4, Insightful

    StringTokenizer st = new StringTokenizer(s);

    --
    Free Java games for your phone: Tontie, Sokoban
  40. Re:Python loop array by binary+paladin · · Score: 2, Informative

    Actually in an array (it doesn't work so well in a hash) you can just do this:

    puts array

    That's it.

  41. Re:Python loop array by aurb · · Score: 2, Funny

    Well in Python you can just do

    print array

    Oh, wait, that's 1 character more. That's it, I'm switching to Ruby.

  42. Re:So, what's it like? by lahi · · Score: 2, Insightful

    I must conclude that you don't think

    i++; /* increment i */ is silly either.

    Let's just leave it there, then.

    -Lasse

  43. Re:Purpose of being verbose by mav[LAG] · · Score: 3, Insightful

    Bullshit. Managers like Java because it helps their team achieve their business objectives better than the other languages you describe.

    Hmmm, this attitude sounds somewhat familiar. Oh yeah, Paul Graham has written about it at length in this essay:

    The pointy-haired boss miraculously combines two qualities that are common by themselves, but rarely seen together: (a) he knows nothing whatsoever about technology, and (b) he has very strong opinions about it.

    Suppose, for example, you need to write a piece of software. The pointy-haired boss has no idea how this software has to work, and can't tell one programming language from another, and yet he knows what language you should write it in. Exactly. He thinks you should write it in Java.

    Why does he think this? Let's take a look inside the brain of the pointy-haired boss. What he's thinking is something like this. Java is a standard. I know it must be, because I read about it in the press all the time. Since it is a standard, I won't get in trouble for using it. And that also means there will always be lots of Java programmers, so if the programmers working for me now quit, as programmers working for me mysteriously always do, I can easily replace them.

    On your own dime, go jump in leaf piles, run through a field of flowers, play with Python, Ruby or whatever is good for your spiritual wellbeing, but when you're working to pull a paycheck, you don't get to put your own flights of fancy before things which make your team (not you as an individual performer, but your team as a whole) more effective in achieving business objectives.

    Horseshit. Python and Ruby and Lisp are real-world workhorses that don't need tens of millions of dollars in hype to be successful. For instance I have tens of thousands of lines of Python code out on the field doing real work, 24 hours a day, seven days a week for really demanding clients, including governments and advertising agencies. In one case, I finished a project in a third of the time it took three Java programmers - and mine was smaller, faster and more maintainable for the guys who took it over. Time is money and succinctness is power in software development and Java doesn't make the cut on either. Oh sure, it's a great tool to allow development by the lowest common denominator (money quote from James Gosling) but the really smart teams I know despise it for the ugly hack it really is. When I expressed this opinion in a column for a local computing mag, I was assailed with all kinds of outraged squeals from the local Java gurus. But none of them could answer my points honestly.

    If readers disagree, answer honestly with words rather than modpoints. I've tried Java. I really have. I found it ugly, slow, anal and seriously limiting to work with. And I don't seem to be allowed to fix flaws in it either. That's not good.

    --
    --- Hot Shot City is particularly good.
  44. Re:Purpose of being verbose by mav[LAG] · · Score: 3, Funny
    Well, fuck you too, buddy. Merry Christmas to your ignorant ass.

    Tsk tsk. You're taking this way too personally.

    I'm sure it's easy to copypaste some strawman argument containing hilarious phrases such as "pointy-haired boss" which the children will find irresistible, since they know nothing about the actual merits of the arguments, having never managed anyone, let alone a group of people who work together to achieve objectives such as saving people's lives, or even less noble objectives such as creating a software platform to aid the collective research efforts of thousands of researchers.

    I rest my case. The above paragraph is one sentence! Obviously working with Java's crufty verbosity has affected your writing. I'd suggest taking a course in a more pithy language. By the way, Graham's argument is not a strawman: he's made it clear over a few different essays that because programming languages vary in power, smart coders who use more powerful languages can code circles around those using Java. Also if you're going to drag in logical fallacies then I need to point out yours too: "saving people's lives" and "aiding ... thousands of researchers" has nothing whatever to do with the merits of Java versus other programming languages. It's an emotional red herring.

    I have used hundreds of thousands of dollars on Python code which the author believed to be really maintainable and work really well, but in the reality-based world turned to be such crap that the whole team, including me, had to work a breakneck pace to rewrite it in Java, which has such incredible features as working threading support, no Global Interpreter Lock, actual Oracle and LDAP support that doesn't leak memory like anything, and isn't 20 times slower than the Oracle and LDAP support in other languages, no monkey patches (oh yeah, Python coders seem to think that it's SUCH a good idea to monkeypatch others' code, since after all, SMART people should know without any documentation what's going on, and documentating code is useless anyway, people should just go in and read all of those millions of lines of code if they want to know what's going on) and, you know, clear and accurate documentation and HORDES of pre-existing components which make your life so much easier, if only you're not infected with the dreaded Python community NIH disease.

    Sheesh, I thought the previous sentence was bad but this one takes the cake. Full stops are your friend. So is coherence. Some answers:
    • If you paid hundreds of thousands of dollars for a component written by an idiot in a language your team doesn't use, then you're the bigger idiot.
    • Python does have working threads and the GIL has never bitten me when working with multi-threaded libraries in C.
    • Bummer about Oracle. Try Postgres instead. It's cheaper and better.
    • Monkeypatching is considered harmful by any Python programmer worth his salt.
    • Python comes with batteries included. Of all communities it's the one with the *least* amount of NIH syndome.

    Java does have an additional useful feature: because of its mandatory coding practises and standards it's pretty easy to spot when an amateur has written something really broken, and contain the problem to those components which the amateur has touched. Perhaps this is what has happened to you?

    Entirely possible. But I've seen good Java - really top of the line guru-doing-an-exercise-proposed-by-Martin_Fowler-s tandard type Java - and it was just plain ugly because the language is just plain ugly.

    I've used, in production, Python, Perl, C, C++, Pascal, Java, x86 assembly, a little AutoLisp, and so on. Hundreds of thousands of lines. (The C code I have out there is pretty crappy, for which I apologise, but I was an amateur and thought of my work much as you seem to think now.)

    Can't recall making any comments about your work or even you personally. *Checks* - nope. You

    --
    --- Hot Shot City is particularly good.