CrazyEddie wrote:And that leads to the second point, readability. I know you said that it's code and it doesn't need to read like a book. I disagree.
Optimal book line length is considered to be 50-60.
Code readability, I am all for it! But set 50-60 in your code editor and look at some of the more elaborate code parts in CEGUI. We would have to rnm all our clss to shrtr nms to be bl to pl ds ff. This will inevitably lead to code looking along the lines of
if it was enforced. Is this more readable? I say NO! That is what I meant with that we don't read code like a book. I would prefer to be able to read code always like a
story. This however requires meaningful names, which will normally quite often get long. I like to have long variable and function names but in my opinion this is impossible with a 80 char limit in most of the code.
I also believe it is impossible people to make people write thoughtful code simply by putting a char limit into place. In the worst case, it might even make it worse by inducing ridiculously shortened variable and function names. The only way to make em write nicely is by not letting them do otherwise, i.e. not merging any code that is not readable, and we do this pretty well. Also anybody who worked on old code they wrote should know how important it is to be readable, and this is something that just comes with experience. Last but not least it can help people to read the book Clean Code. But anyways, my point stands that a char limit simply won't help this specific cause.
That said, most of the time I think I could live with the limit set to 100 instead of 120. I tried to put the line to 100 in my editor and I feel like this is quite managable in regular cases. But then there is often lines like this:
Code: Select all
d_tagHandlers[VertAlignmentTagName] = &BasicRenderedStringParser::handleVertAlignment;
This has 4 space indent and there is only around 6 characters left to the 100 limit. Now I would argue this is unshortenable and perfectly readable code. Imagine this function had parameters on the right expression for the function. It would immediately exceed the 100. I would really hate to make an extra line after the "=" because that just seems ridiculous to me. Because of these cases I am still in favour of the 120
Long live long variable and function names!
yaronct wrote: don't wish to inflame a political argument, but being a liberal I don't like it when I'm forced to do something which isn't necessary to force
There is many types of liberals and they follow mostly strictly opposing views. The national liberals have little in common with social liberals or with green liberals and there is also economic liberals, among others. I would therefore consider it somwhat dangerous to call yourself a "liberal"
or people will associate you with exactly the wrong things.