views:

277

answers:

7

I have been looking at a lot of these questions asking for the "best" way to do this or the "best" way to do that.

  • Does one person's best way make it every person's best way?
  • Can there really be a "best" way to do a particular algorithm or to solve a problem?

  • What are the dangers of looking for a best way over just getting the problem solved in any way?

+2  A: 

No.

It's the old philosophers question. Perfection cannot exist as if it were to exist it would not be perfect. Anything in reality is never perfect due to the imperfections of our world, weathering (be that natural or man made) would immediately occur rendering it imperfect.

Best doesn't exist. "Better" does but "better" depends on the context. E.G. "xyz is better for this scenario".

Trade-offs is the word you are looking for. Each decision has its trade-offs and the "better" trade-offs depend on your context.

Quibblesome
A: 

All alternatives for a solution should be evaluated and the chosen solution should be the one best covering all the requirements for the least price. One man's best is not another the other's best.

Ido
I strongly disagree:Considering all alternatives will definetly take to long. Just consider the choice of the programming language for the next project.Hundreds of choices and even if you limit yourself to the few probable ones you have half a dozen choice which probably don't offer any real benefit
Jens Schauder
I didn't mean this so literally but it is better to consider a few alternatives and weighing the cons and pros of the relevant options you have on you table before making a choice.
Ido
+4  A: 

Jeff - this is something that my coworkers and I go back and fourth on. They continually are looking at the best way in terms of technology implementation and best practice, while as a business analyst I focus more on the delivery and getting the problems at hand resolved.

This is certainly a question of value proposition and I think that it comes down to maintainability and performance. If the change being made or the code is not maintainable or easily changed, then it becomes an issue and should be re-evaluated for best practices. If the code in question is sluggish and performance is a concern, then it probably should be modified.

While there are more than 10 ways to skin a cat or code an algorithm, there may not necessarily be a best, but there is almost always a better and worse. Check out the topics of code smells, may be a good place to start.

RSolberg
A: 

No for any reasonable complex problem you get tons of solutions which might be the best depending on the exact circumstances BUT

In many cases there is a best default solution that should be considered the best solution until you learn about a reason why this isn't the case.

Example: There are hundreds of way to sort a collection. But if you don't know anything more about the problem the api provided method is a good guess.

Jens Schauder
+1  A: 

The best solution, everything else being equal, is the one that the team working on the problem understands well enough to implement properly.

N8g
+1  A: 

"Best" can mean a number of things in computer programming, e.g.

  • Fastest
  • Lowest memory usage
  • Simplest

And even these things can mean a number of things, e.g. "fastest" could mean "lowest latency" or "highest throughput", or could even mean something like "lowest amortized latency" which might take into account the best and worst possible cases of the approach, and the distribution between the two.

So if each facet of the approach is optimal for all possible definitions of "best" and its constituent parts, then yes there is a best approach. But this is very rare for all but the simplest of cases.

Greg Beech
If in doubt, I prefer to go for 'simplest'.
Treb
A: 

I think they all mean "best under the circumstances" , there is of course no universal best. And if there is , it's just waiting for the next best to come along and take it's place!

Learning