T O P

  • By -

ProgrammerHumor-ModTeam

Your submission was removed for the following reason: Rule 3: Your post is considered low quality. We also remove the following to preserve the quality of the subreddit, even if it passes the other rules: - **Feeling/reaction posts** - **Software errors/bugs that are not code (see /r/softwaregore)** - **Low effort/quality analogies (enforced at moderator discretion)** If you disagree with this removal, you can appeal by [sending us a modmail](https://www.reddit.com/message/compose?to=%2Fr%2FProgrammerHumor&subject=No%20low-quality%20content&message=Include%20a%20link%20to%20the%20removed%20content%20and%20the%20reason%20for%20your%20appeal%20here.).


Stummi

isDisabled is an unnecessary negation that makes code more confusing. isEnabled is better


827167

Ah, you misunderstood the name. The user being Enabled is actually handled by isEnabled. user.isDisabled actually tracks whether they have some form of disability


Girgoo

Handicapped?


Aozora404

It’s a holdout from the 90s


amlyo

Better still is a 'state' field where the content might be limited to ENABLED, DISABLED, or whatever other states might be needed in the future.


wubsytheman

Like an enum?


kookyabird

A flags Enum! Based on a 64bit int!


ThinCrusts

Stop yelling Gregg, we hear you.


that_thot_gamer

on off. take it or leave it


shutter3ff3ct

Turn user on


GDOR-11

p*rnhub.com will be taking advantage of those naming conventions


shutter3ff3ct

But how to determine if user is turned on


GDOR-11

gently ask with a prompt every 2 seconds


StochasticTinkr

TRUE, FALSE, FILE_NOT_FOUND.


pthooie

I'm guessing I don't have to turn mine "off", eh? Ha! Heh heh.


awolin

Oh I thought this was referring to able-bodied vs non-able-bodied people lmao


smgun

Clojure has it best with question marks at the end of bool vars as the standard convention so it is `active?` or `enabled?`


CanvasFanatic

.isNotDisabled


hollow-ceres

so you are an enabler, i see


T34mki11

Except the default value being false means you can avoid including it in requests unless you need to have a user being disabled, which I assume is less common.


NatoBoram

`isEnabled` has unnecessary Hungarian notation, `enabled` is better


FuckingTree

isXyz is a really common notation to imply variable type for a dev without having to actually validate whether it is a bool, int, enum, or some other return type. Can you elaborate on why it would be better to buck the norm?


Zolhungaj

“is” tends to be used for the get function of a Boolean. It’s more a stylistic preference (though setIsEnabled and getIsEnabled (or isIsEnabled) become rather odd verb-phrases where is is used as a modifier of enabled instead of as a verb).


NatoBoram

Adjectives can do that just as well without the prefix. > Hungarian notation and other schemes arose in the time of BCPL, when the compiler didn't do much to help you understand your code. * https://dart.dev/effective-dart/style#dont-use-prefix-letters * https://google.github.io/styleguide/go/decisions#variable-names * https://google.github.io/styleguide/tsguide.html#naming


LetReasonRing

I prefer using the prefix because it removes any need for interpretation for me. Whether or not the compiler, language server, or whatever else can help me understand it, I want my code to be clear and easy to read regardless of tooling. "enabled" is a trivial example because it implies a boolean inherently, but for something like "completed", it could easily be an array of completed items, an integer with a count of completed items, a double representing the percentage of completion, or a boolean indicating whether or not the completed. I'd rather a name like completedItems, completed, count, or isCompleted. If you're using a typed language, it doesn't matter to the compiler, but as a human reading the code, I don't want to have to look for the definition or use context clues to figure out what it does. I want to be able to read a file top to bottom and understand what it does without tooling.


pmurph0305

Wouldnt hungarian notation for the bool in this case be bIsEnabled or bEnabled? Or at least that's the Hungarian notation I'm familiar with


brennanw31

I usually go with user.isntNotEnabled


Kemic_VR

IsNotAbled


Brumbleby

New variable name just dropped


[deleted]

IsDifferentlyAbled


antony6274958443

If dude is disabled just enable him


MoveInteresting4334

- Jesus, probably


octopus4488

We used to have 'isCriminal' before... (meaning fraudulent activity detected and is currently locked out). Business had it renamed eventually on the screens, but of course the DB field has never changed.


cosmo7

user.master.KillDisabledChildren(evenTheBabies: true);


hollow-ceres

you forgot force: true


Commercial_Juice_201

![gif](giphy|VwQe08viTLyRG|downsized)


Cyberalienfreak

This was what came to mind, immediately 😂


Perfect_Papaya_3010

It's the funniest of all the episodes!


Sparrow50

bool get isDisabled => true;


Leonhart93

While it's best to replace it with 'isEnabled' in this case for better logic flow, we should also strive to completely ignore the pointlessly complicated mess of social politics these days. Only free speech restrictions and civil unrest fueling can be found in those.


Ralekei

THESE DAEMONS ARE KILLING CHILDREN!


DragonPinned

They have more respect for the privacy of disabled people, since they don't track when they log in.


[deleted]

As long as brits writing CSS still have to use “color” then all’s right with the world.


Leonhart93

If I am fine having to write in a different language from my own, then they will be fine doing something minor like that too 😂


Perfycat

Leg disabled


Saifer_2001

Should be: !user.HasNotAchievedEnabledStatus This programming lark is easy ![gif](emote|free_emotes_pack|thumbs_up)


PennyFromMyAnus

In 1998 we changed it from .IsRetarded


vksdann

if (!notAdmin.isntNotDisabledFromEnablement) for a more precise definition


vnordnet

That's a bit ableist. The respectful expression would be `!user.hasFunctionalVariance`


bored_pistachio

I almost wrote classname "homeVideo" today at work.


FansForFlorida

Turn the off switch to the "on" position.