November 20, 2013
On Wednesday, 20 November 2013 at 20:06:04 UTC, Andrei Alexandrescu wrote:
> What I meant is there are consistent styles that are objectively worse. Consistency is necessary but not sufficient.

And what I meant is this opinion of yours is wrong. Any consistent style that is liked by at least one programmer that uses it in practice is no worse than any other possible consistent style. There is nothing objective about it, pretty much as there are not that much common about human perception.
November 20, 2013
On Wednesday, November 20, 2013 12:06:04 Andrei Alexandrescu wrote:
> What I meant is there are consistent styles that are objectively worse. Consistency is necessary but not sufficient.

I agree, but you do come across sometimes as seeming to think that some styles are objectively worse when plenty of other folks would disagree with you (e.g. with regards to how much vertical whitespace is reasonable). I think that in most cases, style ends up being very subjective and not objective at all.

IIRC, Walter linked to a blog post a few months back about someone talking about what good coding style looked like, and they were talking about the code for Doom 3 and how beautiful it was, and yet when they showed what it looked like, many people thought that the coding style was absolutely horrible. I think that it's quite clear that what people consider to look good in terms of coding style varies quite a bit.

So, while some cases are clearly objectively bad (e.g. all of the code on one line), I think that you're going to have a hard time arguing it objectively in most cases - especially when it comes to legibility, since different people find different styles to be more legible, and what's more legible often comes down to what you're used to seeing rather than anything particularly objective.

- Jonathan M Davis
November 20, 2013
On 20.11.2013 21:17, Dicebot wrote:
> On Wednesday, 20 November 2013 at 20:06:04 UTC, Andrei Alexandrescu wrote:
>> What I meant is there are consistent styles that are objectively
>> worse. Consistency is necessary but not sufficient.
>
> And what I meant is this opinion of yours is wrong. Any consistent style
> that is liked by at least one programmer that uses it in practice is no
> worse than any other possible consistent style. There is nothing
> objective about it, pretty much as there are not that much common about
> human perception.

I think you misunderstand Andrei here. There are styles that are consistent that are not liked by *any* programmers. These styles are of course not in use.

A style that says you should use seventeen blank lines between functions, and each blank line should have 3 tabs and 2 spaces, alternating, may be consistent, but it's also ugly, and I daresay that is objective (as in, nobody would disagree, I don't believe in perfect objectivity).

A less constructed example may be where a non-programmer manager has seen that he cannot understand what his programmers are writing, and decides to formulate some coding style to make it easier for him, but which severely hamstrings actual programmers. (though I guess in this case, one could argue it's subjectively better for him...)

-- 
  Simen
November 20, 2013
On 11/20/13 12:17 PM, Dicebot wrote:
> On Wednesday, 20 November 2013 at 20:06:04 UTC, Andrei Alexandrescu wrote:
>> What I meant is there are consistent styles that are objectively
>> worse. Consistency is necessary but not sufficient.
>
> And what I meant is this opinion of yours is wrong. Any consistent style
> that is liked by at least one programmer that uses it in practice is no
> worse than any other possible consistent style.

There are a bunch of styles that are consistent yet used by nobody, because they are objectively worse. So consistency is not the sole requirement. Then you hadn't mentioned "that is liked by at least one programmer" which moves the goalposts. Then one programmer can be one highly unusual human being, so there is strength in numbers.

Generally I tend to double-check with all-inclusive characterization "everybody's doing great" and "agree to disagree" and such. Taken to the extreme such a stance does little else than to promote undue relativism. So whenever someone asks me to agree to disagree I go back to first principles and look for rationale that makes one of the points objectively refutable.


Andrei

November 20, 2013
On 11/20/13 12:23 PM, Jonathan M Davis wrote:
> On Wednesday, November 20, 2013 12:06:04 Andrei Alexandrescu wrote:
>> What I meant is there are consistent styles that are objectively worse.
>> Consistency is necessary but not sufficient.
>
> I agree, but you do come across sometimes as seeming to think that some styles
> are objectively worse when plenty of other folks would disagree with you (e.g.
> with regards to how much vertical whitespace is reasonable). I think that in
> most cases, style ends up being very subjective and not objective at all.

That I agree with.

Andrei


November 20, 2013
On Wednesday, 20 November 2013 at 20:47:10 UTC, Andrei Alexandrescu wrote:
[snip]
> There are a bunch of styles that are consistent yet used by nobody, because they are objectively worse. So consistency is not the sole requirement.
[snip]

This is true, one can always be consistently illegible :D

http://www.ioccc.org/1986/bright.c

For me personally I always find switching to FORTRAN very jarring. It is interesting because FORTRAN itself is very readable, but the style often used and ALLCAPS everywhere make it hard to read at first.

However, on the whole I've found consistency often leads to legibility.

Cheers.










November 20, 2013
On Wednesday, 20 November 2013 at 20:47:10 UTC, Andrei Alexandrescu wrote:
> There are a bunch of styles that are consistent yet used by nobody, because they are objectively worse. So consistency is not the sole requirement. Then you hadn't mentioned "that is liked by at least one programmer" which moves the goalposts. Then one programmer can be one highly unusual human being, so there is strength in numbers.

You see, the whole definition of term "objective comparison" implies comparison by  traits other than actual usage. The very moment when you refer to something being worse because no one (or no one in sane mind) uses it, comparison moves into area of subjectivity. Not your specific subjectivity but subjectivity as a general evaluation approach.

I am not arguing about the fact that some code styles are widely recognized as better ones. I oppose using the term "objectivity" in that context, consider it etymological nitpicking.
November 20, 2013
On 11/20/13 3:45 PM, Dicebot wrote:
> On Wednesday, 20 November 2013 at 20:47:10 UTC, Andrei Alexandrescu wrote:
>> There are a bunch of styles that are consistent yet used by nobody,
>> because they are objectively worse. So consistency is not the sole
>> requirement. Then you hadn't mentioned "that is liked by at least one
>> programmer" which moves the goalposts. Then one programmer can be one
>> highly unusual human being, so there is strength in numbers.
>
> You see, the whole definition of term "objective comparison" implies
> comparison by  traits other than actual usage.

No, because the quantity being measured is "worse".

Andrei

November 21, 2013
On Wednesday, 20 November 2013 at 23:57:40 UTC, Andrei Alexandrescu wrote:
> No, because the quantity being measured is "worse".
>
> Andrei

If it would have been an inherent well-defined trait of an object itself, it would have been objective comparison. As this quantity is defined purely (and no real measurable traits other than consistency were proposed) by observing subject, it can't be an objective measurement and this objective comparison.

Objective comparison is something like comparing average amount of extra symbols per lexer token between two code styles.
November 21, 2013
Am Tue, 19 Nov 2013 12:27:43 -0800
schrieb Walter Bright <newshound2@digitalmars.com>:

> I've abandoned using tabs as every text rendering engine interprets them differently.

Yes, that's one of the selling points of using tabs, as they all have a tab width setting you can customize. :)