If my team has low skill, should I lower the skill of my code?
- by Florian Margaine
For example, there is a common snippet in JS to get a default value:
function f(x) {
x = x || 10;
}
This kind of snippet is not easily understood by all the members of my team, their JS level being low.
Should I not use this trick then? It makes the code less readable by peers, but more readable than the following according to any JS dev:
function f(x) {
if (!x) {
x = 10;
}
}
Sure, if I use this trick and a colleague sees it, then they can learn something. But the case is often that they see this as "trying to be clever".
So, should I lower the level of my code if my teammates have a lower level than me?