• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Rails for Java Developers: paradigm shift...

 
Gian Franco
blacksmith
Ranch Hand
Posts: 979
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
     
    Pradeep bhatt
    Ranch Hand
    Posts: 8933
    Firefox Browser Java Spring
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    I thought Eclipse has a plugin for Ruby.
     
    Pradeep bhatt
    Ranch Hand
    Posts: 8933
    Firefox Browser Java Spring
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    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
    Posts: 11962
    5
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    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
    Posts: 31
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    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
    Posts: 979
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Hey guys you hijacked the thread

    What about the 'paradigm shift'?
     
    Justin Gehtland
    author
    Ranch Hand
    Posts: 31
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    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
    Posts: 4
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    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
    Posts: 31
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    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
    Posts: 8933
    Firefox Browser Java Spring
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    What about code blocks in Ruby
     
    Lasse Koskela
    author
    Sheriff
    Posts: 11962
    5
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    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.
     
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic