Hello!
I want to know about the rules of naming fields in the "Android". I read the article Code Style Guidelines for Contributors . He stopped at the naming of fields, decided to move away from the usual ways to write code in the project on the "guideline". I can not get used. The code has become less readable, annoying prefixes to variable names, the lack of this in constructors.
How justified is the use of this agreement?
When the development environment itself helps to understand what we see?
Would not it be considered that the code written ignoring this standard is not of high quality?
// Этот класс взят из вышеупомянутой статьи public class MyClass { public static final int SOME_CONSTANT = 42; public int publicField; private static MyClass sSingleton; int mPackagePrivate; private int mPrivate; protected int mProtected; } The constructor now looks like this:
class MyClass(Context context, TextView textView){ mContext = context; mTextView = textView; } instead
class MyClass(Context context, TextView textView){ this.context = context; // глазам приятно видеть this this.textView = textView; } The code is cumbersome:
private TextView mTextView; mTextView = mRootView.findViewById(R.id.tv_new_text_view); Instead:
private TextView textView; textView = rootView.findViewById(R.id.tv_new_text_view); Do you use this agreement in your projects?
How do they treat or ignore this agreement in large companies?
How does “google” refer to ignoring this convention?