I usually prefer adopting Java's official guidelines, but as Jan said,
for an Android project it makes sense to adopt Android's guidelines,
especially since they seem reasonable.
However, I think we should not refuse contributions based on style.
Some people might be crazy coders who don't care about style, and
contribute excellent features. No problem, I can tidy up the code
while reviewing it, or anyone can do it.
I am a wikipedia addict, I could spend my life "wikifying" raw
articles created by newcomer geniuses, and enjoy it. Same for
AnkiDroid.
We can suggest the use of an Eclipse configuration file, but it must
not be another barrier for new developers.
Cheers!
Nicolas Raoul
> --
> You received this message because you are subscribed to the Google Groups "AnkiDroid" group.
> To post to this group, send an email to anki-a...@googlegroups.com.
> To unsubscribe from this group, send email to anki-android...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/anki-android?hl=en-GB.
>
>
99% of the time code needs to split up across lines because of
function arguments. And 99% of the time you are looking at the code
you don't care what the 7th argument is and the 1% of the time you do
you know to hit the little scroll button and view it.
Not really an IDE, but Vim. I'll see what I can do about a formatter.
By the way, I have no preference on style, but I strongly support
having some coding convention.
Yes, that would be nice!
> And regarding the formatter, I was thinking in deactivate the
> automatic wrapping of lines because I didn't like how some lines were
> broken and I think it is a call that is better leave to the
> programmer.
Indeed, I don't really like automatic line wrapping, for instance if
there are 4 similar lines, and one of them is 81 characters wide, it
makes more sense to not wrap it, but an automatic formatter would not
understand the aesthetic here.
Great work overall!
I guess you will put it somewhere online more visible than within a
ZIP archive? As a web page? Maybe as a wiki page, so that the
community can maintain it? (but that would require transforming the
formatting).
Once again, newcomers should not be afraid by the convention.
You can ignore all rules, contribute code that does not respect any
convention, and we will still be very thankful :-)
Hopefully, some Good Samaritan will come along from time to time and
reformat the unconventional pieces.
Actually, reformatting the code is quite easy and does not require a
deep understanding of the code.
Anyone willing to reformat the current code according to the convention?
That's a good way for a newcomer to have a first experience with
AnkiDroid's code :-)
Any volunteer?
Thanks a lot!
Nicolas
Download http://ankidroid.googlecode.com/files/AnkiDroid%20Formatter%2C%20Clean%20Up%20and%20Import%20Order.zip
Unzip it.
In Eclipse, Window→Preferences
Section Java→Code Style→Clean Up
Import, select ankidroid.cleanup.xml
Section Java→Code Style→Formatter
Import, select ankidroid.formatter.xml
Section Java→Organize Imports→Formatter
Import, select ankidroid.formatter.xml
Press OK.
Nicolas