|
Hello Hans, OK, regret was too strong. I should probably let this thread fade but you made some interesting points I'd like to comment on and solicit opinion. >This is the "dynamic array" issue. As I've said before, handling >undetermined quantities of data is probably better handled in the >database, and not within program code. Ahh, but you might not writing a database program. In my case I need this sort of dynamic array support when I can not afford the cost of the I/O. It is much quicker to scan main storage than DASD and a based array is faster than any sort of messing with SETOBJACC. Who among you uses based arrays, dynamic storage, qsort() and bsearch()? They certainly don't feature in all my programs but sometimes they are a godsend and we couldn't do it without pointers. >(I like how undetermined quantities of data are handled in other >languages like Python, Rexx, Perl, and Ruby. Varying sized lists >and hash tables are fundamental data structures in these languages. >But then, these have the advantage of being interpreted, not >compiled languages.) Yes, I'd like these sorts of things in RPG too. However, dynamic lists, hash tables, stacks, queues, and sundry other things can all be implemented once you have access to pointer support and dynamic storage. The internal workings, ugliness, and dangerous code can all be encapsulated in procedures and hidden behind a nice, friendly interface. We already have Rexx and I see there is a port of Python available for AS/400 and Perl exists so that leaves . . . >I agree with the statement "Get the data structures correct and >the code falls into place". I've said that many times myself. >I don't necessarily agree with your other. Often complex data >structures can result in complex code. The key point is getting >the data structures "right", which is different that making the >data structures complex. I know from experience that there are >lots of complicated ways to design your data structures. But >there are "good" ways to design the data structures that yield >both simple data structures and simple code. That is a much better phrasing of what I meant. I didn't mean complexity for its own sake but rather that the "right" data structure is often more complex than the immediately obvious one. To less accomplished programmer's the "right" data structure often seems unneccesarily complex. Who among you spends a greater portion of programming time on getting the structures "right" than the actual coding? >For the average RPG programmer, I believe the key issue is >getting a proper database design. But how often does that happen? Especially with most of the major packages. They are either simply crap and wouldn't know a relational database from their proverbial, or well and truly over-engineered. >Function pointers are a different issue from the current >discussion that involves basing pointers. If you're looking >at a lot of "call-back" functions in your application, you >probably should be using an object-oriented language instead. Yes, but since true OO requires a significant investment on the part of the programmer, callbacks are a useful mechanism to "embrace and extend". They are also language independent which OO is most certainly not. Again they are not commonly required but very useful none-the-less. Who among you have implemented callbacks for some of your procedures? Who among you have written the callbacks required by qsort() and bsearch()? Much of this falls into the serious pointyhead programmer arena but it would be interesting to know how many of us: a) Understand and use this stuff when required b) Have heard of it and would like to try it out c) Have heard of it and wouldn't go anywhere near it d) Have no idea what I'm talking about :) Regards, Simon Coulter. -------------------------------------------------------------------- FlyByNight Software AS/400 Technical Specialists http://www.flybynight.com.au/ Phone: +61 3 9419 0175 Mobile: +61 0411 091 400 /"\ Fax: +61 3 9419 0175 mailto: shc@flybynight.com.au \ / X ASCII Ribbon campaign against HTML E-Mail / \ --------------------------------------------------------------------
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.