× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.




I have been watching this thread, and it has become a programming language religious war such that many of the points being made are just plain foolish. Let me point some of them out:


Reasonable points, Mark, if not entirely accurate. Let me respond.


The LDA is the dynamic type of RPG. Really? I don't think I heard anyone saying that the LDA is bad because you can drop anything you want into it.

I guess you missed this, from Chuck:

What are your objections to using the LDA?

No [strong] typing nor any other feature of a programming language to
enforce the standards for the why, what, and where some data may or may
not belong.


If that were the case, a lot of the structures used in RPG would be thrown out with the LDA. Consider for a moment, you can put anything you want into any data area, data queue, message, user space, user index, or data structure, to name a few. Yes, even data structures. I can use the same n characters in a data structure for packed data, zoned data, character data, integers, or any other data type via overlays, and that is a common practice. I have seen no one decrying that capability of RPG. This is really an example of dynamic typing in a strongly typed language. Not a problem. The problem with the LDA if you haven't been paying close attention is that there can be only one, for the whole job, and it is limited in size.

You're absolutely correct that the majority of the slams on the LDA were because there is only one per job. The fact that there is only a single LDA is definitely an issue. But in and of itself it's neither a positive or a negative. Having only one LDA means it's instantly accessible to anyone, with no need for extra naming conventions or anything else. It's just there. Meanwhile the negatives of being accessible are no more insurmountable than any other programming problem.

It wasn't the specifics of the issue though that really got me. My more immediate problem was and is the meme propagated by a few in our community that OO is too hard. I can't tell you how much I hate hearing that from people who should be promoting new technologies.

But even then I usually shut up. At least until those same people start telling people how awful they are; in this case jumping all over Albert for for suggesting the LDA because it's too archaic. Yes, it is old technology. But it's just as acceptable a transition technique as PHP is a transition language. But no, some people were stringing Albert up for daring to suggest such a travesty!

I do hate me some pomposity, I do.


How about dynamic typing has no place in enterprise level programming because the compiler can't help you sort out conflicts.

You have a problem with that? Do you think dynamic typing is better than static typing? Would you prefer RPG to be dynamically typed? Not me, thank you!


Yet even Java provides for dynamic typing and even provides the means for properly processing a group of mixed objects. One of these ways is a Collection, a group of objects, any kind of object, maybe a String, maybe an Integer, maybe a user defied object, any object.

Ugh. The primary enhancement in Tiger (Java 5) was generics. They were expressly designed to get *rid* of the untyped Collection, because it's universally agreed to be one of the primary sources of Java programming errors. They wouldn't have added generics if they thought dynamic typing was good, Mark.


If you try to process an object from a collection in an unsupported way, you get a run-time error. Of course this is the real power of an OO language, and polymorphim is the name of the idea that you can process that mixed collection with say a copy method, and everything will work out all right without having to say if you are a String do copyString, and if you are an Integer do copyInteger. All you have to do is tell each object to copy and let the object decide how to do it.

That only works if you know there's a "copy" method. And you only know that if the object is typed, at least through an Interface. In a dynamic language, you don't even know whether "copy" will work or not until runtime. In fact, it may work sometimes and may not! Oh joy!!!!

Sorry, but dynamic typing stinks for all but a relatively small subset of programming tasks (one of which happens to be scripting, which PHP is pretty darned good at). And this isn't religious language wars, it's a philosophical programming discussion along the lines of OO vs. procedural. As a business language, PHP happens to be okay from a standpoint of OO and sucky from a standpoint of typing.


Or, PHP is no good because it is dynamically typed. But you can think of PHP variables as a sort of collection on steroids. A PHP variable is not limited to containing objects, it can contain scalar values and arrays as well. And PHP provides a way to process it, to know what is in there without inspecting the value. It is really just a matter of preference.

Not really. Preference is whether you like to indent two or three spaces, or how you like to name your variables, or how you use upper case. That's preference. Typing and processing are pretty fundamental to the programming you're doing. Yes, in the end you can do any programming project using any language, but some languages are better for some tasks.



And now I am not pointing out foolishness, but making a point of my own. For some, making the jump between monolithic procedural programming and OO is something like a tribesman from the jungles of New Guinea trying to make it in the corporate jungle of New York City. You have to learn a new language, and a new culture, and while the basic needs are the same, the structure/culture is entirely different. I am not speaking of RPG and Java here, but procedural languages and OO languages in general. Making the shift from one to the other is a total paradyme shift. A different way of thinking. Languages like PHP that let you work in a procedural context while you are comming to grips with objects can ease the transition. Not just from RPG to Java, but from any procedural language to any OO language. And maybe that could be from RPG to OO PHP.

We agree here, to a degree. OO is definitely a paradigm shift. But so is ILE. So is SQL. And we wouldn't hesitate to tell someone they need to learn both of those technolgoies. So I get a bit steamed when people say that OO is too hard. If somebody can learn activation groups and commitment boundaries, they can learn OO. Unless, of course, someone tells them they can't.


Don't get me wrong, I am not dissing Java, and I am not promoting PHP. I like them both. And I like what RPG has become as well. I hope they all continue to grow and thrive. What I disslike are the religious wars. My programming language is better than your programming language, when we all know or should know that it is really a matter of personal preference. Visual Prolog anyone?


I believe OO PHP can be used for business programming, despite the dynamic typing. Clever programmers can probably even use dynamic typing to their advantage in certain situations. That doesn't change the fact that dynamic typing has serious pitfalls. And to promote PHP without promoting OO is a little bit like promoting RPG without promoting ILE, or /free.

Thanks, though, for a reasoned rebuttal. I hope you understand my points, and don't take them personally.

Joe

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.