Posts

Showing posts from January, 2024

Why Wrappers Are So Useful

Image
Now, if you read my previous posts, you will know that I have mentioned wrappers several times, and said that they are a very powerful but underrated tool. If you have never used wrappers before, this might seem like a fuzzy statement, because at first glance it might look like a lot of wasted work.

Building Classes Part One

Image
As I mentioned in the post about The Lego Principle , I regard the main bulk of classes as self-contained and unitform building blocks, put into a pyramid, and only knowing about classes in the layer immediately below them. As methods can only travel downwards and data only can travel upwards, classes have no need to know about classes above them. This is an extremely important point. A class should be 100% self contained, and only use functionality from classes below it and expose data to classes above . 

The Lego Principle

Image
When my daughters were around kindergarten age, the living room would often become a train wreck of Duplo Blocks. Instead of stepping on them during the night, I would often end the evening by building a giraffe nearly as tall as myself, and the ungrateful kids would then topple it over first thing in the morning. Nothing as healthy as starting the day with a bit of destruction. I don't know if the giraffe inspired me, but later when people asked me how I was capable of writing large and complicated applications in such a short time, I came up with The Lego Principle.

Readability In Programming

Image
So, my fellow programmers, let us have a look at the most important aspect of programming. Namely, how to get a higher salary.  No, sorry, jokes aside :)  Let us instead have a look at readability , one of the single most important aspects of building a large application. First, let me share some of my own philosophies on the subject. Bear with me on this. Imagine reading a good novel. The author ensures that the language is fluid and consistent. The sections are separated according to their content. They do not just jump to a new scene in the middle of a sentence. You will not have to backtrack the story to understand what is happening, and they will not use excessive words to convey the content. Less is more. Many of the same principles can be transferred to programming. In many ways, reading a good program should be like reading a good novel . Your code should be easy to read and easy to understa...

About The Author

Image
I think it was Bill Gates who said, “ Software is a great combination between artistry and engineering ,” and he was absolutely right. It is.  The first time I heard the term “rockstar programmer” was in relation to  John Carmack . He was the guy who first used  binary space partitioning  in a 3D game, dramatically speeding up rendering and giving us classics like Doom and Quake on a 66MHz Pentium. In the mid-nineties, Mr. Carmack was driving a red Ferrari 328 and became the synonym for the term, launching us all into a dream about becoming filthy rich game programmers. I am a guitarist and a big Rolling Stones fan, so at that point, I had already started using Keith as my online avatar, but Carmack is without a doubt a contributing factor to why it stuck.