ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

Main Area and Open Discussion > Living Room

Doom 3 Source Code - The neatest code I've ever seen

<< < (2/2)

f0dder:
Renegade: "verbSomething" isn't necessarily always the best, though, and especially not in the case of getters...

if( getOptionEnabled() ) versus if( isOptionEnabled() ) versus if( optionIsEnabled() ) :)

IMHO option #3 quite clearly reads best, but #2 is probably the pragmatic solution wrt. IntelliSense support.

Renegade:
^^ I like your #2 there. Having the verb in front (most often) let's you skip remembering and lets the code completion kick in. For boolean values, "is" creates an additional level of clarity as it set up a yes/no question, which makes it far better than "get".

Navigation

[0] Message Index

[*] Previous page

Go to full version