Reputation: 9764
So, I'm not a huge fan of Hungarian Notation. Today an Android Developer from my company dropped this link to the official advices re Android development, and I was surprised by the fact, that they find it useful to start all field names with m
.
I think, the only case where these mSomeField
names may be useful is an absence of code highlighting, in this case it's easier to see which variables are local, and which of them are not. But these days any IDE can show this, right? So, why are these rules and conventions needed in up-to-date Android code?
UPDATE: Okay, my bad, looks like these advices are for contributors (in this case it makes sense, they want to keep the same way of coding). Anyways, I was told, that this is often used in Android projects. If so, the question is about those projects.
Upvotes: 4
Views: 1615
Reputation: 6858
You would have to ask the original developers who set the standard for the project. :) This is purely speculation on my part but when you consider that Android is built on Linux and has quite a bit of C/C++ code in it, I assume that the choice to use Hungarian notation is just old-school C++ influence creeping into the Java side of the codebase. It's unfortunate in the modern world of IDE's and the need for it is a bit of a "code smell" in my opinion.
Upvotes: 1