Hey guys,
today we had a rather serious discussion about one particular thing in our project. I would like to read your opinion on that, since we didn't come to a satisfying conclusion.
Background:
PHP introduced with version 5.4 a new short syntax for creating arrays.
<?php
//normal syntax
$array = array(
'foo' => 'bar',
'uncle' => 'bob'
);
//new short syntax
$array = [
'foo' => 'bar',
'uncle' => 'bob'
];
There are pros and cons to that feature of PHP, but that isn't the point of this discussion. In the end it's just taste.
The problem:
So we made a poll to get an overview about the different tastes on that and wanted to eventually decide if it's going to be a rule or not. Of course, it turned out to be a draw, which led our team-lead to the decision to enforce one of the two solutions. The team responded very bad on this decision, since both groups could live with the other way and doesn't wan't to be enforced. Especially - like in this case - when there is a 50/50 distribution and no common understanding.
The question:
Where does a good coding style end? Does it end when it comes to features of the current language? Isn't it "just" about naming, formatting and so forth? Has a good coding style even room for personal taste? Should a coding style be enforced by a lead or is the team's decision valid to allow both?
Now it's your turn. Thanks already in advance.
Cheers