Click here to Skip to main content
15,887,027 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: In defense of spaghetti code. *ducks* Pin
honey the codewitch17-May-23 4:21
mvahoney the codewitch17-May-23 4:21 
GeneralRe: In defense of spaghetti code. *ducks* Pin
Eusebiu Marcu18-May-23 0:21
Eusebiu Marcu18-May-23 0:21 
GeneralRe: In defense of spaghetti code. *ducks* Pin
honey the codewitch18-May-23 3:57
mvahoney the codewitch18-May-23 3:57 
GeneralRe: In defense of spaghetti code. *ducks* Pin
Eusebiu Marcu18-May-23 6:24
Eusebiu Marcu18-May-23 6:24 
GeneralRe: In defense of spaghetti code. *ducks* Pin
honey the codewitch18-May-23 6:45
mvahoney the codewitch18-May-23 6:45 
GeneralRe: In defense of spaghetti code. *ducks* Pin
CPallini17-May-23 20:29
mveCPallini17-May-23 20:29 
GeneralRe: In defense of spaghetti code. *ducks* Pin
Sander Rossel16-May-23 21:22
professionalSander Rossel16-May-23 21:22 
GeneralRe: In defense of spaghetti code. *ducks* Pin
ACRowland18-May-23 1:21
ACRowland18-May-23 1:21 
I don't think this is spaghetti code; it's just long and complicated. Spaghetti jumps all over the place and would obscure the actual logic far more than this example does (which is completely hypothetical. Not real world at all, by the way.)
Last year I tried a challenge -- to rewrite a hangman game from the late 70's, which was written in an early dialect of BASIC with GOTOs and GOSUBs all over the place, into a modern language. The code was very short, barely a page of A4 when printed out. But to understand this very simple program, I had to print it, and draw lines all over it to work out the program flow, which took over an hour. Imagine if it went to more than two sides of paper! I found a line that was unreachable and would never be executed. Even the person who wrote it wasn't aware. Just a bit of structure, named procedures etc. simplified and clarified it enormously.

But I suspect that what the OP is talking about is something a bit different from that. The code may have had a lot of IFs and branches, but writing it in a clear way with meaningful names, rather than abstracting it all to classes, may have been the right call in this instance. But do a reality check: give it to a colleague and see how long it takes them to figure out the flow and logic.
GeneralRe: In defense of spaghetti code. *ducks* Pin
glennPattonWork316-May-23 22:48
professionalglennPattonWork316-May-23 22:48 
GeneralRe: In defense of spaghetti code. *ducks* Pin
Jeremy Falcon17-May-23 1:40
professionalJeremy Falcon17-May-23 1:40 
GeneralRe: In defense of spaghetti code. *ducks* Pin
honey the codewitch17-May-23 2:24
mvahoney the codewitch17-May-23 2:24 
GeneralRe: In defense of spaghetti code. *ducks* Pin
Jeremy Falcon17-May-23 4:09
professionalJeremy Falcon17-May-23 4:09 
GeneralRe: In defense of spaghetti code. *ducks* Pin
honey the codewitch17-May-23 4:10
mvahoney the codewitch17-May-23 4:10 
GeneralRe: In defense of spaghetti code. *ducks* Pin
Jeremy Falcon17-May-23 4:15
professionalJeremy Falcon17-May-23 4:15 
GeneralRe: In defense of spaghetti code. *ducks* Pin
honey the codewitch17-May-23 4:18
mvahoney the codewitch17-May-23 4:18 
GeneralRe: In defense of spaghetti code. *ducks* Pin
Jeremy Falcon17-May-23 4:24
professionalJeremy Falcon17-May-23 4:24 
GeneralRe: In defense of spaghetti code. *ducks* Pin
honey the codewitch17-May-23 4:30
mvahoney the codewitch17-May-23 4:30 
GeneralRe: In defense of spaghetti code. *ducks* Pin
Jeremy Falcon17-May-23 4:57
professionalJeremy Falcon17-May-23 4:57 
GeneralRe: In defense of spaghetti code. *ducks* Pin
honey the codewitch17-May-23 4:58
mvahoney the codewitch17-May-23 4:58 
GeneralRe: In defense of spaghetti code. *ducks* Pin
Jeremy Falcon17-May-23 5:02
professionalJeremy Falcon17-May-23 5:02 
GeneralRe: In defense of spaghetti code. *ducks* Pin
honey the codewitch17-May-23 5:03
mvahoney the codewitch17-May-23 5:03 
GeneralRe: In defense of spaghetti code. *ducks* Pin
Nelek17-May-23 9:19
protectorNelek17-May-23 9:19 
GeneralRe: In defense of spaghetti code. *ducks* Pin
Jeremy Falcon17-May-23 9:50
professionalJeremy Falcon17-May-23 9:50 
GeneralRe: In defense of spaghetti code. *ducks* Pin
Jeremy Falcon17-May-23 4:11
professionalJeremy Falcon17-May-23 4:11 
GeneralRe: In defense of spaghetti code. *ducks* Pin
honey the codewitch17-May-23 4:12
mvahoney the codewitch17-May-23 4:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.