Page 2 of 2

Re: New CEGUI library maximum column length

Posted: Sat Nov 14, 2015 21:15
by Ident
Ok I really really really can't deal with 80, I have tried it for a while now and it forces to make new lines on the most simple lines (Initialisations) that cannot be simplified any further and where reducing the indent by refactoring the inside (e.g. of an if conditional) into an extra-function also makes no sense. Breaking them into two lines makes such lines utterly annoying to read and it happens regularly. This clearly is not supporting readability, I'd say.

100 seems very well doable on the other hand, although it will still force me to make some of my code shorter but at least the simple lines rarely exceed the limit. I am reincarnated as a serious supporter of 100 :pint:

I think the only way we can solve this is by having me and Paul fight to death: https://www.youtube.com/watch?v=AphxyjrH4SE
Winner can decide about the limit or can be challenged by another team member.

Re: New CEGUI library maximum column length

Posted: Sat Nov 14, 2015 21:19
by YaronCT
:rofl:

Shall we make it 100 then?

Re: New CEGUI library maximum column length

Posted: Sat Nov 14, 2015 21:23
by Ident
Martin and Timotei: gather the ritual goats, light the vulcano and put a wood log over its ends, we need everything prepared for the CEGUI ritual fight

Re: New CEGUI library maximum column length

Posted: Wed Nov 18, 2015 19:55
by timotei
I think you have to hold your argument with some example code :P

But, I'm still more on the idea of: try to keep 80 as much as possible :D

Re: New CEGUI library maximum column length

Posted: Wed Nov 25, 2015 11:26
by YaronCT
timotei (and others): Consider the following simple piece of code that I've just pushed:

Code: Select all

    unsigned int glyph_bitmap_height =
      static_cast<unsigned int>(glyph_bitmap->rows);


Seriously, now, is there any reason in the world to split the lines, rather than simply:

Code: Select all

    unsigned int glyph_bitmap_height = static_cast<unsigned int>(glyph_bitmap->rows);


?

Re: New CEGUI library maximum column length

Posted: Wed Nov 25, 2015 17:01
by timotei
Well, that's why I see the 80/X limit as a guidelines rather than 100% enforced thing. Sometimes it makes sense and it's fine to cross the limit.

Re: New CEGUI library maximum column length

Posted: Wed Nov 25, 2015 17:19
by YaronCT
Ok, so I suggest, as a compromise, the following: Make 80 characters a "general rule", and make 120 characters a "hard limit". This can b formulated as:

Code in general should be no more than 80 characters long per line. Long lines are more difficult to read and may lead to general bad programming practice. However there are cases when lines longer than 80 characters are appropriate, and in such cases it's allowed. However, no code line, ever, should be longer than 120 characters. Comments in code should be split to lines at 120-character boundary.

What do u think?

Re: New CEGUI library maximum column length

Posted: Wed Nov 25, 2015 18:21
by Ident
Now I wished that visual studio allowed to show two lines instead of just one for the max column length - if that was possible then I could program in peace and follow this rule :)
Btw. I think the 80 target, 120 max rule is a good rule

Re: New CEGUI library maximum column length

Posted: Wed Nov 25, 2015 18:25
by timotei
There is: https://visualstudiogallery.msdn.micros ... 0980e72c30

You add a guide at 80 and one at 120.

Re: New CEGUI library maximum column length

Posted: Wed Nov 25, 2015 18:30
by Ident
timotei wrote:There is: https://visualstudiogallery.msdn.micros ... 0980e72c30

You add a guide at 80 and one at 120.

I want cuhlurrrss. Otherwise this is exactly what I want though.

What do Paul and Martin think of the soft limit at 80 and the hard one at 120?