haha thats my current collaboration project code and the team leader keeps looking for more programmer who thinks more is better. the ration is 7 programmers to one artist hahaah. just wanna share
get what you pay for.
Show him this book.
My code alone is so messed up, that if I take a break too long from programming it maybe easier for me to understand the decompiled code than the source code ![]()
That’s a good training, though. You’ll be dealing with spaghetti and horrible code a lot. Better get used to it now.
You use a lot of goto statements?
@alexzzzz thanks for the book interesting read.
@dinkeytom you dont have to use goto to make a spaghetti
If assembly can branch then why shouldn’t we goto? ![]()
At least it won’t be so bad if you have to eat the losses. It looks well seasoned.
What’s wrong with goto statements? Seriously. I use them all the time. Its so easy to debug too!
Having worked on many different code bases at various companies I agree with this completely. And it’s not just messy beginner code but also a common problem is people over-engineering everything generally because they read about something and were all excited to try it out. In either case you end up having to deal with a real mess.
You can even use goto in languages that don’t support it. All you have to do is wrap your code in loops to mark the code segments instead of labels. I think even java lets you break and specify a loop to break to with labels!
Praise the Update event! ![]()
My laziness always tempts me to just shove everything into the Update method. It takes days to move code blocks to separate methods and strip my scripts of all the garbage code and snipptets at the end of a project.
I think gotos are very useful for getting out of an if statement immediately. Its kind of simmilar to the break statement in a loop.
Im just careful to make it VERY obvious that there is a goto/label in the code, by making a large comment sections that explain there is a goto statement, becuase generally other people who read your code do not expect goto statements in a code written in an OO language like C#, and it can be sometimes hard to spot in the code.
Usually I’ll have
/*
*
* LABEL
*/
Label:
//
//
Honestly that doesn’t look anywhere near as bad as it could…

Looks bad. But assuming every one of those cables has a cable number on both ends and there is a proper drawing, then this sort of system is actually pretty easy to work with. Normally you work on them from the other side, which typically looks quite neat.
If the cables were installed without cable numbers, then someone deserves to be hung by them.
What I have to wonder is how they reach the hardware if they need to replace it. I’m assuming it’s on the other side but then I would have assumed someone would use colored cables rather than one solid color.
Typical use of goto is reaching “cleanup” code block in situation where exception handling or RAII is either not available, or is not desirable. However, there are groups of people that oppose all use of goto for religious reasons.
Basically, if you find yourself simulating flow control with exception handling, or writing fake loops (“while(true)” that doesn’t ever loop and has multiple breaks), goto may be the way to go.
Coloured cables have a specific meaning. I would imagine most of these cables would be multi core, so the colours would be on the inner cores, rather then on the outside. Then again American equipment manufacturers are notorious for having every wire the same colour, regardless of its use.
I’m just guessing based on how I would have designed something like this to be wired up. But standards for wiring vary dramatically from place to place. And everything I do normally has to be fit for hazardous areas. If it was on one of my sites all of that wire would be required to be constrained within conduits. It makes the whole thing look nicer, even if it doesn’t reduce the spaghetti like appearance of the cables.
That might not work well if the cables have uniform function.
Many colors will just create visual noise that will just make the whole thing even more complicated.

I’d guess you’ll need logical groups of cables there, use different colors per group, and have markers/stickers on cables indicating what is it, and where it goes
Better structure to the cable layout would go a long ways too.
