
Why switch is better than if-else
In Benβs post, he questions whether switch statements are cleaner than if-else chains. I contend they are, because they better express the semantics of the
In Benβs post, he questions whether switch statements are cleaner than if-else chains. I contend they are, because they better express the semantics of the
Working on a defect in Leaf I had a question: should function arguments be reassignable within a function? Are they just like local variables, or
Error handling is hard, and it’s made harder by a rich error hierarchy. Programs that successfully handle errors tend to have only a couple of
I can’t decide whether a.size or size(a) is more correct when getting the length of an array. While writing Leaf I have a recurrent feeling
Virtual functions are a great feature, but they have a rather severe limitation. They can only be implemented by extending the definition of all classes
I recently fixed a defect that I felt the compiler could have caught. Some initialization code was not being run as I was calling a
C# prefers composition to inheritance yet lacks any concise composition syntax. This is unfortunate. While I have nothing against composition, I really don’t like the
There’s something wrong when a language allows 1/2 to equal 0. It’s easy to understand why this happens, and perhaps it’s even easy to forgive
Not all languages are made with the same purpose in mind. When it comes to designing a new language like Leaf, it’s important to choose
Conditionals are a key construct in programming: from the simple if statement, to loops and switches, and even to dynamic mapping. The essence of program
Signup to my mailing list to get notified of each article I publish.
Made with Elementor. Hosted with SiteGround. Domain from Netim.