So, there are a bunch of questions appearing asking is X evil, is Y evil.

My view is that there are no language constructs, algorithms or whatever which are evil, just ones which are badly used. Hell, if you look hard enough there are even valid uses of goto.

So does absolute evil, that is something which is utterly incompatible with best practice in all instances, exist in programming? And if so what is it? Or is it just bad programmers not knowing when something is appropriate?

Edit: To be clear, I'm not talking about things programmers do (such as not checking return codes or not using version control - they're choices made by bad programmers), I mean tools, languages, statements, whatever which are just bad...

This question exists because it has historical significance, but it is not considered a good, on-topic question for this site, so please do not use it as evidence that you can ask similar questions here. This question and its answers are frozen and cannot be changed. More info: help center.

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
If this question can be reworded to fit the rules in the help center, please edit the question.

40 Answers
40

Increasing the total cost of the system for insufficient benefit. It could be too much copying and pasting, too complex an architecture, or using pricey but ineffective commercial products. Generally speaking all software techniques are aimed at reducing the total cost of a system, and if we end up with a overly expensive system then we have done wrong.

One size does not fit all. Stop. Right now, take out a fine-point marker and write on the inside of your glasses: Software Development Is Decision Making. "Think" is not a four-letter word. There are very few "never..." and "always..." rules in software — rules that you can apply without thinking — rules that always work in all situations in all markets — one-size-fits-all rules.

In plain English, you will have to make decisions, and the quality of your decisions will affect the business value of your software. Software development is not mostly about slavishly following rules; it is a matter of thinking and making tradeoffs and choosing. And sometimes you will have to choose between a bunch of bad options. When that happens, the best you can hope for is to choose the least bad of the alternatives, the lesser of the "evils."

You will occasionally use approaches and techniques labeled as "evil." If that makes you uncomfortable, mentally change the word "evil" to "frequently undesirable" (but don't quit your day job to become an author: milquetoast terms like that put people to sleep :-)

The problem with things like GOTO is that it's awfully hard to USE it in a way that's not nasty. Enough so that it's hard for me sitting right here now to think of an example of GOTO that isn't code smell. But I'm willing to accept that there might be such uses, and that the problem isn't the tool itself but rather the likelihood of its abuse.

Some programming instructions / style / conventions are very often misused to make terrible, evil if you will code, but in the hands of a master programmer they can be used in a very elegant fashion, good if you will.

On the other hand I know of nothing that can prevent incompetent or inexperienced programmers from from producing bad, evil if you will code even with the best tools, languages, and so on.

By avoiding often misused elements, such as goto, the hope is that mediocre programmers can avoid the evil and perhaps make it somewhat easier to write good code.

Nothing is really evil not even weapons, yet we sometimes consider them as such. However with weapons we usually have a certain level of respect, we are very much aware of their danger and use them with caution; however there are still people too stupid to use them.

The same applies to any tool, the more difficult the consequences of abusing those tools are, the more likely people are abusing them.

In programming everything is more or less virtual, a program is a representation of our thought process and the long term consequences of not understanding something entirely or getting it slightly wrong are a lot harder to determine, then the immediate danger of death we are faced with when handling a gun.

This makes the tools we use and have at our disposal a lot harder to use but it also gives us an easy way to measure the skill of a programmer. The knowledge of when and how to use the tools you have is crucial to become a good programmer. You can always play it safe by restricting the set of tools but just to the guy to whom everything looks like a nail, eventually you will encounter something that no amount of hitting will fix.

The only thing 'evil' is thinking that certain programming things are 'evil'. Various approaches - use this technique, dont use that statement, use this methodology, dont use that language, use this 'best practice', etc - are opinions.

Humans were created as beings with a free will. They may use their powers to go into the dark side or embrace the light side. This choice defines what comes out of their hands.

Now, those tools and frameworks were created by benevolent people who were genuinely trying to make things somehow better with a good will. Consequently, their creations (either successful or not is irrelevant) do not bear the imprint of evil. At the least they are neutral, but not malicious.

Then those tools come into the hands of other individuals. And whatever they do with them depends on those people. Even a debugger could be turned into an evil instrument in the hands of a hacker trying to remove the serial number check in some software.

But it does not redefine in any way the characteristic of the tool. They are all good. Some are more useful, some less. Some dangerous, some less. But still, they are all good and quite useful in certain scenarios.

And if a programmer by a mistake misuses a tool and causes damage, the tool does not become evil. It's just a programmer mistake, lack of knowledge, ignorance, whatever. But without any evil intent.