2 ms·
I've usually seen it expressed as: > instead of accepting a boolean argument, write a new function Which can be expanded to > instead of an if-statement, wri
by withinboredom 3y ago
I've usually seen it expressed as:
> instead of accepting a boolean argument, write a new function
Which can be expanded to
> instead of an if-statement, write a new function
You can't remove branching from software (otherwise, just create a jpeg), but you can structure your software in such a way that it appears not to branch.
I think it's weird, but I worked with someone like that and learned a few interesting things (for example, I usually do write a new function instead of adding an optional/boolean argument -- unless it makes things worse for the caller because the argument comes from outside the context/domain). But with all due respect to people like this, it's bananas to do it all the time.