C++11 introduced a perfect forwarding mechanism for template parameters. The key part is the ability for a template parameter to match any input without any implicit conversion. This is done using the […]
Over 20 years of programming. From video games to communications; science to finance; compilers to business processes. Too many languages to even track anymore.
Here's looking to another 20 years towards mastery of the craft.
Does ‘return’ always cause a function to return? Surprisingly the answer is “no”. Indeed there are situations in which ‘break’ may not always break from a loop, and ‘goto’ may no go […]
One way to convert source code to machine code is via “basic blocks”. After parsing and semantic processing, and just prior to machine code generation, each of a program’s functions is split […]
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 […]
Below I’ve tried to catalog some of the typical uses of references in programming. My aim is to clarify the role references play in a language to help me decide how they […]
For Leaf, I need to parse decimal numbers to retain the exact value of the input without rounding. I assumed such a library would exist in C++, but nothing I found handled […]
One of the problems with C++ is the way it handles type conversion. It inherits a lot of implicit conversion from C and then adds on additional conversions. The problem with all […]
I’ve been reworking how I handle basic type conversion in Leaf. This is a mechanism which allows implicit conversion of simple types. As part of this effort I had to refactor how […]
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. […]
Programmers don’t usually spend a lot of time thinking carefully about names and values. As long as we follow a few basic rules, our code will generally behave as expected. As I […]
Understanding “values” is perhaps the most critical part of understanding programming. We are inundated with a variety of terms like “by value”, “by reference”, “member copying”, “binding”, “pointer”, “object reference”, “heap variable” […]
Error handling should be simple. It can become mired in complexity, but I don’t believe it has to be that way. If we stay focused on fundamentals, what seems like a difficult […]
Is there a difference between a “fault” and an “error” within a computer program? A number of people commented on my previous article suggesting this to be the case. I will try […]
The abort function is a remnant of old programming practices, and it pains me to see it in modern software. While it’s great that a program detects an error, calling abort is […]