Comment on ChatGPT advises women to ask for lower salaries, study finds

<- View Parent
BassTurd@lemmy.world ⁨1⁩ ⁨week⁩ ago

Code readability is important, but in this case I find it less. In every language I’ve studied, it’s always taught to imply the previous condition, and often times I hear or read that explicitly stated. When someone writes code that does things differently than the expectation, it can make it more confusing to read. It took me longer to interpret what was happening because what is written breaks from the norm.

Past readability, this code is now more difficult to maintain. If you want to change one of the dates ranges, the code has to be updated in two places rather than one. The changes are difficult, but it would be easy to miss since this isn’t how elif should be written.

Lastly, this block of code is now half as efficient. It takes twice as many compares to evaluate the condition. This isn’t a complicated block of code, so it’s negligible, but if this same practice were used in something like a game engine where that block loops continuously, the small inefficiencies can compound

source
Sort:hotnewtop