by bluecalm · 1y ago · 0 comments
When you write explicit code you know what types the a and be are in the context.
You don't write generic code but explicit specific code for that context. In some contexts you will need a cast and in some others you won't (hence "maybe").
The rest of the article reads like a parody. Instead of a clear, explicit one-liner the author arrives at a multiline function which still doesn't solve the main issue Linus pointed out (that you don't know which argument is high and which is low when you read the code and encounter that function).
It's defined in the function parameters. Surely your IDE would let you know the correct order? Otherwise, you could make that comment about every single function you encounter.
The alternative is using build in common operators in the language.
>>Otherwise, you could make that comment about every single function you encounter.
It's a trade-off. The more logic there is to pack the more it's worth it. Here we have a one liner with two built in operators.