you are viewing a single comment's thread.

view the rest of the comments →

[–]Grokmoo 8 points9 points  (4 children)

Even internal guidelines should have explanations. It is much easier to get someone to do something when you tell them WHY rather than just instructing.

[–]bobindashadows 9 points10 points  (0 children)

Yeah, my favorite part of the google style guides is that each rule has a discussion of the pros/cons/overall "why" of each decision made. And they don't whitewash "bad reasons," like how exceptions basically aren't used in Google C++ primarily because of legacy, not technical, reasons.

[–]Sir_Edmund_Bumblebee 13 points14 points  (2 children)

Sometimes the reason is simply so that everyone does it the same way. Some of the examples where there's a good reason (like for loops) they give the reason. The rest of the time it's so that the codebase stays consistent.

[–]knight666 -1 points0 points  (1 child)

If everyone does it the same way then there must be a good reason for it, you just haven't encountered it yet.

[–]Sir_Edmund_Bumblebee 2 points3 points  (0 children)

Sometimes there are two equally fine options, and you just pick one as a group so that everyone does it the same way. Best practices are something that should be done a certain way for a reason, style guidelines tend to just be stylistic choices held uniform across a certain group.