|
Hmmm... Seems to me that if a programmer hasn't learned enough about Object Oriented (OO) Design and Programming, they should leave Java (and C++) alone and stick with RPG... And likewise, if someone has taken the time to understand OO, they would be better served by using Java instead of torturing RPG to emulate an OO language. Pick the proper tool for the job and the skillset... William date: Sat, 10 Jul 2004 10:02:29 -0500 from: "Joe Pluta" subject: RE: Fitzle > From: furgalj@xxxxxxxxxxxxxxxx > > Now on to a topic that seems to be giving everyone fits. Let me sit over > the tub of cold water with my clown face on and say that JAVA IS A > PROCEDURAL LANGUAGE. Most OO languages are, such as Smalltalk and C++. Technically, this is correct, at least in strict CompSci terms. That's because we've co-opted the term "procedural" to mean non-OO. However, the opposite of OO is not procedural, it's just non-OO. The opposite of procedural is non-procedural, but we rarely run into any non-procedural languages in business applications. A non-procedural language is simply one that, rather than proceeding down a mainline of code and jumping off into subroutines as necessary, instead responds to external events and calls chunks of code. In fact, the best term I can think of as a synonym for "non-procedural" is "event-driven". RPG is an amalgam of procedural and non-procedural code, as Jeff points out. Here's a great example of the non-procedural nature: *INZSR. If you invoke *INZSR from your mainline, that's procedural code. But when it is invoked from the startup code, it's non-procedural. In LISP, for example, you specify two chunks of code, the prolog and the epilog. As you might hazard a guess from the names, these chunks are at the beginning and end of the program, respectively. And that's why RPG code that uses the cycle is really non-procedural. So, technically, you can have non-OO, procedural languages such as C, Pascal, COBOL and RPG (non-cycle), you can have non-OO, non-procedural languages such as LISP and RPG (cycle), you can have OO, procedural languages such as SmallTalk, C++ and Java, and you can have OO, non-procedural languages such as JavaScript. So, since Java is an OO, procedural language, what are people saying when they talk about "procedural Java"? Typically what they're saying is they're writing code in Java without using any of the OO characteristics. They are in effect writing big, non-object procedures. You see this sometimes in code mechanically translated from RPG to Java. You get lots of JDBC calls embedded in UI procedures, kind of like the traditional monolithic RPG program we all know and despise. Really, rather than "procedural Java", the correct term is probably "non-OO Java". So I guess the question is whether we want to continue with this bad terminology, or whether we want to make a conscious effort right now to use the correct terms. RPG is a procedural, non-OO language (except for the exceptions I've noted), while Java is a procedural, OO language. "Procedural Java" is really Java written without taking advantage of the OO features, so it should be called "Non-OO Java". Just my thoughts on the whole mess. Joe P.S. Jeff, I'd be interested to see how SQL is non-procedural. I'm not doubting you, I'm just intrigued. I have to believe that hybrids like embedded SQL are certainly procedural. How is "pure" SQL non-procedural?
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.