RAD with Ruby
Amit Upadhyay writes "KDE's award winning integrated development environment KDevelop, has integrated support for Ruby,
an excellent and easy to use object oriented scrpting language. If you
are looking for a good programming tool for quickly developing a
professional one off application, Ruby (with KDE bindings) maybe just the thing for you. There is a quick tutorial and an online book to get you started. You may also want to read a quite informative comparison of Python with Ruby. If you are web developer or write enterprise applications with JAVA etc, take a look at Ruby on Rails(api), they have a nice blog too. KDevelop provides a GUI builder and Debugger for rapid application development(RAD) with Ruby, which is getting better. There is a nice tutorial on using KDE libraries with Ruby. And if you have lots of code in C/C++, extending Ruby to use them is easy.
"
"
With so many other languages out there, why bother with Ruby?
s tE xample
Perhaps an example would be best.
http://www.rubyonrails.org/show/AccessControlLi
NOTE: In the above example, the Model Code (just a handfule of lines) is what creates all the database-mapped classes and relationships. In other words, the implementation of functions used in the Example Usage were created on the fly!
If you haven't done enough object-relational mapping using other languages to be blown away by this example, then here are 37 other reasons:
http://hypermetrics.com/ruby37.html
Ruby Home
http://www.ruby-lang.org/
Here's Ruby for Windows. It includes many extras such as FreeRIDE (a Ruby editor written in Ruby):
Ruby One-Click Installer for Windows
With Ruby, there are even classes that let you do OLE automation.
And calling C/C++ functions is super-easy using Ruby so you can use all those DLL functions out there.
As long as we're dumping Ruby links, I must plug a project I work on and a project I work with daily:
/. for more information and links.
JRuby is a 100% java implementation of Ruby 1.8. The most recent release is pretty old, but the version in CVS is shaping up nicely and is getting quite stable. I joined development over a month ago, and work has been rapidly ramping up.
The Ruby Development Tool aims to bring a full Ruby develop/test/debug environment to the Eclipse platform. It is also rapidly maturing, and may in the future use portions of JRuby for parsing and debugging. While using or developing JRuby, the RDT is a welcome companion, allowing me to stay within Eclipse when developing both Java and Ruby.
I would also recommend tracing back to previous Ruby posts on
"Just out of interest, which web developement systems use thousands of XML configuration files?"
J2EE. Application servers. Tools that generate mappings between databases and Java classes. Struts. etc etc etc.
Of course, any scripting language is a big disadvantage when compared to perl because only perl has CPAN. The organized central archive for extensions with support distributed as a standard module was a brilliant move by Larry Wall; every other scripting language is still playing catchup, and still no one else can compare to even where CPAN was four years ago. (RAA is better than nothing, but it's still not there. CPAN's hierarchical naming scheme, while occasionally inconsistent, was a really good idea)
For commercial use, I'd also want some of ruby's remaining licensing issues cleaned up, but I understand that's been taken care of. (I haven't checked lately)
Example?
not half as consistent as Smalltalk
(so you agree that Ruby is more consistent than Python?)
Smalltalk has no form of MI, has it? At least not in the original version. That may be consistent, but it's not practical at times...
That's a good summary of some of Ruby's shortcomings.
You can step through a string character by character, though. It's just not obvious how, and that's a bit of a flaw. There should probably be an obvious method like "each_char".
If you don't mind getting your characters as numeric codes, you can use String.each_byte. It's easy to turn each byte back into a character using Integer.chr:
Or use String.scan:
Ruby being Ruby, there are probably another dozen ways to do it. And, for those who wish Ruby did have a String.each_char method, just add it:
And now...
(Please excuse the lack of indenting. /. and I can't seem to agree on how to make indenting work.)
You have to read this. It's more than an intro to Ruby... It's a mini adventure!
Why's Poignant Guide to Ruby
Those foxes! That cat! The crazy goat!
I am bald
I like both ruby and python. In a recent project were we tried to use ruby for linux OS control I came across a dangerous problem.
The Ruby thread scheduler relies on gettime to schedule threads. What's the problem with this? Just change our clock back in time will running a threaded ruby application. You'll notice that your thread stalls and will stay that way until time catches up with it.
For this reason alone I can never recommend Ruby until it gets a proper thread scheduler that employs a more reliable scheduling method or uses pthreads.
if one goes to full unicode, then some chunks will be one size, and some another (up to 32 bits).
Sounds like a case for my Unicode FAQ!
http://www.jbrowse.com/text/unicode.shtml
Character set != encoding. Longest representation of a character in a standard Unicode encoding is necessarily > 32 bits.
In any case, Java, C# and (with eg Boost) C++ don't have this problem and Perl and Python, while not perfect, are much better than Ruby. If you have a mass of generic text to process, like maybe a big database of emails written in various languages, with Ruby your first task is to sit down and implement the relevant character encodings, followed by an enhanced string class and maybe plugging in a new regex engine. This makes Ruby a particularly bad choice for a lot of things, although I maintain a bit of an interest in it anyway because it's a good way to practise reading docs in Japanese.
Whence? Hence. Whither? Thither.
"Where is the thought provoking stories ... " how is that correct? It's "Where are the thought provoking stories ... "
:wq