I often hear a question from my students - how should a programmer think? In this article, I will try to answer this question and explain why I mention these three methods - abstract thinking, strategy, and tactics. The approach I will describe comes from my experience as a programmer and mentor. I use the mentioned methods myself and teach them to my students.

First, let me start by explaining the concepts presented. Then I will transfer the concepts to programming. Remember that when designing and implementing any element - even the smallest one - of an IT system, you should approach the topic abstractly, have an established strategy, and implement tactical actions.

Clarifying the concepts will allow us to establish a common view on the issues I describe. In programming terms, I will present the concepts in the example of an application, an IT system supporting a private medical clinic.

Abstract thinking

Abstract thinking – what is it?

It is a process that allows us to reflect on things that are not present in the current space and moment. […] It also allows us to reflect on general concepts and principles […]. It is used to remember various aspects of a situation, predict and plan for the future, think symbolically and draw conclusions. […] Source: https://pieknoumyslu.com/myslenie -abstract-what-it-is/

Abstraction (programming)

Abstraction - a kind of simplification of the problem under consideration, consisting in limiting the scope of features of manipulated objects only to features that are key to the algorithm and at the same time independent of the implementation. Source: https://pl.wikipedia.org/wiki/Abstrakcja_( programming)

Why is abstract thinking necessary?

Why is abstract thinking necessary? The above descriptions of this concept very well indicate the most important elements of this method. "It is a process that allows us to think about things that are not there in the current space and moment.", when programming, we will create and write code for things that are not there yet, do not exist. "Abstraction - a kind of simplification of the problem under consideration, consisting in limiting the scope of features of manipulated objects only to features that are key to the algorithm and at the same time independent of the implementation.", this is how the source code should be created and written, to put it very simply: the minimum, necessary set of elements, features; independent of the method of implementation.

Programming example

Let's imagine that we were asked to add a module that imposes limits on booking visits per week, e.g. a maximum of three visits - an IT system supporting a private medical clinic. The system probably includes concepts such as: Clinic, Visit, Patient and Reservation, as well as the mechanisms and processes of their joint interaction. However, the concept of Visit Limit does not exist yet, it needs to be defined and then implemented, i.e. write the source code. The definition of the term Visit Limit should be discussed and confirmed with the people ordering a given module. The newly created domain model – Visit Limit – must be compatible with existing mechanisms and processes. We do not treat this stage as an oracle, many elements may change in later stages.

Strategy

Strategy

A well-thought-out action plan in the event of a solution. Source: https://sjp.pwn.pl/sjp/strategia;2576315

Strategy (Game Theory)

Strategy – a player's action plan describing his behavior in every possible situation. The strategy fully determines the action (move) that the player will take in a given situation, at every stage of the game, for every possible story leading to this situation. […] Source: https://pl.wikipedia.org/wiki /Strategy_(game_theory)

What does the strategy bring?

In short, a strategy is an action plan that allows you to achieve a set goal. It defines the plan and the goal we are striving for. I have already written about planning the implementation of the source code in the article: Stop! Before you start writing code, think about what you want to code? Analysis, design and implementation. “Strategy – a player's action plan describing his behavior in every possible situation. The strategy fully determines the action (move) that the player will take in a given situation, at every stage of the game [...]. Here, the word player can easily be replaced with the word application, IT system. A programmer will have to think about the source code being created at various stages of its operation.

Programming example

In point Abstract thinking - Programming example a model was created fields – Visit Limit – you should set a strategic goal. It may be an implementation, i.e. source code that will prevent the patient from booking more visits than the number indicated in the limit. It may as well be a functionality available from the administration panel, available to clinic employees, enabling the setting of such a limit. At this stage, I plan and set steps to achieve the goal. One step may be a naming convention for the classes and/or packages you create. The next step is to determine whether it will be a single class or a whole new module. A very important step is to check whether and how I will be able to test a new class or module in the context of the entire system - integration tests.

Tactics

Tactics

A course of action intended to achieve a goal. Source: https://sjp.pwn.pl/znaj/taktyka.html

Tactics

(1.2) method of operation according to a previously thought-out plan. Source: https://pl.wiktionary.org/wiki/taktyka

What is tactics?

Tactics are part of the strategy, they can be described as subsequent steps - elements of the plan - that must be performed to achieve the assumed strategic goal. Here we simply follow the next steps set for the selected strategy.

Programming example

Referring to the point Strategy - Programming Example, the first step is to establish a convention nomenclature. In this case, referring again to the point Abstract Thinking – Example programming, where the domain model – Visit Limit – was created. I wonder what the English equivalents will be - Visit Limit - most of the systems I implemented were in English, the exception was the government system, written in Polish. The word Limit can be written as Maximum or Limit, the word Visit can be written as Appointment or Visit. In my opinion, getting the names right is of the utmost importance. The next tactical step is the implementation of a new module or a single class. If the created code is to be used by other modules in the system, it is worth creating a separate module, it will be easier to share it in the form of dependencies in the form of libraries - JAR files. As for the issue of integration tests, it would be ideal to be able to perform such tests on real test data, if this is impossible, you should use mocks - Mock, dummy object.


To sum up, when designing and then implementing any element - even the smallest one - of an IT system, the topic should be approached very abstractly. After doing abstract thinking - thinking about things that do not exist - we move on to strategy - planning and setting the goal we want to achieve - and finally there is tactics - we start taking action, i.e. implementing the plan. Taking into account the above methods of thinking, it is much easier for me to approach the creation and implementation of any application or IT system. I encourage you to use these methods.

Zdjęcie autorstwa Pavel Danilyuk z Pexels.