kodecocodes / java-style-guide Goto Github PK
View Code? Open in Web Editor NEWThe official Java style guide for raywenderlich.com
The official Java style guide for raywenderlich.com
I think it would be wise to discourage the use of Enums in Android in preference to Static Constants. The reasoning for this is because Google recommend using static constants instead of Enums in Android due to the increased memory they require.
http://developer.android.com/training/articles/memory.html#Overhead
The Android style guide recommends using m
and s
prefixes for member fields and static fields respectively.
This is of questionable use, and a lot of the wider Java community has decided to drop this convention, since IDEs will inform you of this kind of thing.
What should we do?
Pretty sure this is a standard Java rule. Do we have an opinion?
Even if a field is final?
Because XML is arguably just as important as Java on the Android system, I propose that we come up with some sort of convention that also falls in line with the guides governing attributes of conciseness, readability and simplicity.
What I'm suggesting is based on a general look at how XML is declared for standard components/suggested names in Android Studio and looking at other similar guides on GitHub
Indentation for elements should be kept to 2 characters
Unless there is good reason to deviate. All styling for your view components in your app should be done in the styles.xml file to keep style elements in one place.
Again unless there is good reason to deviate we should keep any strings in the app in strings.xml for quick availability.
Mostly likely other things and I hope others chime in.
There is a section in the guide regarding the copyright header. Is this appropriate to have in there?
I think we should recommend explicitly stating the access level modifier of a member variable (private, protected, public). This will make sure there is no ambiguity to access modifiers for variables and reduce the chance accidentally omitting access levels.
It would be great if there were an installation files for Eclipse as well.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.