Flowchart to code conversion

0

I'm trying to convert a sizeable flowchart to Arduino code. The flowchart is as follows:

Considering your size I would feel more comfortable using the goto command as a flow control. However I have always heard that its use is a bad programming practice, since it becomes easy to get lost in the flow of the program and end up with something impossible to be debugged. In this particular flowchart what would be the best option to use, cycles or the goto ?? Command?

    
asked by anonymous 18.06.2016 / 10:23

1 answer

2

Anyway. After all this flowchart is an excrescence :) Thing made because who is not a programmer.

Actually flowcharts are horrible. They served well in the 50s / 60s in very small codes. They even serve to give a basic instruction for a beginner to understand the flow of code. In fact they are even reasonable in the hand of who knows how to use them. It is not the case who did this. The error starts with the basics where the person only knows two execution blocks. He is lame and is macarronic . I tried to follow him and bent my head: D

Flowcharts encourage the use of goto (an instruction that actually should be avoided, but not completely abolished Although it is possible to do structurally, it is rare to do.

Following this flowchart really makes it easier to use goto . If you try to turn this into more structured control blocks, you will end up changing a little, or a lot, what it does, even if the result, in theory, is the same.

To be honest, I'd throw it away and do something else. If this is the only source of information about the problem, I would interpret it, understand the problem, and make a code without relying on it.

If you do not want to follow the advice there seems to be better to use goto same, trying to modify the flow of something so confusing can give too much trouble.     

18.06.2016 / 12:48