× 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 Tue, Mar 20, 2018 at 5:59 PM, Dan <dan27649@xxxxxxxxx> wrote:
I actually found this line of code a few minutes ago.

I'm going to ask if we can install a punching bag somewhere in the building.

I am not defending whoever wrote that code, and I would never write
that myself, but I would like to believe that it was a misguided
attempt to "fix" a badly named (or badly populated) field.

For example, maybe there is a flag which is called OPTED_OUT, and
because of poor file design or poor programming by Bob, this field
contains 'N' whenever the account *is* opted out. And Charlie comes
along and thinks "well, it's too late for me to fix the file, and
whatever other programs might use that field, but for right now, right
here, I can make it so that *my* code looks like this:

if opted_out = YES;
do_the_right_thing();

and that's pretty readable, right?"

Two wrongs absolutely do not make a right. But it's possible Charlie
was at least *trying* to do something good.

And, I cannot stress enough that these shenanigans are NOT a good
idea, but if Charlie were really insistent on making his code read
well via creative naming, he should have at least gone the route of
renaming OPTED_OUT to OPTED_IN in the program (I'm thinking via I
specs?) so that 'N' could be used as-is or given a sane name like NO.

Incidentally, this is why I am extremely reluctant to ever use a name
which is itself a negative. My permissions are always of the form
ALLOW_something.

John Y.

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.