3 ms·
It’s the opposite of noise by making the logic more precise. Suppose you have unwrapped optionals or result types, or need to specifically handle a null type di
by fingerlocks 6y ago
It’s the opposite of noise by making the logic more precise. Suppose you have unwrapped optionals or result types, or need to specifically handle a null type differently from a false. It’s also helpful when refactoring changes a function signature.
Are you young or early in your career? I think the extra verbosity is something you come to appreciate the “the hard way” over the years.
- gnusty_gnurc 6y ago> It’s the opposite of noise by making the logic more precise There's cases where this might make sense (when things like truthiness are unclear). But in any of the cases I've seen, it's where things are pretty obvious and even when things are explicitly boolean types. Write the boolean expression and if it doesn't fit or has lots of parts, define them separately above the conditional with clear names. People seem upset by this, but idk it seems like common sense. I'm not sure I understand how `if (someCondition == true) {...}` is preferable to `if (someCondition) {...}`
- ubercow13 6y agoIt's such an irrelevant surface-level thing to judge someone's intelligence and coding ability on. Just because they wrote that doesn't mean they don't understand that it could be simplified or that they aren't capable of handling much more complex boolean logic. Sometimes I write things like that just because I am typing my thoughts into code as they come to me, and that's just how I happened to vocalise it in my head.
- gnusty_gnurc 6y agoThis is usually in context of massive classes and functions that are regularly 100+ lines. It’s not organized or thoughtful and an absolute pain to work with. Idk this is just my experience with disorganized code and unclear.
- RandoHolmes 6y ago> People seem upset by this No one is upset, they simply disagree with you... Maybe avoid trying to dismiss people and look at what they're actually saying? There are things you put in code that others are unfairly judging you for. something something glass houses.