I am ok with removing the field alignment setting.
For me the final declaration of params has some value until Java is changed to use final as the default for params. I have actually seen a lot of places where people assigned other values to params (most of the times with no bad side effects, though) so
FMPOV we should keep them.
Other opinions from committers/contributors?
Mit freundlichen Grüßen / Best regards
Kai Hudalla
Chief Software Architect
Bosch Software Innovations GmbH
Schöneberger Ufer 89-91
10785 Berlin
GERMANY
www.bosch-si.com
Registered office: Berlin, Register court: Amtsgericht Charlottenburg, HRB 148411 B;
Executives: Dr.-Ing. Rainer Kallenbach, Michael Hahn
From: hono-dev-bounces@xxxxxxxxxxx <hono-dev-bounces@xxxxxxxxxxx> on behalf of Lohmann Carsten (INST/ECS4) <Carsten.Lohmann@xxxxxxxxxxxx>
Sent: Thursday, March 30, 2017 14:25
To: hono developer discussions
Subject: Re: [hono-dev] Code style - alignment of fields
If there are no strong opinions on this, I would suggest disabling the field alignment setting.
The current Hono code is not consistently having such an aligned formatting and imho the majority of open source projects doesn't use this. At least I have rarely seen it. And having to change the alignment of all fields (in a group) when adding a new field
doesn't sound good.
One other thing that I found distracting was the convention to use "final" for method parameters.
As I've come to learn from "Clean code" literature, method parameters are to be treated as implicitly final anyway, and the IDE will give me a warning if I assign a value to it. In that respect, adding "final" just adds unnecessary noise. A similar opinion
can be seen in [1].
(Of course I don't mean cases here where omitting the "final" would cause compilation errors.)
What is your take on this? Can we get away from advocating/requiring usage of "final" for all method params?
Carsten
[1]
http://www.adam-bien.com/roller/abien/entry/final_method_parameters_should_generate
Von: hono-dev-bounces@xxxxxxxxxxx <hono-dev-bounces@xxxxxxxxxxx> im Auftrag von Kai <sophokles.kh@xxxxxxxxx>
Gesendet: Dienstag, 14. März 2017 07:51
An: hono developer discussions
Betreff: Re: [hono-dev] Code style - alignment of fields
Thanks for your input and ideas, guys. So far, we haven't put a lot of effort in enforcing compliance with formatting rules. The most important ones seem to be evident from the code itself and most of the more specific ones I have to admit I personally
do not care very much about, e.g. I can live with both indentation styles regarding field declarations.
If the lack of rigidness in this area is making it hard for people to contribute, then IMHO we need to improve on it.
Other opinions?
Kai
Hi,
to me it always was kind of error prone to depend on IDE settings to get a consistent formatting for a project.
Would it may be an idea to introduce some maven based approach to enforce styling e.g. checkstyle. This also could be used to enforce
the eclipse settings. In addition it would address the issue of already nonstandard formatted code in the project and can be later used as build breaker.
Just an idea…
Greetings!
Bosch Software Innovations GmbH
Schöneberger Ufer 89-91
10785 Berlin
GERMANY
Hi,
when formatting the code using the checked-in eclipse code style settings, the alignment of fields looks odd;
e.g. VertxBasedRestProtocolAdapter:
private HttpServer server;
private HonoClient hono;
private HonoConfigProperties config;
private BiConsumer<String, Handler<AsyncResult<MessageSender>>> eventSenderSupplier;
private BiConsumer<String, Handler<AsyncResult<MessageSender>>> telemetrySenderSupplier;
With the additional eclipse formatter setting "Blank lines separating independent groups: 1", it would look better:
private HttpServer server;
private HonoClient hono;
private HonoConfigProperties config;
private BiConsumer<String, Handler<AsyncResult<MessageSender>>> eventSenderSupplier;
private BiConsumer<String, Handler<AsyncResult<MessageSender>>> telemetrySenderSupplier;
Or can the field alignment setting be disabled altogether?
Many classes are currently not formatted according to this setting anyway (also
VertxBasedRestProtocolAdapter).
--
Best regards
Carsten Lohmann
Bosch Software Innovations GmbH
Schöneberger Ufer 89-91
10785 Berlin
GERMANY
_______________________________________________
hono-dev mailing list
hono-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/hono-dev
|