New CEGUI library maximum column length

Discussion regarding the development of CEGUI itself - as opposed to questions about CEGUI usage that should be in the help forums.

Moderators: CEGUI MVP, CEGUI Team

User avatar
Ident
CEGUI Team
Posts: 1998
Joined: Sat Oct 31, 2009 13:57
Location: Austria

Re: New CEGUI library maximum column length

Postby Ident » Sat Nov 14, 2015 21:15

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.
CrazyEddie: "I don't like GUIs"

YaronCT
CEGUI Team
Posts: 448
Joined: Fri Jun 19, 2015 12:18
Location: Kiryat-Bialik, Israel

Re: New CEGUI library maximum column length

Postby YaronCT » Sat Nov 14, 2015 21:19

:rofl:

Shall we make it 100 then?

User avatar
Ident
CEGUI Team
Posts: 1998
Joined: Sat Oct 31, 2009 13:57
Location: Austria

Re: New CEGUI library maximum column length

Postby Ident » Sat Nov 14, 2015 21:23

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
CrazyEddie: "I don't like GUIs"

timotei
Not too shy to talk
Not too shy to talk
Posts: 26
Joined: Mon Apr 29, 2013 14:17

Re: New CEGUI library maximum column length

Postby timotei » Wed Nov 18, 2015 19:55

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

YaronCT
CEGUI Team
Posts: 448
Joined: Fri Jun 19, 2015 12:18
Location: Kiryat-Bialik, Israel

Re: New CEGUI library maximum column length

Postby YaronCT » Wed Nov 25, 2015 11:26

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


?

timotei
Not too shy to talk
Not too shy to talk
Posts: 26
Joined: Mon Apr 29, 2013 14:17

Re: New CEGUI library maximum column length

Postby timotei » Wed Nov 25, 2015 17:01

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.

YaronCT
CEGUI Team
Posts: 448
Joined: Fri Jun 19, 2015 12:18
Location: Kiryat-Bialik, Israel

Re: New CEGUI library maximum column length

Postby YaronCT » Wed Nov 25, 2015 17:19

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?

User avatar
Ident
CEGUI Team
Posts: 1998
Joined: Sat Oct 31, 2009 13:57
Location: Austria

Re: New CEGUI library maximum column length

Postby Ident » Wed Nov 25, 2015 18:21

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
CrazyEddie: "I don't like GUIs"

timotei
Not too shy to talk
Not too shy to talk
Posts: 26
Joined: Mon Apr 29, 2013 14:17

Re: New CEGUI library maximum column length

Postby timotei » Wed Nov 25, 2015 18:25

There is: https://visualstudiogallery.msdn.micros ... 0980e72c30

You add a guide at 80 and one at 120.

User avatar
Ident
CEGUI Team
Posts: 1998
Joined: Sat Oct 31, 2009 13:57
Location: Austria

Re: New CEGUI library maximum column length

Postby Ident » Wed Nov 25, 2015 18:30

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?
CrazyEddie: "I don't like GUIs"


Return to “CEGUI Library Development Discussion”

Who is online

Users browsing this forum: No registered users and 5 guests