Do I need to prefix function names that return a boolean with b?

Idk man this just seems like circular logic.

How do we know it’s a bool? It should be well named, ie, “isFinished, hasCompleted” and syntax highlighting plus mouse hover to see the type, I just don’t see the point of this, especially only for booleans? Why? What makes bools so special that they are the only type that needs this.

Besides, if you have a type bCar, sure I know its a bool (my IDE also helps me realize this) but I don’t know what it means. So it should be renamed to bHasCar, now I know what it actually means in context of the program, but now the b is redundant. its not giving anyone anymore information that hasCar already gives.

The only reason is that its convention, but its a silly convention. And if people get confused and don’t know what variable type hasCar is and don’t know how to use their IDE to figure it out, that’s their problem. It’s also not my problem if they choose to not use an IDE like some programmers do.

1 Like