comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » LIST "bug": .Remove on an empty list
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: LIST "bug": .Remove on an empty list [message #74013 is a reply to message #74002] Fri, 17 December 2010 10:12 Go to previous messageGo to previous message
Paul Van Delst[1] is currently offline  Paul Van Delst[1]
Messages: 1157
Registered: April 2002
Senior Member
David Fanning wrote:
> Paulo Penteado writes:
>
>> And I find "if (~l) then ..." much more convenient than "if
>> (l.isempty()) then ...".
>
> IsEmpty has the value, of course, of letting you know what
> you were thinking months ago when you wrote the darn program. :-)

I agree.

if (l.isempty()) then

is self-documenting to the poor souls that follow who are tasked with maintaining/extending the code (and I include the
orig author in that group! :o).

But

if (~l) then

not so much. To quote Bob Martin from "Clean Code":

"The problem isn't the simplicity of the code but the /implicity/ of the code: the degree to which the context is not
explicit in the code itself"

I'm not advocating that code should be understandable to the point where your grandma can figure out what you're trying
to do (been there, done that, not good), but new hires with limited experience (i.e. not computer science/programmer
types) should be able to easily grok what's going on since they will pretty much not know that "lists currently already
overload their truth value". :o)

cheers,

paulv
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: LIST "bug": .Remove on an empty list
Next Topic: spawning Fortran executables

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 23:45:39 PDT 2025

Total time taken to generate the page: 0.40017 seconds