|
Personally, I find pointer support in RPG to be easier to work with and debug than the C support. It's more intuitive to me. A pointer shouldn't be typed -- it's type is "pointer". As for pointers being overused, (also, being used incorrectly) it's because they are new. They are a completely new concept to the average RPG programmer, so they struggle with them and they try to use them and play with them -- that's how people learn new things! Once they've become used to them, they'll know when the appropriate times to use them are, and when they're not. That's all part of the learning curve. I believe pointer support in RPG is critical for RPG's continued growth and modernization. Without it, RPG is a legacy language. On Fri, 11 Jan 2002 boldt@ca.ibm.com wrote: > > First, RPG pointer support is nothing like pointers in, say, C. In > C, pointers are typed, and so the compiler can complain about type > mismatches, which can save lots of potential headaches. Pointers in > RPG are untyped. It's a lot more difficult to debug pointer problems > in RPG than in C. (And C is hard enough as it is sometimes!) > > Second, I believe pointers may well be overused in RPG. Sure, > they're great when you have to call some API. But beyond that, I > wonder if they're being used just because they might offer some > "cool", "geeky" way to implement some function. > > For example, if you need to manage some varying sized amount of data, > there are several different ways to handle it. If you're dealing > with a compute-bound application (like a compiler), a reasonable > approach would be to use a linked list, using pointers and malloc's. > But application programs typically are I/O bound, not compute bound, > and so program performance is less of a concern. In this case, a > table in a database would be easier to understand and easier to > maintain, along with other advantages, like persistence. > > In other words, just because you have some capability, it doesn't > mean you have to use it. > > The essence of good software engineering is not just knowing how to > use some tool, but also knowing how NOT to use it. > > >rpg400-l messages indicate that many RPG IV programmers are using them > >to great advantage. > > ... and often having lots of problems with them. :-(
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.