
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 code, allow less room for errors, reduce […]
Everything which the ideal programming language should be doing for us. Even things which may not be possible, but would be ideal, are included here.
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 code, allow less room for errors, reduce […]
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 should they be treated specially? It would […]
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 generic handlers. Code that catches specific types […]
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 that perhaps a.size is wrong. What is […]
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 involved. A lot of operations on 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 protected function instead of the correct public […]
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 redundancy of manually forwarding methods. Here I […]
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 the limitations of C. Nonetheless it’s irksome […]
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 what type of language it will be. […]
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 flow is defined by its conditions and […]
While working on Cloverleaf I came upon a problem of parsing custom operators. I would like to say that a language would allow custom infix operators, to be perfectly flexible and adaptable. […]
“goto”: the demonized programming construct. This little expression allows you to jump to somewhere else in the code while skipping the expressions in between. Opponents say it leads to spaghetti code and […]
Ultimately any program must communicate with the outside world. Be it showing the user data or sending a text based protocol, the need to format character data is ever present. All languages […]
A bane of programming is repeating code and dealing with a myriad of types. The natural response to type overload is to limit the number of types. This runs counter to the […]