---
title: "Discussion on \"Code Smell 100 - GoTo\" | Hashnode"
description: "Discussion on \"Code Smell 100 - GoTo\". GOTO was considered harmful 50 years ago\n\nTL;DR: Don't ever use GoTo.\n\nProblems\n\nReadability\n\nHard to follow code\n\n\nSolutions\n\nReplace GOTO with structured code\n\nUse exceptions\n\n\nContext\nI started programming in Basic. \nGOTO was heavily abused there...."
url: "https://hashnode.com/posts/code-smell-100-goto/61870d4141f03514daf3f6a3"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Code Smell 100 - GoTo](https://maximilianocontieri.com/code-smell-100-goto?utm_source=hashnode&utm_medium=feed)

GOTO was considered harmful 50 years ago TL;DR: Don't ever use GoTo. Problems Readability Hard to follow code Solutions Replace GOTO with structured code Use exceptions Context I started programming in Basic. GOTO was heavily abused there....

Nov 6, 2021 · 2 min read · maximilianocontieri.com  
Read the article

-   [#programming](https://hashnode.com/tag/programming)
-   [#clean-code](https://hashnode.com/tag/clean-code)
-   [#refactoring](https://hashnode.com/tag/refactoring)
-   [#code-smell-1](https://hashnode.com/tag/code-smell-1)
-   [#programming-tips](https://hashnode.com/tag/programming-tips)

## Written by

[Maxi Contieri](https://hashnode.com/@mcsee)

@mcsee · Buenos Aires

  
[View profile](https://hashnode.com/@mcsee)

Software Engineer

I’m a senior software engineer loving clean code, and declarative designs. S.O.L.I.D. and agile methodologies fan.

## Responses 1

Markdown supported · ⌘↵ to post

[Oscar Ablinger](https://hashnode.com/@OscarAblinger)

[Nov 7, 2021](https://hashnode.com/posts/code-smell-100-goto/61870d4141f03514daf3f6a3/comment/6188603347828111df8008d6)

> Solutions
> 
> 1.  Replace GOTO with structured code
> 2.  Use exceptions

Imho exceptions aren't much better. They are essentially a `goto` where

1.  **_you don't know where you're going_**,
2.  you can send data with it (including context) and
3.  you can guarantee execution of code if needed (I've never really worked with `goto`s but I assume there is no equivalent to `finally`).

2 & 3 are nice and probably the reason why they are still used today, but 1 is terrible for understanding bigger systems.
