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.'"
If speed and memory usage is your only criteria when choosing a language, why not use C or assembly?
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.
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
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.
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.
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.
.Net doesn't seem to have such competition?
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
I'm a big tall mofo.
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.
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).
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.
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?
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.
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?
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.
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)