Glucosio / glucosio-android

Glucosio Android App
GNU General Public License v3.0
338 stars 162 forks source link

Developers checkstyle / codestyle #301

Open alxsimo opened 8 years ago

alxsimo commented 8 years ago

Expected behaviour

Use a predefined checkstyle for the code. No complicated stuff, we can just stick with Square's checkstyle.

Also travis build should have a check for the codestyle.

Actual behaviour

Variables names starting with m prefix, the code doesn't seems to follow any codestyle

emartynov commented 8 years ago

I would say it is out of our radar. We use default java code style.

As for now, I don't see much value in codestyle. What do you think?

JoaquimLey commented 8 years ago

Codestyle is actually good for readability, it helps projects to maintain some sort of standard, @alexsimo regarding the m prefix a lot (not Square, because Jake is against it) of devs use it (me included), due to Android codestyle for private variables.

alxsimo commented 8 years ago

@JoaquimLey yep, i know the reason for the m prefix. The android codestyle follows it, but it's for contributing to the Android project, but don't worry, i will close eyes when seeking m prefixed variables 😄

emartynov commented 8 years ago

Codestyle is actually good for readability, it helps projects to maintain some sort of standard

Questions:

  1. Has our code bad readability now?
  2. What kind of standard Glucosio is missing?

As for me having less massive classes and more tests have more priority than having codestyle.

alxsimo commented 8 years ago
  1. Not bad, could be better but not bad. It just misses a codestyle
  2. Inner fragment classes for example

As for me having less massive classes and more tests have more priority than having codestyle.

Yep, are parallel tasks, writing tests has nothing to do with having a codestyle :)

JoaquimLey commented 8 years ago
  1. Has our code bad readability now?

Yes it has, but not necessarily due to codestyle (or lack of), but rather spaghettish code and lack of architecture, tightly coupled.

  1. What kind of standard Glucosio is missing?

Besides 1. not even ⌘+L & ⌘+⌥+O regarding codestyle why not Google's Code Style for Contributors

As for me having less massive classes and more tests have more priority than having codestyle.

Just like @alexsimo said, this should be done at the same time, regarding architecture it will be a (way) longer task, and will demand more planning, it'll help with scalability IMO.

ghost commented 8 years ago

I'm not a Java Dev but I like the practice of following a coding style as it reduces the risk of introducing bugs and makes things a bit more uniform. That said lets get feedback from @PaoloRotolo since he is our Android Product Owner.

raacker commented 8 years ago

In my opinion, there are several codes that didn't follow general Java coding styles like underscore in method name, Uppercase at the start of method... something like that! also you can find it in codacy

https://www.codacy.com/app/Glucosio/glucosio-android/dashboard

I think this issue should be kept with Wiki tab.

and If I may, can I solve these problems with coding conventions? If it doesn't annoying you guys :)