My GW-BASIC saga continues. I’m on the third rewrite now of this “simple” translation app. I keep encountering problems that ultimately challenge core design decisions I made early on. Given the time scale and the fact that this is a…
BASIC complications: parser combinators
When I wrote about creating a GW-BASIC translator, I admit I didn’t fully grasp what I was getting myself into. Even a simple language like BASIC has a relatively involved syntax, which makes parsing a challenge (doubly so because I…
More four fours
Astute readers may have noticed in my previous post about the four fours that I neglected to include exponents in the set of supported mathematical operations. Well, that is fixed now. Perhaps these imagined readers also noticed that my recursive…
Cancellation confusion and Task.Run
Code that heavily relies on Task.Run tends to have issues. In my experience, this is a clear sign that the asynchronous model within the codebase is spotty at best. Indeed, a “really async” design would not generally rely on Task.Run…
Humble controllers
Whenever I write code using ASP.NET Web API, I invariably make my controllers “humble.” I use this term in the same sense as described in the Humble Object pattern. Basically, a controller should be a thin coordinator between the client’s…
Refactoring C++: Extract Method using `friend struct This`
My day to day programming environment is C# + Visual Studio + ReSharper. I like to think I’m fairly productive in this setup and after years of experience have picked up a few fast and easy ways to refactor my…
Object Calisthenics and Advent of Code
A few weeks back, I became aware of Advent of Code, a site built by Eric Wastl. AoC is basically an annual 25 day programming challenge/competition which has run every December for the past three years. Since I had the…
Bring me the simulator, on the double!
The (oft-misunderstood) dependency inversion principle states that abstractions should not depend on details, and instead details should depend on abstractions. As an example, let us first consider a violation of this guideline: The so-called “abstraction” around configuration ConfigFile is very…
Productize or perish
All things being equal, a technology developed for and sold to an external audience is going to be superior to an internal tool fulfilling the same role. After all, the captive marketplace is not known for its ability to produce…
Just for the test of it
Ian Cooper implores you to test behaviors, not implementation details. His video “TDD, where did it all go wrong” expands on these points a bit. The summary is that a bunch of really thorough tests with explicit inner knowledge will…