File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Ruby and the fly likes Rails for Java Developers: paradigm shift... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Languages » Ruby
Bookmark "Rails for Java Developers: paradigm shift..." Watch "Rails for Java Developers: paradigm shift..." New topic
Author

Rails for Java Developers: paradigm shift...

Gian Franco
blacksmith
Ranch Hand

Joined: Dec 16, 2003
Posts: 977
Hello,

What would you say is the hardest 'paradigm shift' to tackle
for a Java programmer when he/she has jump on to Rails?

Kind regards,

Gian
[ January 29, 2007: Message edited by: Gian Franco Casula ]

"Eppur si muove!"
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Not sure if I'd call it a paradigm shift but the development environment was perhaps what felt like the biggest change:
  • A lot of testing and debugging stuff is built-in (script/console, test generators, etc.)
  • The Ruby language makes you able to be productive using vi, which is a lot to be said. (although I've recently started using TextMate, which certainly is an improvement over vi)
  • There's no IDE like I have in Java that provides easy code navigation based on the type information available (call graphs, implementors, etc).

  • That list is just from the top of my head. I'd be curious to hear of others' experiences.


    Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
    Pradeep bhatt
    Ranch Hand

    Joined: Feb 27, 2002
    Posts: 8903

    I thought Eclipse has a plugin for Ruby.


    Groovy
    Pradeep bhatt
    Ranch Hand

    Joined: Feb 27, 2002
    Posts: 8903

    Originally posted by Pradip Bhat:
    I thought Eclipse has a plugin for Ruby.



    Here it is
    http://www-128.ibm.com/developerworks/opensource/library/os-rubyeclipse/
    Lasse Koskela
    author
    Sheriff

    Joined: Jan 23, 2002
    Posts: 11962
        
        5
    Yes, there is an Eclipse plugin, which I've also used. However, the Ruby editor lacks the kind of features that the Java editor has (such as the ones I mentioned above).
    Justin Gehtland
    author
    Ranch Hand

    Joined: Jan 30, 2007
    Posts: 31
    RadRails is the Eclipse IDE for Ruby/Rails, and IntelliJ has recently released one for IDEA, as well. ActiveState has Komodo, which is decent. There's also the old standby, JEdit, as well as Scite (for Windows users). TextMate is our preferred editor, but we're Mac guys, so that should come as no surprise.

    We're hearing very positive reviews of the IDEA plugin, so much so that we know several teams that are switching over from RadRails.

    However, it is true that you won't find modern refactoring-style support yet, which can be a bummer if you are used to it. The plus side is that, for RadRails, IDEA and Komodo, the standard Rails tools are all easily accessible: single-key unit test runners, access to the generators from the UI, start/stop of Mongrel, etc. So, the experience isn't TOO far off the standard Java environment, but different enough that it will take a few days to get used to it.
    Gian Franco
    blacksmith
    Ranch Hand

    Joined: Dec 16, 2003
    Posts: 977
    Hey guys you hijacked the thread

    What about the 'paradigm shift'?
    Justin Gehtland
    author
    Ranch Hand

    Joined: Jan 30, 2007
    Posts: 31
    Sorry, got carried away. ;-)

    Shift 1: Convention over Configuration. Learning to let go of massive URL-mapping patterns and declarations pointing classes at tables, etc. This is actually emotionally difficult for some folks.

    Shift 2: Ability to modify the framework without re-writing the source. I "monkey-patch" Rails (and Ruby) on almost every project. I never do it by opening up the source code, but rather by mixing my changes into the framework (or language) at runtime. This is an enormously powerful shift that people tend to ignore at the beginning.

    Shift 3: Testing, not debugging. I know of almost no Ruby/Rails programmers who use the debugger. Dave Thomas has famously said that he has NEVER used the debugger. Testing is where its at, baby.
    Jari Tuomivirta
    Greenhorn

    Joined: Jan 18, 2007
    Posts: 4
    Originally posted by Justin Gehtland:
    Shift 2: Ability to modify the framework without re-writing the source. I "monkey-patch" Rails (and Ruby) on almost every project. I never do it by opening up the source code, but rather by mixing my changes into the framework (or language) at runtime. This is an enormously powerful shift that people tend to ignore at the beginning.


    How does this differ from using inheritance to add or override specific functionality?
    [ January 30, 2007: Message edited by: Jari Tuomivirta ]
    Justin Gehtland
    author
    Ranch Hand

    Joined: Jan 30, 2007
    Posts: 31
    Most Java frameworks don't let you just override parts of the core, largely because you would have to inject those changes into the initial load. Frameworks built on DI, like many of the newer tools based on Spring, give you some of this by letting you determine the classes that make up the framework in an externalized descriptor file.

    With Ruby, though, at any time and in any context, you can re-open a core class (there isn't even any real notion of sealed or final classes) and modify its internals.
    Pradeep bhatt
    Ranch Hand

    Joined: Feb 27, 2002
    Posts: 8903

    What about code blocks in Ruby
    Lasse Koskela
    author
    Sheriff

    Joined: Jan 23, 2002
    Posts: 11962
        
        5
    Originally posted by Pradip Bhat:
    What about code blocks in Ruby

    While an incredibly useful feature, I didn't feel like blocks were a paradigm shift for me.
     
    I agree. Here's the link: http://aspose.com/file-tools
     
    subject: Rails for Java Developers: paradigm shift...
     
    Similar Threads
    Your most hated word
    IntelliJ Ruby on Rails support?
    Which is the hottest Java Technolgy?
    Is Groovy just a syntax suger
    Creating Domain-Specific and General Programming Languages