# The importance of Logic for problem solving in programming.

Logic is the main basis of all software, which is why we must start from that point in order to coherently structure and organize a sequence of instructions in any programming language. We are always going to face different situations in which we have to apply clean logic, that is, structured and clear so that the code can be understood and executed properly with a mínimum of errors.

## Mathematical Logic To program

Mathematical logic is a complement that without a doubt we have realized is a fundamental part of programming, since we are at the University we see many topics related to arithmetic, calculation, linear algebra, equations among other things, all this knowledge with the purpose of being able to develop a more efficient analysis capacity in the labor area of any system, but in this case what is sought is to implement it in the creation of programs. We can practice with Mathematical Reasoning exercises but related to everyday life since that way we can understand it much better, such as:

You have 5 domino pieces in a vertical position, the first is 6-1, in the second 5-2, in the third 4-3, in the fourth 3-4 so you want to know which is the next one, in this part you have to analyze the numbers and the position of each chip to see what pattern it follows and thus we can conclude that the chip is 5-2.

Another example that we can give is a set exercise where we have group A and group B, so set A has a hammer, a saw and a screwdriver while set B has a drill, a screwdriver and pliers, wants to know the union of both, it can be stated that the new set is a hammer, handsaw, screwdriver, drill and pliers.

In this part we see how we associate things that we know by applying logic in different exercises to start practicing.

## Logic in Programming

Programming logic is making a computer fulfill certain tasks through ordered logical instructions that we create and it is in this part where we must apply the logic and mathematics that were previously seen to create an algorithm. In this case we must begin to know the language and its syntax, which in the majority implement similar structures with the same structures, simply study its rules and concepts that will be executed by the computer. Today there are countless languages with different uses, but with the same logic from which you can choose one to learn, obviously it will depend a lot on what you want to program.

In conclusion we can say that in order to have a good programming logic it is first necessary to have a mathematical logic, since we must remember that mathematics is the basis of programming since without it there would be no hardware or software. That is why we must know the fundamentals in mathematics well to understand programming. Although in a certain way many relate programming with equations. It really isn't difficult to program, but what is complicated is having that logic so that component works.

We recommend you read: Algorithmic Techniques Applied to Software Development (Opens in a new browser tab)

Leave a Reply