• Swamp Thang (unregistered)

    public static bool IsCommentLess([CanBeNull] string userComment) { return userComment == "Frist"; }

  • Rob (unregistered)

    Remove the R from "userless" and you have a pleonasm.

  • Mike5 (unregistered)

    It's almost like "Representative line"...

  • Prime Mover (unregistered)

    Aha, so TRWTF is using an IDE that makes you scroll through several hundred lines of code because it doesn't give you the capability of doing a global search for UserLess?

  • (nodebb)

    I deal with non-programmers who still like to read through the delivered source code for my project. If this sort of thing makes it more accessible for them I see no problem. It is basically using the variable names as the comments instead of comment lines.

  • Jonathan (unregistered)

    People complain that programmers use NULL values to represent too many different things. This code documents how they intend to use it, and provides a uniform wrapper/facade for it.

    If you had found a bare if user == NULL deep in the code, people would be complaining "Well, what NULL mean for the user field?". This is the least WTF-y WTF I have ever read here

  • (nodebb) in reply to Prime Mover

    Not sure what they use, but VS has had "go to definition" forever. Perhaps they use VIM or whatever

  • WTFGuy (unregistered)
    Comment held for moderation.
  • Randal L. Schwartz (google) in reply to Prime Mover

    Aha, so TRWTF is using an IDE that makes you scroll through several hundred lines of code because it doesn't give you the capability of doing a global search for UserLess?

    Or a direct "find all/goto references"?

  • (nodebb) in reply to Mr. TA

    vim with ctags will happily go to the definition/declaration as needed :)

  • Fergus Brainstorm (unregistered) in reply to Rob

    Replace the capital L with a lowercase one and you'll have one less aneurysm.

  • (nodebb) in reply to Fergus Brainstorm

    Remove the R from "userless", move the L from "userless" to the beginning of "user", and you'll have more cynicism.

    Addendum 2023-02-15 18:41: Poetic license required

  • xtal256 (unregistered) in reply to Mr. TA

    Or worse, VSCode :shudders:

  • DeeKay (unregistered) in reply to Rob
    Comment held for moderation.
  • Kleyguerth (github) in reply to Jonathan

    Same thing I thought, those constants and functions are "translating" business logic into programming logic. Way better than seeing null and empty being assigned to user without a clue as to what each case means.

  • Anon. E. Mouse (unregistered)

    This is good practice - no a WTF.

  • simonced (unregistered)
    Comment held for moderation.
  • (nodebb)
    Comment held for moderation.
  • David Mårtensson (unregistered)
    Comment held for moderation.
  • Gnasher729 (unregistered)

    The constants are just part of an implementation detail. A part. The two methods that actually supply the wanted information have to know both the constant and how to use it, so the constants are indeed useless.

  • owlstead (unregistered)

    Having a file with several hundreds of lines of code can be a bigger CodeSOD than the actual constants. That said, I'm rather curious what an "empty user" is supposed to be. No user - as in, not logged in - seems fine although I'd rather go for ANONYMOUS = null in that case?

  • Bob (unregistered)

    How does C# handle "equals" vs "==" for strings ? In java there could be a difference, == would only return true if referring to same object

Leave a comment on “Userless User”

Log In or post as a guest

Replying to comment #:

« Return to Article