You can do stuff like this:
FIND FIRST Order EXCLUSIVE-LOCK
WHERE Order.OrderDate = TODAY.
A procedural style database access (over SQL's set-based style) with in-place access to tables and fields.
However, it can really suck.
Why? Well, you are limited in your ability to code at a higher level of abstraction. This has hit me again and again over the last 7 years while working with a large inherited code-base. You have no object instances, or struct's or function pointers or custom data-types. This limits the ability to have code be concise, or readable.
Recently I've had the interesting task of writing the same system in Progress 4GL, then Java, then Ruby (don't ask how or why!).
I loved some aspects of Java:
- Objects and classes - using basic classes with collaborating objects drops a tonne of 'noise' you have to maintain with Progress because of it's primitive support for abstraction
- Spring - I just love flinging around singleton instances, setting this on that so loosely. Loose coupling/tight cohesion city!
- Massive number of quality open-source libraries out there
- IDE support - i saw 'refactoring' happen in IntelliJ, but found almost as good support in Eclipse. Refactoring rules.
In my opinion, the 'noise' you drop in Progress -> Java is similar in Java -> Ruby.
- POLS - Principal Of Least Suprise
- Humane interfaces (multiple methods doing very similar things). How often do I think 'wonder if this'll work', and yep, it just does, then I lookup ri and find out it's an alias. It also makes code more readable.
- Extraneous syntax can be left out - Methods don't need (), lines don't need a terminator.
- Consistancy - everything is an object. This helps in simplifying your view on things. Java primitives suck.
- Arrays and hashes are built in - and they are objects. Iterators work on both, and simply rock. They make complicated code compact yet readable and concise.
- Operators are overloaded to work in ways that make sense.
Eg: array1 + array2,
I think matz, the creator of ruby, sums it up best:
Often people, especially computer engineers, focus on the machines. They think, "By doing this, the machine will run faster. By doing this, the machine will run more effectively. By doing this, the machine will something something something." They are focusing on machines. But in fact we need to focus on humans, on how humans care about doing programming or operating the application of the machines. We are the masters. They are the slaves.
I couldn't agree more. Thank's matz.