Slashdot is powered by your submissions, so send in your scoop

 



Forgot your password?
typodupeerror
×
Programming IT Technology

Ruby Off the Rails 325

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.'"
This discussion has been archived. No new comments can be posted.

Ruby Off the Rails

Comments Filter:
  • by Man_Holmes ( 519973 ) on Saturday December 24, 2005 @04:58PM (#14333536)
    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
    • 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.
      • Performance? Isn't Java pretty slow?
        • Only for client apps. On a server things are a little different.
          • Ah, so it's like.. the JVM, the applet bit that is slow?
            • 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 bet
              • by Decaff ( 42676 ) on Sunday December 25, 2005 @10:37AM (#14336015)
                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.
                • 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 peopl
        • J2EE is a very powerful server program, and Tomcat is also a very good substitute as well. Java is amazingly good when it comes to this sort of thing.
    • Why "flamebait"? The Man definitely has a point, like or not.

      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 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.
    • by Joey Vegetables ( 686525 ) on Sunday December 25, 2005 @12:38PM (#14336327) Journal
      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.
  • Go Java! (Score:4, Interesting)

    by HillaryWBush ( 882804 ) on Saturday December 24, 2005 @04:59PM (#14333542)
    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 [cnt.org], it sure ought to be. Over.

  • ...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 [onjava.com] (including a dbUnit chapter in Java Testing Patterns [amazon.com]), 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 [sourceforge.net].
  • Erm, hello (Score:5, Insightful)

    by m50d ( 797211 ) on Saturday December 24, 2005 @05:17PM (#14333611) Homepage Journal
    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.

    • Re:Erm, hello (Score:2, Insightful)

      by cnerd2025 ( 903423 )
      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 hi
  • by bigtallmofo ( 695287 ) on Saturday December 24, 2005 @05:18PM (#14333613)
    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?
    • .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.

  • 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 w
  • by soundofthemoon ( 623369 ) on Saturday December 24, 2005 @05:40PM (#14333668)
    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.
  • by Anonymous Coward on Saturday December 24, 2005 @05:46PM (#14333688)
    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.
  • by Jeff DeMaagd ( 2015 ) on Saturday December 24, 2005 @05:58PM (#14333736) Homepage Journal
    ...the basic definition of being derailed?
  • Rails hobbles Ruby (Score:3, Insightful)

    by MarkusQ ( 450076 ) on Saturday December 24, 2005 @06:00PM (#14333749) Journal

    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

    • I think Rails offers more of a "Wow" expereince for people coming from PHP or Java; experienced Rubyists appreciate what Rails offers, but also understand how relatively simple Ruby makes it to do these things on your own, and often it is better to just roll your own rather than wade through the Rails API maze.

      • Agreed. The main reason that Rails's limitations don't sink it for me is how easy Ruby makes it to extend / modify the base to suit your needs. I didn't like the way ActiveRecord serialized some objects--so I wrote my own serialization in a few dozen lines of code.

        --MarkusQ

  • by mpn14tech ( 716482 ) on Saturday December 24, 2005 @06:49PM (#14333897)
    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.
  • Ways of Using Ruby (Score:4, Informative)

    by TheUncleD ( 940548 ) on Saturday December 24, 2005 @08:17PM (#14334128)
    Also, there's many different ways of using Ruby besides Rails. Rails is ONE freamework. Iowa is another here you can find out [slashdot.org]. 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.

  • Is Ruby desperate ? (Score:4, Interesting)

    by what about ( 730877 ) on Sunday December 25, 2005 @02:26AM (#14335163) Homepage

    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)

A CONS is an object which cares. -- Bernie Greenberg.

Working...