× 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.



From: Joe Pluta
Date: 02/05/2011 12:10AM

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.

Looking at your post again, Mark, I realized I wasn't clear about
something.  My comment was this: "dynamic typing is the LDA of
programming languages".  If you re-read that in context I hope you'll
see that what I meant is that it's often used as a quick and dirty
shortcut.  Yes, the LDA can be used properly, and so can dynamic typing,
but both are potentially very dangerous tools.

I don't buy it. Here is why. You aren't going to be using PHP as a quick and dirty. Your application has to fit inside some pre-defined parameters to use PHP in the first place. It has to be a web app, the programming has to be done on the server side, and it isn't going to easily be called from Java or any other language unless you are just going out and getting a whole page. In that case the PHP script still isn't called from Java or RPG, it is called from the client. It is pretty clear cut whether or not PHP is going to be a good solution to your problem. Sure you are talking typing, and I am talking PHP, but I could make the same arguments about javascript. Static or dynamic typing is a property of the language, and you have to live with it. It isn't really a choice you make like whether to use the LDA in your RPG application. There are some parts of PHP such as certain global variables that you shouldn't use because they are a holdover from the early days of PHP, and I would not advocate using them either. There are better more secure ways now to do the same things within PHP.

Static typing at least helps prevents some of the more egregious
mistakes programmers make, such as passing a string where a number is
meant to go.

It can, but some times it makes you jump through extra hoops. What if the value of that string is a number? Why not just let the language go about doing the appropriate casting to let me do arithmetic on it? I know the answer, always be explicit. But, working in a dynamically typed language is a different culture, and the two may not always see eye to eye. You kind of discounted my point about Java collections by bringing up generics (I will have to educate myself about those) and by saying that the objects inside the collection are typed anyway. But the typing of an object in Java is no more static than the typing of an object in PHP. The PHP object knows what kind of object it is, and interfaces are available to say that the Copy function needs to be there. Yes, the compiler doesn't catch it, there is no compiler, the interpreter does catch it though and will report on it the same way that a compiler would.

I know you may not entirely agree with my opinion on typing, but I
wasn't specifically trying to say that the LDA is the same as a dynamic
type.  I was saying that someone who warns against the LDA as a
dangerous programming technique should also make a similar warning about
dynamic typing, which has at least as many potential pitfalls as the LDA.

In the end, I am ok with disagreeing on dynamic typing. In practice I don't see all the pitfalls that you do. I know what I can do, and what to look out for. I suppose just as you do with Java.

Mark

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.