Niklaus Wirth famously titled his seminal book on Pascal as “Algorithms + Data Structures = Programs“. It is of course, implied that the programs were written in Pascal — the technology that is used to realize the programs. Technology then, is an essential ingredient to creating programs.
The technology has come a long way from Prof. Wirth’s time. Developers do not need to write their own quicksort implementations, they can use std::sort (or qsort or java.util.Collections.sort or System.Collections.Generic.List<T>.Sort or whatever). They need not implement hash tables, carefully analyze possible keys nor devise optimal hash functions — they can just use the friendly hash class from the standard library. No longer need to worry about creating efficient file formats to store your data, just use XML! They are an industry standard, you know. What’s that? Not efficient? Hmm, why not try Darby! Or Berkeley DB? Or shall we choose a programming language that can pickle or marshal or serialize everything in sight? Download a file given it’s URL? Surely there must be an API for that somewhere..
“[...] LAMP – the software platform comprised of Linux, Apache, MySQL and PHP/Perl often viewed as the foundation of the Internet” said someone recently.
Upcoming software developers and computer science students are often blinded and misled by technology. They tend to concentrate on learning about various technologies and how to use them. To be able to use a programming language, a few libraries, and some decent debugging and analytical skills can get you a job. Jobs. Good ones. You would, however, be wrong if you thought that that was what computer science is all about.
Here is a quick check: write a program to list all the prime numbers between 1 and 1 million. Think about how you’d write this program.
Thought about it? Well then, did you use the Sieve of Eratosthenes? What’s that you ask? Why, that’s a 22-century old algorithm (and a reasonably efficient one) that was developed because there was no API to list out all the primes!
Here’s another one: Your train goes over a hilly terrain, stopping at railway stations that are at varying altitudes. Which was the steepest climb? (Say station1 was at a height of 400 MSL (meters above sea level), station2 at 350, station3 at 500, station4 at 550, station5 at 480, station6 at 520; then the steepest climb was station2-station3-station4.)
The answer? Well, google for “longest monotonic subsequence”.
How about this one: How fast can you count the number of ’1′s in the binary representation of a given 32-bit integer?
A Google search for “rivers of somalia” returns “Results 1 – 100 of about 340,000 for rivers of somalia. (0.43 seconds)”. How do you think Google searches the contents of billions of pages to choose 340k of them in just 0.43 seconds?
How do you think this works?
How is an mp3 encoder able to compress a 50MB WAV file to a 4 MB mp3 file but still sounds the same?
What is the minimum required number of colors to paint a political map of a country, such that no two states that share a border have the same color?
What is the fastest way, using the NYC subway, of getting to Coney Island from Central Park?
Why can’t a C++ parser understand “vector<vector<int>> vvi;” ?
How does a spell checker suggest alternatives for misspelled words?
Algorithms lie at the heart of innovation. That’s how two university students beat Yahoo. Faster and efficient algorithms change the way we work, and live. Technology is a means, a platform to implement your new algorithm. It is not an end in itself.