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




Denis Robitaille
Directeur services techniques
Cascades Inc
819 363 5187
fax 819 363 5177


>>> klemscot@klements.com 01/11/02 02:59pm >>>


On Fri, 11 Jan 2002, Denis Robitaille wrote:

>> This is the thing with pointers. It can introduce bugs when you dont
>> expect it.

>That's not "the thing with pointers", its "the thing with computers".
>If you sit and write programs all day every day, not a day will pass in
>your career where you don't discover a bug that you didn't think of.
>Even if you don't use pointers at all.

I'll rephrase. The meaning and implication of Code using pointers is not as 
obvious (For me, I cant talk for others) as code that uses Data structure and 
overley. Thus there is a higher possibility of bug getting in to my bug and I 
have more trouble spotting it.

>> For example, let say that all 3 fields were reference. You
>> could still be in trouble if you specify a dim of 4 for your array.
>> What will be in the fourth elements? You are also assuming that
>>consecutive fields in a file are stored in consecutive memory location
>> which is not always the case.

>It's not the pointer's fault that you assumed something.  You could make
>the same mistake using a data structure or certain types of parameter
>logic.

To be clearer, I do not assume that fields are consecutive in memory. This 
assumption was made by the person to which I was responding. But when I use a 
data structure to group fields, I do not assume, I know that the fields are 
located in contiguous memory locations.

>That's why we test our code.   That's why we beta test.   That's why even
>after testing our code and beta testing our apps, we still find bugs.

>It's not a problem with pointers.  It's a problem with people not seeing
>every possibility of every line of code they write.  If only we could get
>upgrades for our brains...



_______________________________________________
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@midrange.com
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/cgi-bin/listinfo/rpg400-l
or email: RPG400-L-request@midrange.com
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.




As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.