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



On Fri, Jul 1, 2016 at 11:44 AM, Mark Murphy/STAR BASE Consulting Inc. <
mmurphy@xxxxxxxxxxxxxxx> wrote:

Did you try it? I did, and all of the test cases in John's post pass.


​No I didn't, I didn't catch this line


​​
​elseif
​​
%check(
​​
content: chr) > 0;​

​Which is handling the distinct requirement.​



As for procedures, this is a single procedure were the only duplicated
code is in the block mentioned above. I guess I could have broken that out.
Otherwise I would be splitting things up for the sake of splitting them up?



​Procures aren't just for removing duplicated code. They can make the code
more self documenting and easier to follow. Case in point the above code
could have been:


​elseif
​​NewDistinctChar(

content: chr
​);

With NewDistinctChar() simply being a
return ​

%check(
​​
content: chr) > 0
​;

I'm a big fan of being able to glance at the code and being able to
understand what's going on. IMHO, code inside nested if's is something to
avoid as it is not conducive to doing that.

From a philosophical point of view, I expect RPG IV code to be using
procedures. Tasks should be broken down into smaller chunks.


Might explain my fondness for top-down development. :)


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.