3 ms·
Who says that the one line lambda is less clear that a convoluted 10-line mess doing dumb stuff like if(fooIsTrue) { map["blah"] = bool(fooIsTrue); } else if (!
by jcelerier 2y ago
Who says that the one line lambda is less clear that a convoluted 10-line mess doing dumb stuff like if(fooIsTrue) { map["blah"] = bool(fooIsTrue); } else if (!fooIsTrue) { map["blah"] = false; }
- johnnyanmac 2y agoMy experience in unmanaged legacy code bases. If it's an actual one liner than sure. Use your ternaries and closures. But there is some gnarly stuff done in some attempt to minimize lines of code. Most of us aren't in some competitive coding organization. And I know it's intentional, but yes. Add some mindfulness to your implementation Map["blah"] = fooIsTrue; I do see your example in the wild sometimes. I've probably done it myself as well and never caught it.