In medical school they teach students:
"If you hear hooves, think horses not zebras".
In other words, look first at the simplest explanation for a problem.
What's a programming example of this?
In medical school they teach students:
"If you hear hooves, think horses not zebras".
In other words, look first at the simplest explanation for a problem.
What's a programming example of this?
People blaming the CLR whenever their C# / VB.Net program behaves unexpectedly
It's far more likely that you have a bug in your program than there is a bug in the CLR that only your program exposes.
Any SO C++ question which contains the phrase "is this a bug in the compiler"
Not programming-specific, but Occam's Razor comes to mind:
"Entities should not be multiplied unnecessarily."
Or, in the original Latin:
"Entia non sunt multiplicanda praeter necessitatem."
// My template vector
template<class T>
class vector { };
vs
std::vector<T> dont_fight_stl;
?
90% : Is the app configured correctly?
9% : Does the code handle all possible errors reasonably?
1% : Is the code wrong?
I think it was jwz who said:
Some people, when confronted with a problem, think "I know, I'll use regular expressions." Now they have two problems.
Regular expressions are great, but don't fall into the trap of using them for everything.
I often see people jumping to heap corruption when, in reality, they simply have some sort of multithreaded synchronization issue.
I think some people may not understand the question. The question is about simplicity. It is a form of Occam's razor. The quote is trying to convey that zebras are exotic and it is far more likely that we'd be hearing horses (this would be an example given in the western world and not Africa btw).
I suppose for myself an answer would be (but certainly not the only one):
When the code doesn't compile think typo and not any number of more complex answers.
OR more recently:
When a method won't accept the standard documented input, think namespace conflict and not obscure bug effecting you that no one else on the planet has noticed. [Which is my own version of JaredPar's]
Raymond Chen's blog has a entry today on this topic.
In his example, duplicate GUID's were encountered. This could be due to fundamental problems in the GUID algorithm, NIC's with identical MAC ID's, etc.
Or someone just copied the GUID.
A similar concept in software is often borrowed from the Pragmatic Programmer:
``select’’ Isn’t Broken It is rare to find a bug in the OS or the compiler, or even a third-party product or library. The bug is most likely in the application.
I can't tell you how often people concoct these wild theories about why they are getting file 'bla' not found
errors without even checking whether the damned file actually exists or not. And in 99% of the cases it turns out that when your computer tells you that it cannot find a file, it's not because the file finding algorithm has a weird heisenbug that only affects you, but rather because there is no such file!