Go to statement considered harmful. Author: Edsger W. Dijkstra, Technological University, Eindhoven, The Netherlands View colleagues of Edsger W. Dijkstra . “GOTO considered harmful” needs to be read in its historical context, where structured programming (for Thanks for posting Dijkstra answer. One of the comments did mention Dijkstra’s article Go to Statements Considered Harmful, but aside from that mention, there was much.

Author: Yozshugami Vokazahn
Country: Mauritius
Language: English (Spanish)
Genre: Travel
Published (Last): 27 February 2017
Pages: 31
PDF File Size: 13.22 Mb
ePub File Size: 20.53 Mb
ISBN: 443-2-96177-248-7
Downloads: 68941
Price: Free* [*Free Regsitration Required]
Uploader: Nikogul

The abuse of GOTO is, thankfully, a long forgotten memory in today’s modern programming languages. GOTO isn’t all badthough.

What Dijkstra said was harmful about goto statements | Dr Dobb’s

It still has some relevance to today’s code. Along with many other programmers, I always recommend using guard clauses to avoid arrow codeand I also recommend exiting hoto from a loop as soon as you find the value you’re looking for. The publication of such an goho paper in this particular format led to an almost immediate snowclone effectas documented on Wikipedia:.

That’s easily one of the funniest things I’ve ever read in Wikipedia.

Who says computer scientists don’t have a sense of humor? But here’s what they might not know about it:.

In other words, Wirth poked and prodded the content until it became incendiary, to maximize its impact. The phrase “considered harmful” was used quite intentionally, as documented on the idjkstra excellent Language Log:.

I’d Consider That Harmful, Too

I’m sure it’s not the earliest example of this phrase used in a headline or title, either — Harmfu chose it only as a convenient illustration of susage a couple of decades before the date of Dijkstra’s paper.

Note that this example is also in the title of a slightly cranky letter consdered the editor – it’s probably not an accident that the first example that came to hand of “considered harmful” in a pre-Dijkstra title was of this type.


So when you emulate the “considered harmful” style predicated on dijksrta work of these famous computer scientists inkeep that history in mind. You’re emulating a slightly cranky letter to the editor. It’s frighteningly common– there are now 28, web pages with the exact phrase “considered harmful” in the title.

He points out that choosing this style of dialogue is ultimately counterproductive:. If you have a point to make, by all means, write a great persuasive essay. got

“GOTO Considered Harmful” Considered Harmful () [pdf] | Hacker News

If you want to maximize the effectiveness of your criticisms, however, you’ll leave “considered harmful” out of your writing. The “considered harmful” technique harkful have worked for Dijkstrw and Dijkstra, but unless you’re planning to become a world famous computer scientist like those guys, I’d suggest leaving it back in where it belongs. For a number consideeed years I have been familiar with the observation that the quality of programmers is a decreasing function of the density of go to statements in the programs they produce.

More recently I discovered why the use of the go to statement has such disastrous effects, and I became convinced that the go to statement should be abolished from all “higher level” programming languages i. The publication of such an influential paper in this particular format led to an almost immediate snowclone effectas documented on Wikipedia: Dijkstra’s own response to this controversy was titled “On a somewhat disappointing correspondence”.

But here’s what they might not know about it: In order to speed up its publication, the paper was converted into a “Letter to the Editor”. The phrase “considered harmful” was used quite intentionally, as documented on the always excellent Language Log: However, “X considered harmful” was already a well-established journalistic cliche in — gtoo is why Wirth chose it.


The illlustration below shows the headline of a letter to the New York Times published August 12, He points out that choosing this style of dialogue is ultimately counterproductive: There are three primary ways dijkstrs which “Considered Harmful” essays cause harm.

The writing of a “considered harmful” essay often serves to inflame whatever debate is in progress, and thus makes it that much harder for a solution to be harrmful through any means. Those who support the view that the essay attacks are more likely to dig in and defend their views by any means necessary, and are less receptive to reasoned debate.

Andrew Koenig

By pushing the opposing views further apart, it becomes more likely that the essay will cause a permanent break between opposing views rather than contribute to a resolution of the debate.

The publication of a “considered harmful” essay has a strong tendency to alienate neutral parties, thus weakening support consideged the point of view the essay puts forth. A sufficiently dogmatic “considered harmful” essay can end a debate in favor of the viewpoint the essay considers harmful.

They’ve become boring cliches. Nobody really wants to read “considered harmful” essays any more, because we’ve seen them a thousand times before and didn’t really ggoto anything from them, since we were too busy being annoyed to really listen to the arguments presented.