Your code will be more readable by others.If you don’t want that, then this is nothing for you! 🙂
If you want to have disadvantages then you have to compare them somewhere.If you think of object-oriented languages then you are wrong because OO is structured. But I will come back to that.
The first higher programming language was Plankalkül and it did not do much special.And from the outset had these statements, iterations and conditions. And that is the basis for programming. The rest is all structure and many people do not realise it but with programming you are mainly working with structures.
Programming is in a car step and drive though.But to make that possible you need a complete road network where you can go all the way. And that road network is the structure of programming. You explain all sorts of jobs, splits and roundabouts where the code eventually runs through.
But what is structured programming eventually?This is mainly the focus on the three basic principles that are mentioned on Wikipedia sequence, selection and iteration. The code was written in advance in a flowchart and not much later was replaced By a Nassi-Shneiderman diagram.The latter appears to enforce even clearer structure in the code. This is the structured export of code. In short, you do not have to drive over the grass or through a house to reach your goal.
An important problem with this was in former times the GOTO command, in which you can sprint in your code from one place to another.A teleporter in your car, so. This command makes the code hugely opaque if you use it a lot.
But what is OO really?I wanted to come back to that. Because as I said, programming is just a matter of sequences, selections and iterations within a structure. The only thing OO does is to apply an even more complex structure that ultimately makes the code even more readable. This is because blocks of code are now logically linked together and you can use your objects as a type of black box. What happens is not interesting but there are a number of connection points that make it possible to use this box.
So OO is actually more-more structured programming.And this is especially necessary for large projects with lots of parts.
If you create a village then you need little structure.A long way with some driveways for every home and you’re done. But for a city you need several roundabouts, traffic lights, intersections, bridges, tunnels and other objects to build a good road network.
Similarly for programming.If you want to put together a short program quickly, ANSI C is the most appropriate language.Just nicely straight-forward and ready. But if your program is already a bit more complex, using objects is already a lot more convenient and, for example, you move to C++ or C#.In fact, you only choose the programming language after analyzing the issue you want to solve. First look at what you want to make, then choose which language you can deliver the best solution.
Is there no disadvantage to structured programming?Well, because structure is always a part of programming, you always have to deal with it. But the complexity of the structure can affect it. If I need to create a program that calculates the highest value from a series of digits, the least structured language is already good enough. That could be in the old BASIC with those line numbers for each sequence and all GOTO commands. The structure is worthless, but it is present. If I try to solve this in C#, I am trying to choose all sorts of objects to be able to read the data and walk through and all sorts of other bells and whistles. Luckily, C# already has a standard library with a huge lot of predefined functionality so that I can give the answer with 1 LINQ statement. Only a lot of it comes to mind…
In contrast, if you want to make a website like Quora, BASIC is not really a good choice, because you write a lot of code and this will not be readable over time.You have to actually bring parts of your code to a more abstract layer and that’s what OO actually does. You then work with black boxes that you link to each other. And several black boxes can be put together in a bigger black box and then you only have 1 box to work with.
Structured programming is basically dividing code into logical blocks so you can program each block separately.And whether these are procedures or objects does not matter.