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.
"
"
And Python and essp. Perl just plain drools...
Ruby will be easy for any Perl user to learn, and it really is OO from the bottom up, not just bolted on like Perl's so-called OO.
And Ruby's OO makes much more sense than Java's and Python's OO. I can't explain it, but I can't think OO in Java or Python, and I can in Ruby.
-> I dislike sigs...
I'm quite partial to scsh.
..."
/") -- but something with variables, control flow, conditionals, etc.
I mention this because I understand Ruby's semantics are like Scheme (but the syntax is different, or we'd call it a Scheme).
The intro from the scsh paper (Olin Shivers) convinced me to try it out:
"Shell programming terrifies me. There is something about writing a simple shell script that is just much, much more unpleasant than writing a simple C program, or a simple COMMON LISP program, or a simple Mips assembler program
He's not talking about a simple shell program (like "rm -fr
http://www.thebricktestament.com/the_law/when_to_
I actually wish I had had these details all in one place when I was looking afew months back (abit of googling eventually showed all those pages).
Personally, I have found if you are really interested in RAD w/ Ruby + QT is fine for linux.
But Wx is cross platform and free! and tools like VisualWx which has support for WxRuby certainly help.
Unfortunately it is only on windows atm AFAIK
Just out of interest, which web developement systems use thousands of XML configuration files?
There must be some awful uses of XML config files out there, because a lot of developers complain about it.
I don't know much about it, but seems like they could have a use in some circumstances, and allowing users to edit those rather than strings in the code might be a Good Thing. This depends of course on them having a decent end-user XML editor, clear and succinct XML, and tools for processing XML for the programmer.
KDevelop uses the Kate interface from KDE, which can handle any number of editor plugins (kvim, ) for example. I think the lack of a KEmacs, so to speak, stems mainly from the fact nobody has written it.
Have a look at the WxRuby homepage. I've used this before for coding up a frontend for a Ruby game and it has worked very well for me. I was also able to package it up into one binary via RubyScript2Exe and ExeRb which was important for me.
Well, the trouble is that Ruby is a great language in search of a good implementation.
The current Ruby implementation has various weaknesses -- primitive text support is the most mentioned one (you can't step through a string char by char, I kid you not). Lack of native threading (it uses weird homemade application-level threads) some concurrency issues (it's C with lots of static variables -- I may be very out-of-date here though) and integration problems (it's very much designed with a 'C and UNIX and nothing else' mindset) are also problematic.
Thus, a port of Ruby to the Java or
Whence? Hence. Whither? Thither.
I learned Python last winter and have not looked back to Java despite being a Java programmer since it was in wide-distribution.
And since Python makes win32 programming easy for those who don't use Visual Studio, I have learned to be a Windows programmer over the last couple of weeks.
What do I gain over Python by switching to Ruby? I see a lot of explainations, but as far as I can tell, in addition to the awesomeness of Python's language and libraries, these are the things that I need that I can't seem to find in Ruby(but might not be looking in the right place):
1) Java byte-code compiling (jython)
2) full win32 APIs
3) full win32 COM access
4) Complete Object Database implementation (ZODB)
5) List-comprehension
Someone please educate me on the advantages of Ruby over Python. Cause right now, it is hard to imagine a better language than the snake!
Or, if Python gets a good CLR/.NET implementation, the process and lessons will be very applicable to Ruby. Ditto Parrot. Ditto SWIG. And so on.
Python Is Not Java is a good description of how to approach programming differently when using a dynamically-typed language. Pretty much everything it says applies to Ruby as well. One of the things it mentions is that in most cases where Java programmers use XML, it's to make up for the deficiencies of Java, and you express the same things using Python (or Ruby) source code, which is easier to work with and more general than any XML configuration.
If you put some actual thought into the queries you make, you can do much better. For example, what you'd really like to do is see what permissions the user has. So:
That query allows you to go straight from the user ID to the actual useful information about permissions in a single database round trip. Notice that I used joins. These are things that object-relational mappings seem to neglect. And the foundation of the relational model.
SQL is not hard. Why must everything be an object? I love object-oriented programming, but this isn't a good use of it.
To someone who uses SQL frequently, the code I gave is obvious. (It'd be even more so if slashdot allowed me to indent it properly.) And most people making code to access a RDBMS will have used SQL recently, because they just designed a schema to access. The tool doesn't do that for you.
With object-relational tools, you need to know more than you did before. There's much more complexity and bloat in the system. And the resulting SQL is crap. There's no benefit.
More accurately, "premature micro-optimization is the root of all evil". You will save a lot of effort by choosing an efficient high-level design right away. Passing around objects that tie you to an object-relational tool like this one is not an efficient high-level design.
Yes, that particular piece of Ruby code would cause an unacceptable bottleneck. In many organizations (including mine), the database server and the webserver are not the same. Imagine every round trip taking 50ms and you'll begin to understand. The number of round trips must be O(1) for acceptable performance, and the closer to 1, the better. That's not true for the Ruby code. It makes m + n round trips, where m is the number of roles for that user, and n is the number of permissions for that user. So if that's 20 (depending on how granular permissions are, that's not unlikely), that will add a second per hit. Ugh.
In part. But mostly, it doesn't make sense to add on layers of complexity unless they accomplish something for you. This layer does not, and it does take away your performance.