kaushikgopal / RxJava-Android-Samples

Learning RxJava for Android by example

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Member variables should follow the `mVariableName` naming standard

erawhctim opened this issue · comments

... instead of using _variableName.

I'm sure a simple script could be written to change them all automatically.

I would not go with any of them, it is not necessary if you can write your code in readable English, which is gonna be let by a any IDE with decent syntax highlighting. Also the IDE, will tell you what's a member variable and what it is not.

so i really don't like the hungarian notation (i.e. prefixing with mVariableName). I strongly believe it makes code less readable.

my prefixing with _ has been pointed out as being weird more than once, so i hear ya :). it definitely makes it less readable than not having it at all, but here's my rationale:

  1. i need to be able to immediately identify private variables and methods cause i want to lock down on m apis as much as possible. having the _ prefix is the least intrusive way of doing this imo.
  2. a better solution would be to have the IDE style my public/private members differently (slap on a different color or italicized etc.), but that is currently not possible with IntelliJ's code styles. when that does happen, i will happily remove the _ prefixes.

closing this issue. feel free to re-open if you strongly feel otherwise.