Logic: by definition from the web, it means “the principles that guide reasoning within a given field or situation” or in simplest terms a system of reasoning. The principle of programming, i.e in any programming language, is essentially to control the reasoning system of the machine by providing it with conditions and variables.

Today I spent quite a considerable amount of time trying to tell a system how to decide what to do and when to do it. Like most developers I took the easy way out. I told it when so and so happens, do this. i.e I only provided it with an ideal situation. Most systems in the world fail, and it’s mainly because of this approach to development. There are some pretty good applications out there, and while acknowledging the fact that most of the time we want something that is simple, easy to implement, maintainable and most importantly do the task, I still think that we should cater for the anomalies.

Over the years I have seen some pretty good systems and applications, and the reverse is true. Some we average. Software quality is measured in one if not a few ways. Some count problems and defects, some measure how well it does the task at hand etc etc.

Let’s take a simple case of a data capturing system. Its primary objective is to capture data. Yes, it captures data, but how does it decide the right data to keep and which one to reject should be considered? In other words, how good is the “thinking capacity” of the system. The correct system logic will ensure less problems and defects.

I think this is one of the most important things one should think about when you build a system. Before you even start designing the interface, think about what your system has to do, think about how it is going to do it. After you have designed your system’s logic and you understand it, then you can decide on the cosmetics. Designing a system’s logic is not a trivial task. Most of the time the systems being built are nothing but an automated replacement to what we have been doing. One might think it only makes sense to adopt the same processes and logic from the traditional system, but there are a number of things to think about. A computer will be doing what would be done by a human and it will be doing it a lot faster, meaning it needs to decide very fast what to do, and when to do it. A human being will also know what not to do and when not to do it. Shouldn’t that be the case for computers as well? This is where you need to revisit the traditional logic and redesign it to fit the automated system.

This is not a simple case of “All other factors constant, how long will it take the Tumelo to get home?” We do not live in a perfect world, something always goes wrong, we have to cater for those anomalies, even in the machine world. The human element will always be present and some idiot out there is going to want to break your system. And when that happens your system should know what to do.

READ NEXT

Tumelo Mphafe

Tumelo Mphafe

Tumelo Mphafe is the Mindq's senior PHP Developer. What started off as a hobby freelancing as a web designer seven years ago turned into an obsession with distributed systems design and development. He...

Leave a comment