glucosio-android icon indicating copy to clipboard operation
glucosio-android copied to clipboard

Developers checkstyle / codestyle

Open alxsimo opened this issue 8 years ago • 8 comments

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

alxsimo avatar Sep 23 '16 16:09 alxsimo

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?

emartynov avatar Sep 23 '16 16:09 emartynov

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.

JoaquimLey avatar Sep 23 '16 16:09 JoaquimLey

@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 😄

alxsimo avatar Sep 23 '16 16:09 alxsimo

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.

emartynov avatar Sep 23 '16 16:09 emartynov

  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 :)

alxsimo avatar Sep 23 '16 16:09 alxsimo

  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.

JoaquimLey avatar Sep 23 '16 17:09 JoaquimLey

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.

bkerensa avatar Sep 24 '16 07:09 bkerensa

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 :)

raacker avatar Oct 15 '16 07:10 raacker