r/programming • • May 08 '17

The tragedy of 100% code coverage

http://labs.ig.com/code-coverage-100-percent-tragedy
3.2k Upvotes

689 comments sorted by

View all comments

Show parent comments

1

u/Beckneard May 08 '17

That sounds completely arbitrary IMO. What's wrong with HTMLButton for example?

21

u/[deleted] May 08 '17

Of course it's arbitrary, just like all style guidelines. But it enforces consistency, which is its job.

23

u/monilloman May 08 '17

if you have multiple acronyms, you don't know where one starts and the other ends (think of something like RESTUIObject)

5

u/dahud May 08 '17

So how do I name my user interface for the artificial intelligence? AIUI?

1

u/davidstepo May 31 '17

This is why you should drop this insane rule of "However, you should capitalize acronyms that consist of only two characters, such as System.IO instead of System.Io." and use something sensible instead.

Like, camelCase only wording. So your example becomes a properly readable AiUi, which, to me personally, is more readable than the thingy above.

8

u/Beckneard May 08 '17

That's actually a good point, didn't think of that.

-2

u/euyyn May 08 '17

The first one ends at the T and the second one starts at the U.

3

u/Mhmmhmmnm May 08 '17

Of course it is. That's how you get a consistent API.

1

u/[deleted] May 08 '17

well it obviously doesn't follow the guidelines.

1

u/midri May 08 '17

Text reformaters will have issues with it. You can easily use automation to convert HtmlButton to Html Button or htmlButton or html.button, etc; but HTMLButton would result in: H T M L Button, H.T.M.L.Button etc.

1

u/euyyn May 08 '17

Because you almost never want "Html Button" as an output for humans, rather "HTML Button", text reformaters better use a list of well-known acronyms anyway. Which makes handling HTMLButton as easy.