If you were expecting a phone call from a friend, you (hopefully) wouldn’t sit by the phone and continuously pick it up to see if your friend was on the other end. Instead, you’d wait to be notified of an incoming call when the phone started ringing or vibrating. Sitting by the phone and picking it up over and over again is a form of what’s known as polling. Read more...
What’s so Magical About Magic Strings? Magic strings are string literals strewn about a code base that apply some kind of limitation to the code. They can be used to filter valid input, constrain parameters, or control the behavior of code. Read more...
For beginners TypeScript is like the carrot on the end of the stick, always just out of reach no matter how hard you try. Everyone touts how it’s “JavaScript that scales”, and once you use it you’ll never go back. But finding a decent tutorial on how to set up a new TypeScript project is quite the challenge. Many tutorials are out-dated and want you to install other packages such as gulp, jump through hoops, or even sacrifice your first born child (okay maybe not but still). Read more...
What Are They? A marker interface is an empty interface (no methods or properties) that is used to identify classes that implement it belong to a special group. Some might argue that this is a code smell, but in certain situations they can be the best solution for constraining types. Read more...
What Are They? Magic numbers are numbers in code that appear to be arbitrary, but actually serve a purpose. They are commonly described as an anti-pattern as they diminish code quality, and are “referred to as breaking one of the oldest rules of programming, dating back to the COBOL, FORTRAN and PL/1 manuals of the 1960s”. [1] Read more...
With winter approaching fast, and my Civic only having summer tires I needed to hurry up and finish the Cherokee. The Civic was also suffering from a stuck open thermostat that ensured the engine temperature never reached operating temp, and my heat was always cold. Read more...
Patching Holes This post is a continuation of the mini series about restoring my old XJ cherokee. In the previous post I talked about cutting out and welding in a new rocker panel. Read more...
What are they? While it may seem like nothing more than buzz words, dependency injection is a well known principle. In fact, you’ve likely used it yourself in the past and just didn’t know the technique had a name. Dependency injection can be thought of as passing a resource required by a class to the class through one of several means. While the class could instantiate a new instance of the resource itself, by using dependency injection we introduce an easier way to take advantage of dependency inversion. Read more...
Preface Unit tests and integration tests are designed to serve two different purposes. They are not meant to substitute each other, and each type has a specific focus. However, developers tend to struggle to determine the border that seperates unit tests and integration tests as there is no set hard limit on either one. Read more...
Where I’ve Been, and Where I’m Heading I took somewhat of an unplanned hiatus from working on No Mans Blocks. Initially, I took a break because I wanted to pursue writing a server for a Reddit clone. It wasn’t until about two months in that I realized just how over scoped the project was and how long it would take to finish. While I may not have much to show for this time, it did open my eyes up to some of the common software-architecture patterns, and how to utilize these patterns to better organize my projects. During my adventure I also picked up TypeScript and dived into the intriguing world of NodeJS. Read more...
It’s quite typical for a Domain Driven Design (DDD) project to need validation for it’s domain models. While it may be sufficient to solve this by adding an IsValid() method to each model, this can cause confusion for the developer by cluttering the model class, and/or by requiring the IsValid() method to be generalized that it covers a large range of validation rules for any situation that may arise. Let’s work with an example. Read more...
This post is the second part in my mini-series of restoring my old xj cherokee. If your interested, check out my attempt at saving the rusty roof. Like most xjs out there, especially those in the rustier parts of the US, the rocker panels needed some love. I never really captured a good before shot of the rust on the passenger side rocker. It was roughly 9" in length and about 3" wide. I finally decided it was time to fix it when I managed to puncture a hole in it using my key. (You can even see the hole in the picture if you look close). Read more...
I’m a big fan of older vehicles. I just love the simplicity of them and how easy they are to work on them. Plus the cost of parts really can’t be beat. Since my civic is far from snow worthy I also own a 2000 Jeep Cherokee. It may not be the prettiest vehicle out there but it’s never let me down, and has successfully traveled 20,000 miles in it’s first year of owner ship with a couple road trips ranging in the 800-1000 mile range. Read more...
Ten months of work finally pays off I enjoy working on my own vehicles but by far the best part is finishing up. While it took longer than I hoped, and the deadlines I kept setting for myself came and went I can say it was worth the wait. Today was the second day of driving, and started off with topping off the tank. It hadn’t been gassed up since last September and was pretty much on E. Read more...
Getting ready for the test drive While the car may not be on the road yet, it’s come quite a bit closer to getting there. Lately I’ve been working on fixing everything that was sub-optimally done previously by me. One of the things I didn’t do quite right was the clutch pedal pin. Since the car was an automatic initially, I had to source out some parts for the swap. I ended up buying just a generic pin for the clutch master cylinder to hook it to the clutch pedal. Interestingly enough the metal was fairly soft as the pedal has worn a fairly noticable grove into the pin itself. Read more...
Creating Time (literally!) I have a knack for forgetting what I’ve managed to accomplish on the game during the week. To try to overcome this so I have updates I can post on it, I’ve started writing down each accomplishment on a sticky note. Read more...
Finishing things up With the weather warming up it’s been making me miss the civic quite a bit. While it may not be the fastest car out there I do enjoy riving it. I had the chance to work on it a bit more this weekend. To get myself motivated I started by getting the radiator mounted in place. After that I wired up the charge harness. Read more...
Implementing a Thread-Safe Queue One of the most useful data structures when it comes to multi-threading is the queue. However, queues in c# aren’t thread-safe by default. Thankfully it’s easy enough to implement your own as we will do today. Let’s start by defining our class. Read more...
Playing Around at the Bit Level This weeks adventure has been exploring object serialization. Initially I was using the serializable attribute to convert my objects into byte arrays but for some objects such as the voxel chunks this is far from ideal. Since I don’t want to handle serialization with 2 different methods I’ve decided to bite the bullet and roll my own set up. Read more...
Connecting the Pieces It’s easy to forget just how many parts you’ve removed until it comes time to put them all back together. I know I’m probably not alone when I say I’ve fallen victim to scope creep many times now. In the end you always tell yourself never again yet it keeps happening… Read more...