• Michael R (unregistered)

    return isFrist("FILE_NOT_FOUND"") ? TRUE : TRUE;

  • TheCPUWizard (unregistered)

    Perhaps the person comes from a C++ background where invoking a [non-virtual] method on NULL [nullptr] is actually (And unfortunately, in most cases) quite possible...

    NOTE: we use uppercase numbers, lowercase numbers did not make it into any (that I know of) fonts - the characteristic is thet 3,4,5,7,9 all descended below the bottom (like many lower case letters [p,q....]

  • Arivald (unregistered)

    Well, in some languages you can call method on a null reference. "this" is passed as first hidden parameter, so as long as you not use any fields it works OK. Not in Java, though. Still a WTF.

  • (nodebb)

    if you use stringly-typed numerical values, you should check upper and lower case, because of: 0x3D7F != 0x3d7f

  • Jonathan (unregistered)

    IsAll() was because accidentally the whole thing.

  • Alistair (unregistered)

    There are upper case numbers https://graphicdesign.stackexchange.com/questions/54423/why-dont-upper-case-numbers-exist

  • (nodebb) in reply to Domin Abbus

    Don't worry. They remembered to use the case-insensitive comparison function, so both lowercase and uppercase zero compare correctly!

  • Numeric Case. (unregistered)

    An upper case 0 is clearly an O. Lower case 0 would be o.

    Numeric case L would be 7. Numeric case l would be 1...

    Perfectly consistent.

  • my name is missing (unregistered)

    Clearly the moderate function here uses isAll()

  • Tim (unregistered)

    obligatory XKCD reference https://xkcd.com/2206/

  • Sauron (unregistered)

    Maybe they should use the isAll() function to check whether integers are uppercase or lowercase xD

  • Mr Bits (unregistered)

    This WTF is easily fixed simply by renaming the function to isAllThisAndABagOfChips().

  • (nodebb)

    perhaps it's short for IS ALLocated... In which case checking for this == null has approximately nothing to do with anything.

    And in C++, calling any non-static member function on a NULL object pointer is UB, regardless of anything. It's normally sudden death if the function is virtual, owing to the very common mechanism of finding the function in the vtable which is referenced by the this pointer, but if the function is non-virtual and prevents itself from referring to the contents of the object, you might get away with it.

  • ichbinkeinroboter (unregistered)

    § is my shifted 3. lol

  • (nodebb)

    I'm old enough to remember typewriters that didn't have a 1 key, you repurposed l. So uppercase 1 would be L.

    And exclamation point was '<backspace>.

  • (nodebb) in reply to TheCPUWizard

    Georgia is a commonly available typeface which uses lower-case numerals. Unfortunately, they are not equal-width numerals, so they don't work well for tables or spreadsheets.

  • (nodebb)

    "using strings to hold numeric values" problem

    Worse - it looks like it's a "using strings to hold numeric values that you're using as booleans" problem.

    Thanks - I hate it.

  • (nodebb)

    A surprising amount of people are concerned over instance addresses for functions not needing instance addresses.

  • BeeKay (unregistered)

    Maybe it’s not Java at all but ValleyGirlLang.

    If beach.isAll(“totally_awesome”) then surf.isLike(“gnarly”)

  • NoLand (unregistered)

    To be fair, isAll() is a general test for existence – for the existence of the computer it is running on, the universe, and all. As such, it is sensibly named, as well. ;-)

  • John (unregistered)

    1 see 1'm not the only one who remembers Selectric typewriters.

  • Ish (unregistered)

    A friend asked ChatGPT to produce some code for converting uppercase to lowercase (I can't remember what language), and it came up with something that converted "+" to "-" and "*" to "/".

  • Duke of New York (unregistered)

    My reading is that the method used to detect the end of a null-terminated sequence, like C strings or the argv array, and therefore it is meaningfully named.

    "Undefined behavior" is not a synonym for "impossible" nor "guaranteed to crash." Successful compilation and execution in some implementation-determined manner is an option. Indeed there is a long tradition of "failure-oblivious" computing where continued operation is prioritized over detection of errors.

  • Duke of New York (unregistered)

    Oh, I just realized that this is Java and not C++. NEVER MIND.

    In penance for my mistake, can I offer the story of a co-worker who wrote Java test cases that expected a constructor to throw an exception, but also asserted the values that the same constructor returned?

  • Anon55 (unregistered)

    Maybe they thought all is the opposite of null. So, instead of calling the method isNotNull, they called it isAll

  • (nodebb)

    Depends on the language. Some languages only die if you use the pointer--the code in question never does and thus would be fine. Assuming such a language this is actually "IsAllocated" written inefficiently.

  • (nodebb)

    I'm imagining that this class has a number of isX() methods, which can be used / passed as parameters to some filtering methods. isAll() is then the dummy method you use when you want all the instances, except of course nulls. The fact that this won't actually filter out nulls the way they hope it will is the only problem, and is either a brainfart, or as already suggested, someone coming from another language where it would actually work.

    I want to know what other values "isCheckedOut" can be set to. Looks like someone coming from a weakly typed language with too many truthy/falsey gotchas.

  • (nodebb)

    Should have been a "representative-line" story?

  • (nodebb)

    IsAll() isn't a WTF. It's poetry. It's creative writing at its purest form. I'm sure there's an Edgar Poe poem titled "isAll()" somewhere.

  • Officer Johnny Holzkopf (unregistered)

    Upper class numbers = ° ¹ ² ³, working class numbers = 0 1 2 3, lazy case 7 = ¬, deceased case 8 is ∞ and that isAll(Volks);

  • wurzel3 (unregistered)

    public class AllIsPossible { public static bool operator ==(AllIsPossible obj1, AllIsPossible obj2) { return true; }

    public static bool operator !=(AllIsPossible obj1, AllIsPossible obj2) { return false; }

    public bool isAll() { if (this == null) { return false; } return true; } }

  • (nodebb) in reply to Duke of New York

    "Undefined behavior" is not a synonym for "impossible" nor "guaranteed to crash." Successful compilation and execution in some implementation-determined manner is an option.

    True, but it's worth remembering that the "some implementation-determined manner" can easily be something you didn't intend, and, even worse, that (being implementation-determined) it varies between environments in ... surprising ... ways. Like what happened to me back in '96, when all the compilers in the company compiled ==>> that function there the same way, until I tried to run the code on my team's hardware platform. The x86-32 Linux build (gcc 2.something, but before the gcc/egcs split) for the simulator worked fine, but the specialist gcc (also 2.something, 2.5.8, I think) for our R4600 MIPS-based hardware did something ... different.

  • (nodebb)

    In Objective-C, it is legal to send a message to nil (the equivalent of Java's null), thus the Objective-C equivalent

    [nil isAll];
    

    is perfectly legal and messages sent to nil are defined to return 0, which Objective-C will interpret as false, so this is legal and functional

    if ([thingThatMightBeNil isAll])
    {
        // Do stuff
    }
    else 
    {
        // handle nil case
    }
    

    Of course, you could just write

    if (thingThatMightBeNil != nil)
    {
        // Do stuff
    }
    else 
    {
        // handle nil case
    }
    

    which many people would argue is quite a bit better.

    Addendum 2023-10-26 09:53: Regarding isAll I wonder if somebody was trying to write an isNotNull function and settled on isAll as being the opposite of isNull.

  • Thom (unregistered)
    Comment held for moderation.

Leave a comment on “It's All Right”

Log In or post as a guest

Replying to comment #:

« Return to Article