Sentinel
Sentinel

Reputation: 461

Does anyone actually ever use Big-O notation?

When during actual development would you care? I understand that it is useful if you wish to compare the speed between two algorithms but is there any other practical use to it during every day development? For example, does anyone ever stop to look at their code and work out the Big-O notation?

Upvotes: 0

Views: 185

Answers (1)

Matt Jordan
Matt Jordan

Reputation: 2181

Among many things, I write image-processing code, where even a simple function might be applied billions of times per day.

So, I often include performance info in my code, and where applicable, that includes Big-O information.

Big-O notation is most useful in actual practice for library writers, since library code is always used in cases that were not originally conceived by the author, and such efficiency information can trace down performance problems without time-consuming debugging/profiling. This is true for internal projects within a company as with publicly-available libraries. Those who point out that publishers do not normally include Big-O information should be reminded that software just as often does not perform well either.

I see a trend toward less knowledge of algorithms, and more brute-force; this is not about a particular generation of developers, but rather a consequence of how many developers there are - the need for more developers has resulted in most not knowing even the basics of algorithms. Many don't even know what Big-O notation means, let alone how to apply it, whether choosing a library to use, or writing a library for others to use. Note that I don't think it is their fault, since there is clearly a focus on getting projects done, whether they are done right or not. The average life-span of code is decreasing, partially as a consequence of this.

So, to sum up, I would suggest that Big-O notation is very useful, but not used very often, and its use will decrease even more over time, leaving more developers scratching their heads as to why their code runs so slow. If you don't use it, don't feel bad, you're in the majority.

Upvotes: 1

Related Questions