4

There are two questions on whether one should lower his coding practices to meet those of the surrounding team:

The accepted answer to the first, as it stands now, is "yes, you should prefer communication within the team", and the answer to the second is "no, you should try to educate them". (For the record: those are not my questions nor my answers, I do not ask here over a feeling of rejection or anything; I want clarification on the site's policy and purpose in this respect).

I was told in a comment to this other question that

SE is built around identifying a "single" answer, and isn't structured to handle multiple equally good examples.

Searching around in this Meta site, I found that the "official guideline on duplicates" states:

What we want is on the order of 4 or 5 similar-but-not-quite-the-same duplicates to cover all possible search terms and common permutations of the question. It is also OK for these duplicates to have their own answers so people who find them don’t have to click yet again to get to a good answer.

But in this case, the answers to those duplicate questions are different. Doesn't this imply that there are no objective answers "that are supportable by objective statements, and aren't purely a matter of taste", and therefore are questions that are opinion-based? Or do you think it just shows that the answer's authors have not researched enough, and therefore the community votes do not reflect an objective winner?

  • accepted answer means only it worked best for the asker (FWIW, answer score isn't a reliable indication of the "best" answer, either). As for second question, per my reading accepted answer priorities team communication over cleverness too: "A team's code should be written as if one person coded it. You absolutely have to agree on coding guidelines. You should abide by those guidelines. If the coding guidelines specify that reading optional parameters should be done in the 'less clever' way, then that is the way." – gnat May 30 '14 at 10:55
  • @gnat: if neither acceptance nor score select the "best" answer, then the site cannot claim to select a single answer, yet alone an objective answer. And a divisive line between acceptable and non-acceptable answers cannot be drawn, if you argue that non-researched answers will be just down voted. Further than that, I do not care exactly about the specific answers -- just imagine they were exactly opposite. (Maybe I should have abstracted this detail away from the question?) – logc May 30 '14 at 11:05
  • score and acceptance do help to select the "best", just not reliably - ultimately, readers need to read question and answers and use their own judgement and avoid blindly following the marks and scores – gnat May 30 '14 at 11:09
  • ...by the way, a nice explanation for possible differences between accepted and best answer has been recently posted at MSO – gnat May 30 '14 at 11:20
3

I recognize that comment....

In my opinion, the original question, as asked: Simplicity-efficiency tradeoff really is a duplicate of If my team has low skill, should I lower the skill of my code?.

And we can use the OP's ending questions to prove that point.

Do I have to keep it simple (stupid), just because others are not familiar with best practices and efficient coding? Or should I continue to do what I find best and write code my way?

Likewise, the ending question from the duplicate:

So, should I lower the level of my code if my teammates have a lower level than me?

And looking over the dozen or so answers in the duplicate, I think it's pretty clear that they answer the question that was asked. It's not just the accepted answer in the duplicate that addresses the original question, it's the top 4 or 5 answers that cover the question.


But what was asked is not really the problem at hand. In fact, I'd argue this is a classic XY problem in disguise.

The comment thread gives us a more clear picture of what's going on:

see i can't exist in an environment that puts limit around what i can do, i like creative problem solving, plus my code is never un-commented, so in my opinion, it's not that i'm doing anything wrong – sarepta

and

@Telastyn by efficiency i don't mean LINQ in specific, one of the CTO comments is t-sql code that does non-trivial processing, nevertheless it's a known thing that LINQ simplifies lots of things, which is still an important skill in a dev arsenal – sarepta

Which takes us back to a semi-throwaway comment made in the question itself:

He asked me to maintain a simple code base and to think of the others that will inherit my changes.

Now we have a better understanding of what the problem is. The problem is the OP not the code. And the OP isn't following the coding conventions for the team he's on because he sees himself as better than his peers.

So when we look at the opening paragraph of the accepted answer (Karl's answer) in the original question, we see that Karl is addressing the actual problem.

We write code for other humans to read. New technologies are intended to make code easier to read, not harder. There are good and bad ways to use new technologies. If you're trying to write "impressive" code, you're doing it wrong.


To address your question: No, differing accepted answers doesn't necessarily imply that the question is too opinion based. It could also indicate an XY issue as I pointed out. Or it could simply mean the two different OPs found more meaning in differing lines of thought than the other.

  • +1 for a thorough answer, but I am not sure this completely answers my question. Your arguments make me wonder: a) what would be the X problem hiding behind the Y problem of lowering or not lowering code quality? b) if different posters accept different lines of thought, then the site's aim is not to find a single one which is researched and arguably better. This is problematic to me, since I can also see that "design questions" tend not to have an objective answer; I understood the proposed solution was to provide "researched answers" as those that are as objective as possible. – logc Jun 2 '14 at 12:04
  • ... and with "researched answers" I mean those that are backed by quotes by different authors, so that they reflect established solutions to a problem (what is defined under the quote here about "answers that are supported by objective statements", which is actually also from @KarlBielefeldt). – logc Jun 2 '14 at 12:08
  • @logc per my reading, "X" problem is described in this answer as "The problem is the OP not the code. And the OP isn't following the coding conventions for the team he's on because he sees himself as better than his peers." – gnat Jun 2 '14 at 19:02
  • @gnat If the XY problem means "you want to solve X, try Y, and ask only for Y", and you are telling me to interpret the answer as "the real problem is the OP, the OP tries to code, and the OP only asks about his code" ... well, you could say that from almost any question on Stack Overflow and Programmer SE :) – logc Jun 2 '14 at 19:43
  • 1
    @logc its described in What is the XY problem on Meta.SE. Its generally found when people are asking how to do a particular solution rather than how to solve a particular problem. The solution (possibly incorrect way of doing things) was already decided on in the XY problem, and answering that question ultimately won't help the OP because it won't solve the core problem. – user40980 Jun 3 '14 at 0:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .