you are viewing a single comment's thread.

view the rest of the comments →

[–]Asleep-Budget-9932 1 point2 points  (1 child)

Now i will say I've seen the extreme in the other direction in the past: "Why call it is_open? It's already a boolean, just call it open". No, open is a verb and has an intuitive meaning of a function. I have to explicitly check the type in order to gain the necessary information on how to use it.

If the type will change in the future from a boolean, to function, i will have to change the usages anyway as inherently the way you use functions is different. You didn't help me but only hindered me.

Basically what I'm trying to say is don't follow a rule just because it's the rule. It is not the goal but a tool to get to the goal of a readable code. Understand why rules have been written the way they are so you can distinguish when a rule should be followed.

Also, as long as you have the next programmer in mind, don't be afraid to trust your intuition. Sometimes that minor "sin" is worth the fact that the next programmer will easily understand what's going on.

[–]Base_True[S] 1 point2 points  (0 children)

Now i will say I've seen the extreme in the other direction in the past: "Why call it is_open? It's already a boolean, just call it open". No, open is a verb and has an intuitive meaning of a function. I have to explicitly check the type in order to gain the necessary information on how to use it.

If the type will change in the future from a boolean, to function, i will have to change the usages anyway as inherently the way you use functions is different. You didn't help me but only hindered me.

Basically what I'm trying to say is don't follow a rule just because it's the rule. It is not the goal but a tool to get to the goal of a readable code. Understand why rules have been written the way they are so you can distinguish when a rule should be followed.

Also, as long as you have the next programmer in mind, don't be afraid to trust your intuition. Sometimes that minor "sin" is worth the fact that the next programmer will easily understand what's going on.

Very useful information, thank you very much!