November 21, 2013
On 11/20/13 4:03 PM, Dicebot wrote:
> 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.

In this context "objectively worse" means "all reasonable people would say it's worse".

Andrei


November 21, 2013
On Thursday, 21 November 2013 at 01:45:46 UTC, Andrei Alexandrescu wrote:
> In this context "objectively worse" means "all reasonable people would say it's worse".
>
> Andrei

Which is exactly hidden changing of word meaning to push own opinion which disgusts me.

http://www.oxforddictionaries.com/definition/english/objective

"not influenced by personal feelings or opinions in considering and representing facts; not dependent on the mind for existence; actual:"

"opinion" pretty much annihilates "objectivity" when used in same sentence.

If statistical opinion sounds "objective" enough for you, I may propose to start changing laws of Physics by voting. Why would it object if all reasonable people say so?
November 21, 2013
On 11/20/13 6:02 PM, Dicebot wrote:
> On Thursday, 21 November 2013 at 01:45:46 UTC, Andrei Alexandrescu wrote:
>> In this context "objectively worse" means "all reasonable people would
>> say it's worse".
>>
>> Andrei
>
> Which is exactly hidden changing of word meaning to push own opinion
> which disgusts me.

No reason to escalate.

> http://www.oxforddictionaries.com/definition/english/objective
>
> "not influenced by personal feelings or opinions in considering and
> representing facts; not dependent on the mind for existence; actual:"

Yah, and it's a fact that certain coding styles would not be used in spite of them being consistent.

> "opinion" pretty much annihilates "objectivity" when used in same sentence.

It does, but this is not about opinions.

> If statistical opinion sounds "objective" enough for you, I may propose
> to start changing laws of Physics by voting. Why would it object if all
> reasonable people say so?

... and the strawman is also uncalled for.


Andrei

November 21, 2013
On Wednesday, 20 November 2013 at 23:57:40 UTC, Andrei Alexandrescu wrote:
> 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

Ho please, we aren't in a schoolyard.
November 21, 2013
On 11/20/2013 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 is nothing objective about it, pretty
> much as there are not that much common about human perception.

I'm going to very strongly disagree with this.

And I'll use a hoary analogy - airplane cockpit design. It doesn't matter how consistent it is - there are an awful lot of cockpit design features that have caused crashes, and the fix was changing the feature. These misfeatures were not technically faulty nor were they inconsistent. But they were still bad.

I'll give one example. Warning horns for things that went wrong were good features. So good, in fact, that designers added more and more horns. Each horn had a different sound signature. The horns were consistent, and worked faultlessly. Unfortunately, the plethora of horns caused pilots to get confused under stress, and they'd react to solve the wrong problem.

The solution was to replace the horn's siren with a voice saying what was wrong, such as "fire engine no. 2" and "pull up". This worked BETTER.

I see no difference with coding styles. Some are better, some are worse. As Andrei stated, consistency is not sufficient.

For example, no indenting at all. Consistent? Yes. Bad? Yes. Case closed!
November 21, 2013
On 11/20/2013 3:45 PM, Dicebot wrote:
> I oppose using the term "objectivity" in that context, consider it
> etymological nitpicking.

To reiterate my analogy, some cockpit control designs caused more crashes. This is objective fact. It isn't a matter of the pilots "liking" or "disliking" one or the other.
November 21, 2013
On 11/20/2013 5:45 PM, Andrei Alexandrescu wrote:
> In this context "objectively worse" means "all reasonable people would say it's
> worse".

It could also be objectively measured as:

1. results in more bugs

2. takes people longer to get up to speed with code written that way


November 21, 2013
On 11/20/2013 12:23 PM, Jonathan M Davis wrote:
> 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.

Legibility can be objective, too.

For example, it is a fact that many fonts do not distinguish O and 0, l and 1. It is an objective fact that people have trouble distinguishing them. The JSF C++ coding standard, for example, prohibits using an "l" suffix on integral literals for that reason.

It's also an objective fact that people have trouble distinguishing:

    verylongisanidentifier

from:

    verulongsianidentifier

It's not just tomayto-tomahto. Human factors research shows that some designs are objectively better than others.

November 21, 2013
On Thursday, 21 November 2013 at 02:02:08 UTC, Dicebot wrote:
> On Thursday, 21 November 2013 at 01:45:46 UTC, Andrei Alexandrescu wrote:
>> In this context "objectively worse" means "all reasonable people would say it's worse".
>>
>> Andrei

A sample of code from my very first job (needless to say that wasn't software company):

if (...) statements1; else
statements2;

yes, not indentation and it was used pretty consistently, and I'm not kidding!
To make things worse, in the code fragment I was debugging `statements1` exceeded screen width, so I have not seen `else`.

It was on my very first day, and after discovering this nightmare I spent all the rest of the day searching for code pretty-printer.
At that moment I didn't even know how these class of programs called or if they exist at all, but debugging code written like that would be unbearable.

Now, Michael, please, go and show me *a single* experienced programmer who wouldn't call this coding style a disaster. DISASTER.

I think I understand your stance - adherence to scientific method etc and that's great, but there is a limit to it.

(Once again, I'm not exaggerating at all. There were other "nice" things there, like behemoth method 8k lines long, code duplication all over the place, sometimes tens times)
November 21, 2013
On Wednesday, November 20, 2013 19:22:10 Walter Bright wrote:
> On 11/20/2013 12:23 PM, Jonathan M Davis wrote:
> > 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.
> Legibility can be objective, too.
> 
> For example, it is a fact that many fonts do not distinguish O and 0, l and 1. It is an objective fact that people have trouble distinguishing them. The JSF C++ coding standard, for example, prohibits using an "l" suffix on integral literals for that reason.
> 
> It's also an objective fact that people have trouble distinguishing:
> 
>      verylongisanidentifier
> 
> from:
> 
>      verulongsianidentifier
> 
> It's not just tomayto-tomahto. Human factors research shows that some designs are objectively better than others.

Definitely, but almost all arguments over coding style seem to be very subjective even when some people try and claim that some of the issues are objective. Most style choices which are objectively bad don't even ever get made precisely because they're objectively bad. There are of course exceptions, but I've rarely seen style arguments that are actually objective, and it's not uncommon to have people with drastically different opinions as to what looks good and who think that it should be obvious to everyone that what they think looks good looks good and that the other style looks horrible.

And I've run into plenty of cases where one developer thinks that a particular coding style is much easier to read, which is in complete contrast with what another developer thought was legible (how many parens to use and where being a prime example of that). So, it at least almost always seems like what's considered be a good, legible style is very subjective.

- Jonathan M Davis