Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [che-dev] Che developers formatting rules for Java



Gennady Azarenkov - @ codenvy.com


On Wed, Mar 29, 2017 at 4:24 PM, Sun Tan <sutan@xxxxxxxxxx> wrote:
But (unfortunately :)) we can not require every one to use exclusively Che IDE neither are able to provide formatters to all existed code editors/tools.

We can at least require every che committers to use most of the time Eclipse Che IDE. If we can not do it, how can we convince other developers to use Che ?

Yes of course! but it is a little bit diff topic ;)
 

 
Hi Thomas,

There are no doubts about default formatting in our IDE which is naturally valid for Che's code. We actually have it (so far non-configurable).
But (unfortunately :)) we can not require every one to use exclusively Che IDE neither are able to provide formatters to all existed code editors/tools.

That's why I think we need reasonable small list of "must have" formatting rules (good enough to most of us) and implementable by any tool relatively easy. 

Gennady Azarenkov - @ codenvy.com


On Wed, Mar 29, 2017 at 3:37 PM, Thomas Mäder <tmader@xxxxxxxxxx> wrote:

Hi folks,

Ah...the beast of the programming apocalypse rears is its ugly head: code formatting discussions. The end must be nigh! In my many travels, I have learned that life is too short to format code by hand. From this spring two options I find acceptable:

1. Format automatically upon save, check-in, whatever. Nobody gets to do their own formatting.

2. Give me a format command in the IDE. Everyone is free to use the formatting command on everyone elses code.

I really don't give a hoot what code formatting rules we use as long as they are automatic. I would even argue that we DON'T make up our own rules. Just use someone preexisting set. JDK, Eclipse, whatever. Just don't make me work on formatting files.

/Thomas

PS: Repent! Repent!
PPS: Except opening braces on a new line. That's just horrible ;-)


On 29.03.2017 10:51, Sun Tan wrote:
I'd like to come up with some discussion we hard during reviews: https://github.com/eclipse/che/pull/4556/files/ba9e3984575c49f8f39a56db1df2e07b53786b3e#diff-ab312e4ea4cd0eee68fe53472bab93e1 

1. What tool to use to format code in Java ?
2. Usage of // to force Carriage return in some case

# 1. Some are using Intellij, the others Eclipse IDE and some others are using Eclipse Che as IDE.
For me, it makes sense to have a common formatter tool whatever the IDE we are using. It may also work from the command line and should be opensource. It should be possible to format part of the file. It should support Java files at least.
At the moment I use Che to code on Che so if someone has a formatter tool that meets all the previous requirements, I can take it ... otherwise if there isn't such a tool we should all use Che formatter to format our code :)

# 2. Usage of // to force Carriage return in some case
I had some questions about trailling // that I use to force cariage return when the formatter doesn't want to. The purpose is to avoid someone else that run a formatter to loose the carriage return that was there originally. I think this is the choice of the developer to make the code easier to read and to choose wether a line of code should be break into 2 line of code or not. Pretty much like when we add \ at the end of a bash script or Dockerfile.

--
Sun Tan
Senior Software Engineer
Eclipse Che @ Red Hat


_______________________________________________
che-dev mailing list
che-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/che-dev


_______________________________________________
che-dev mailing list
che-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/che-dev


_______________________________________________
che-dev mailing list
che-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/che-dev
--
Sun Tan
Senior Software Engineer
Eclipse Che @ Red Hat

_______________________________________________
che-dev mailing list
che-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/che-dev



Back to the top