Ruby on Rails from a Java Programmer's point of view
Today, I just received "A" from Ruby on Rails grad class
So, w/ that being said. I just want to share my opinion and see if you agree or point out my misconceptions.
1. For a beginner programmer who's learning OO concept... Ruby will only make him go The reason is that Ruby allows to add/remove/modify function on existing Classes, such as String/Integer/etc... and you can do that anywhere in the code. Of course, this gives great flexibility to improve existing Class available w/ new functions. But, overall you should extend the class and not change the class itself. Of course, Ruby also allows inheritance but I can easily see noobie programmers easily abusing this feature. Basically, put everything in String class and throw out OO pattern. Still, I'm not saying Java is greater than PHP or vice versa. Just saying Ruby shouldn't be the first language they should learn. Imagine them going from Ruby to Java or Ruby to .NET..they'll be thinking.. why can't I add more methods in String class damn it!! I put entire logic into that class! now I gotta write multiple classes to do the same? OO pattern? What?? hm.. hopefully you guys see my point. I think if you go from Java to Ruby, you'll be a lot efficient programmer.
2. Horrible IDE Support for Ruby This can be debatable since some swears that notepad is enough for them. But, I'm on the IDE boat. I want to be able to write/test/run my codes in a single Application. As far as running the server, very good! debugging, very good! coding assistants, it sux! yes it gives general syntax help in case your lazy finger slipped a letter. But, when you press "." then a dropdown shows up w/ available methods on that class ... hm~~ it's confusing at best. I'd say about 50% of the methods available are not even suppose to be there. Sometimes, there's a method to that Class but it won't even show up. I can see why IDE can't figure it out, it's because Ruby is a scripting language.
3. Passing "bloc" as an argument I played w/ this for a project. Not heavily but just to get a taste. I know everyone is trying to create codes that can be "reusable" as much as possible. But, I think it's crossing the line when you're passing the code as an argument. I have seen some use like getting a list of something inside some collections or printing each of them and etc... I'm sure there are programmers who like these feature. But, for me... this was the strangest thing I've ever seen. If I can pass code around then why have OO pattern at all... It's kind of like saying I'm architecting a building but people can walk through walls..then what's the point of architecting? I think w/ good OO design you shouldn't need to pass codes to a method
4. Taking "as is" for RoR plugin Man~ there are zillion plugin for this guy. It's really good. Like adding digg features, do auto-complete ajax, attachment, and etc... Certainly, if you use these plugins as instructed and fits your requirement than it's super awesome. However, let say your requirements can satisfy 90% using this plugin but 10% you gotta do it somehow. I asked this to my professor and he said, well source code is always there, you can edit it yourself. I think this defeats the purpose of using the plugin. If I'm gonna read someone else's code, mind as write my own..and chances are it'll be quicker that way. Also, some plugin won't work w/ latest RoR and some will not work on Windows
5. Ruby hating on Windows I don't see a reason why certain functions work on windows and some unix. Why? programming language should be OS platform neutral. I now about 99% of ruby stuff is windows compatible but some are not! I'm sure you guys would know more then I do. I even heard some students that his program runs fine on Mac but not on Windows... this didn't sound so good for me
Ok I think I'm done evaluating Ruby and feel free to bash me. By all means, I didn't write this thread to say Ruby on Rails sucks. I see more positive then negative. I do like everything in 1 package to do the web application.
Just saying Ruby shouldn't be the first language they should learn. Imagine them going from Ruby to Java or Ruby to .NET..they'll be thinking.. why can't I add more methods in String class damn it!!
There are always going to be issues when you move to your second language. I don't think you should limit the flexibility of Ruby just because of this. At the moment, if you want the flexibility to override class methods you can use Ruby. If you'd rather not allow this type of behaviour you can use a different language such as Java. Making Ruby more like Java would only limit developers' choices. If Java suits the way you want to program, then fine; stick to Java. (Of course if you use JRuby you can use both Java and Ruby).
I'd highly recommend you get hold of a copy of Design Patterns in Ruby by Russ Olsen. I think he gives a really good case for why this type of flexibility makes Ruby such a powerful solution (as well as give great examples of how to use it).
Originally Posted by sg707
4. Taking "as is" for RoR plugin
However, let say your requirements can satisfy 90% using this plugin but 10% you gotta do it somehow.
Of course. That's always going to be the case when you use someone else's code. They're available. If they work great. If you have to code your own solution - OK. What's great about the Ruby plug-ins is that it's fairly easy to modify them yourself, so if they are 90% of the way there, its often fairly easy to tweak them to suit your requirement. That's far better than just getting an executable that can't be altered.
Originally Posted by sg707
5. Ruby hating on Windows
I don't see a reason why certain functions work on windows and some unix. Why? programming language should be OS platform neutral.
I use Rails almost exclusively on Windows and have no problems. The Ruby language is OS neutral. The only exception that I've come across is that sometimes it has to talk to other systems and they can be environment dependant. The three examples I've come across are:
databases - Accessing MS SQL from Ruby on Linux is harder than it is on Windows - but that is as much an MS SQL issue as a Ruby issue.
LDAP - The LDAP tool most Ruby developers use on Linux don't work so well on Windows (or didn't when I was using them a year or so ago).
Ruby on Linux doesn't have easy access to MS Windows objects via WinOLE32
That's three occasions in four years of continuous use of Ruby, and each was fairly easy to work around. If that makes Ruby fail platform neutrality then I think that term has little value as its hard to see any usable language passing that test.