I think elegant > efficient, when its close anyway.
I once wrote a statement in BASIC for an IBM 23 that the compiler spit out as "too complex". I combined 23 lines of AS/400 RPG code into one complex Basic statement.

at some point got good at rolling multiple lines into one statement in RPG. I even tried out doing logical files with a bunch of formats and multiple layers of formats derived from others, conditional formats, blah blah.

It didn't take long to conclue that clarity should trump efficiency.
Plus you might have to work on that code a year from now and have to puzzle out what you did.

BUT keeping efficiency in execution always in mind.

--Alan


On 12/11/2025 1:02 PM EST Javier Sanchez <javiersanchezbarquero@xxxxxxxxx> wrote:


Do you think it's worth all those lines of codes against one single line?
Is that elegant?
Is that efficient?
Not sure what you wanted to show. All I'm saying is that, fewer lines of
code, efficient compiler code is better.

JS


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