I was working on a Simulink model recently and was using Goto
and From
blocks to keep a very busy system from becoming a twisted mess of wires. I was informed that I was not to use Goto
and From
blocks as they are considered bad style (at least, according to my employer).
While I hold that wires should be kept connected whenever possible, I believe that Goto
and From
blocks can significantly improve the readability of a system/subsystem if the model would result in lots of crossed wires otherwise; especially if the blocks can be color-coded (e.g. purple Goto
block goes to all the purple From
blocks).
I'd supply an image of the subsystem I'm working with, but I'm not sure I can put it on here. The subsystem itself has about 12 subsystem blocks (and possibly more later) within it, each with two bus-type outputs. The first output of each subsystem goes to a Bus Creator
block, and the second output of each goes to a second Bus Creator
block. Since the subsystem are aligned vertically and the Bus Creator
s are to the right, this results in many crossed wires. I was using Goto
and From
blocks to clean up the system.
I can supply an image of a smaller, but similar model that I put together for this question.
For a system with on the order of 12 subsystems, this becomes very busy. I was using Goto
and From
blocks to connect the subsystems and the Bus Creator
s without a plethora of crossed wires.
I believe my employer may be carrying the stigma of using goto
statements from text-based languages and applying it to Goto
/From
blocks in Simulink. Generally speaking, is using Goto
and From
blocks in this way (or any way) considered to be bad style?
Goto
blocks are not necessarily bad style. Together with buses, they are a valid approach to avoid a mess of wires. – Karlo