by Sjonny · 5y ago · 0 comments
Choose:
AddElement(object, true, false);
AddElement(object, true, true);
AddElement(object, false, false);
AddElement(object, false, true);
or AddElement(object, visible::on, deletable::off);
AddElement(object, visible::on, deletable::on);
AddElement(object, visible::off, deletable::off);
AddElement(object, visible::off, deletable::on);
The latter is more readable, you can spot bugs easier, you don't need to remember which parameter was for visibility, and which was for indicating deletable. And it doesn't take much more to write this than a confusing boolean. It doesn't scale.But the 2nd one will always be more verbose, no matter if you need it or not.
So I'd choose the first one.
So should we change our use of C++ to make it more GitHub-friendly? Or should we fix GitHub to properly work with the C++ source code that already exists?