[eclipse-arduino-dev] Re: formatting

  • From: Jan Baeyens <jan@xxxxxxxxxx>
  • To: eclipse-arduino-dev@xxxxxxxxxxxxx
  • Date: Sat, 7 May 2016 11:47:18 +0200

*... and since I haven't been kicked in the butt yet....*

Well ... I noticed some pull requests with lots of formatting changes from you. I planned to check your next pull request closer before kicking your but :-)))

*tabs versus spaces*

me-no-dev complains about the space tab problem as well. I see the java default is mixed. Which means if 1 person sets it to tabs or spaces that should be fixed.

I'm quite willing to do so but than we have to agree on tabs or spaces. I have no preference.

But maybe we should wait for this until sonar is done.

*Line length*

According to the links Wim send 80 seems to be a human limit. This is the reason why so many web sites only use half of your screen :-(

I am not aware I have this limitation, ..... but if others do, I'll comply.

IMHO a format before checkin and and checkout would be perfect. Everyone could open in its format just like the version control tool.

*modified versus file*

Eclipse allows for formatting at safe time. Which I use. It also allows for "format all lines" or "format edited lines". I currently use format all lines. But I am open to arguments to switch.


ready to kick your but ;-)

Jantje


Op 7/05/2016 om 1:11 schreef Roberto Lo Giacco:

My personal preference is 120 or 160 before word wrapping occurs. I agree 80 is quite old style and was due the 80 columns screens which are long gone today.

With regards to tabs and similar formatting things I've found quite a lot of troubles with Jan's code, but I'm not sure it is actually Jan creating the issue... It's weird because most of the files I open seem not formatted with tabs, but with a mix of spaces and tabs...

Anyway, whenever I encounter these troubles I simply apply the standard formatting rules... and since I haven't been kicked in the butt yet....


:-)

Roberto

On Sat, May 7, 2016 at 12:30 AM, Jan Baeyens <jan@xxxxxxxxxx <mailto:jan@xxxxxxxxxx>> wrote:

    Ok

    I give in.


    Op 6/05/2016 om 23:11 schreef Wim Jongman:
    I think it is bad because:

    When you want to read comments you don't want the line to be too
    long. 200 is too long. [1]

    With short lines we can hold two editors side by side.

    Also why would you want to have a code line that is over 200? In
    these cases it is code style rather than line length.

    IMHO shorter is the way to go. Not longer. Same for methods. See
    also [2]



    [1]
    
https://www.smashingmagazine.com/2014/09/balancing-line-length-font-size-responsive-web-design/

    [2]
    
http://programmers.stackexchange.com/questions/133404/what-is-the-ideal-length-of-a-method-for-you


    On Fri, May 6, 2016 at 9:50 PM, Jan Baeyens <jan@xxxxxxxxxx
    <mailto:jan@xxxxxxxxxx>> wrote:

        255 may be a bit too long but 80 for comments is way to small.

        I understand your multiple project setup problem. You don't
        want a workspace per project. However eclipse does support
        specific settings per project.

        And only changing the linelength to (lets say) 200 for code
        and comments is not that bad, is it?


        Op 6/05/2016 om 20:49 schreef Wim Jongman:
        It all depends where you are working. I work on a macbook
        pro with a 1440 resolution. 255 line length is too long in
        that environment.

        Changing the defaults will cause many problems with
        formatting again unless you setup up formatting on a per
        project basis and check in these settings per project. This
        is hard to maintain.

        Cheers,

        Wim


        On Fri, May 6, 2016 at 8:35 PM, Jan Baeyens <jan@xxxxxxxxxx
        <mailto:jan@xxxxxxxxxx>> wrote:

            Seemed I made a mistake.

            Brings me to a remark.

            I changed line length for comments and code to 255 in
            the formatter.

            120 and 80 is way to little.



            Op 6/05/2016 om 20:24 schreef Jan Baeyens:

                Hi

                I'm all confused here and I need some help to get my
                head around it.

                I want to check in Const.java and I see nearly all
                lines will be replaced.

                This because my local version uses tabs where the
                head seems to use spaces.

                I checked my settings and I use java
                conventions[build in] and I have been as far as I
                can recall.

                The latest checkin was done by me and I have format
                on safe (full file) on :-s

                Can this be explained?

                <a
                
href="https://www.freelists.org/list/eclipse-arduino-dev>eclipse-arduino-dev@xxxxxxxxxxxxx
                <mailto:eclipse-arduino-dev@xxxxxxxxxxxxx></a>



            <a
            
href="https://www.freelists.org/list/eclipse-arduino-dev>eclipse-arduino-dev@xxxxxxxxxxxxx
            <mailto:eclipse-arduino-dev@xxxxxxxxxxxxx></a>







Other related posts: