Note that there are some explanatory texts on larger screens.

plurals
  1. POBeing pressured to GOTO the dark-side
    primarykey
    data
    text
    <p>We have a situation at work where developers working on a legacy (core) system are being pressured into using GOTO statements when adding new features into existing code that is already infected with spaghetti code.</p> <p>Now, I understand there may be arguments for using 'just one little GOTO' instead of spending the time on refactoring to a more maintainable solution. The issue is, this isolated 'just one little GOTO' isn't so isolated. At least once every week or so there is a new 'one little GOTO' to add. This codebase is already a horror to work with due to code dating back to or before 1984 being riddled with GOTOs that would make many <a href="http://en.wikipedia.org/wiki/Pastafarian" rel="nofollow noreferrer">Pastafarians</a> believe it was inspired by the Flying Spaghetti Monster itself.</p> <p>Unfortunately the language this is written in doesn't have any ready made refactoring tools, so it makes it harder to push the 'Refactor to increase productivity later' because short-term wins are the only wins paid attention to here...</p> <p>Has anyone else experienced this issue whereby everybody agrees that we cannot be adding new GOTOs to jump 2000 lines to a random section, but continually have Anaylsts insist on doing it just this one time and having management approve it?</p> <p><strong>tldr;</strong></p> <p>How can one go about addressing the issue of developers being pressured (forced) to continually add GOTO statements (by add, I mean add to jump to random sections many lines away) because it 'gets <em>that</em> feature in quicker'?</p> <p>I'm beginning to fear we may lose valuable developers to the raptors over this...</p> <p><img src="https://imgs.xkcd.com/comics/goto.png" alt="Credit: XKCD"></p> <p><strong>Clarification:</strong></p> <p><em>Goto</em> <code>here</code></p> <p><code>alsoThere:</code> No, I'm talking about the kind of goto that jumps 1000 lines out of one subroutine into another one mid way into a while loop. <em>Goto</em> <code>somewhereClose</code></p> <p><code>there:</code> I wasn't even talking about the kind of gotos you can reasonably read over and determine what a program was doing. <em>Goto</em> <code>alsoThere</code></p> <p><code>somewhereClose:</code> This is the sort of code that makes meatballs <code>midpoint:</code> <em>If first time here Goto</em> <code>nextpoint</code> <code>detail:</code>(each one almost completely different) <em>Goto</em> <code>pointlessReturn</code></p> <p><code>here:</code> In this question, I was not talking about the occasionally okay use of a goto. Goto <code>there</code></p> <p><code>tacoBell:</code> and it has just gone back to the drawing board. <em>Goto</em> <code>Jail</code></p> <p><code>elsewhere:</code> When it takes Analysts weeks to decypher what a program is doing each time it is touched, something is deeply wrong with your codebase. In fact, I'm actually up to my <code>hell:</code><em>if not up-to-date goto</em> <code>4</code> rendition of the spec <em>goto</em> <code>detail</code> <code>pointlessReturn:</code> <em>goto</em> <code>tacoBell</code></p> <p><code>Jail:</code> Actually, just a small update with a small victory. I spent 4 hours refactoring a portion of this particular program a single label at a time, saving each iteration in svn as I went. Each step (about 20 of them) was smallish, logical and easy enough to <em>goto</em> <code>bypass</code> <code>nextpoint:</code> spontaneously jump out of your meal and onto you screen through some weird sort of spaghetti-meatball magnetism. <em>Goto</em> <code>elseWhere</code> <code>bypass:</code> reasonably verify that it should not introduce any logic changes. Using this new more readable version, I've sat down with the analyst and completed almost all of this change now. <em>Goto</em> <code>end</code></p> <p><code>4:</code> first *if first time here goto <code>hell</code>, no second <em>if first time here goto</em> <code>hell</code>, no third <em>if first time here goto</em> <code>hell</code> fourth <em>now up-to-date goto</em> <code>hell</code></p> <p><code>end:</code></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload