Wednesday, April 30, 2014

Top-down API design

Bjarne Stroustrup, the creator of C++, is believed to have said that programming in C++ involves writing libraries and then using them. Having worked with C++, Perl, PHP, Python and Javascript for the past ten years, I'm inclined to think the principle applies to more than one language. Especially the object oriented variety.

The idea makes sense. Large problems need to be broken down into building blocks. Then you must first build the building blocks before you use them to build the building. Build the building blocks wrong and the building comes out wrong.

How do you go about designing the building blocks? Based on your building's requirements, of course. Strangely though, in the world of computing, some programmers (including my past self) tend to forget this basic principle and try to stand the process on its head.

Friday, April 25, 2014

On social media and psychohistory

Every successful social network will eventually consider selling your data. The temptation is simply too strong. Contrary to what you might think, the true value of what's in Facebook's database is not in the personal information — in other words, it's not really about your name, face, address, friends, family, place of work, school etc. In fact, if you're a person who doesn't really mind Facebook (or even the government) knowing these details about you, I wouldn't really blame you. Well, at least not as much as some privacy advocates would. Because the real danger is elsewhere.

Psychohistory


In his 1951 science fiction novel Foundation, Isaac Asimov envisioned a discipline called psychohistory — a sort of advanced statistical sociology that allowed its practitioners to make highly accurate predictions about large populations over long time spans. In psychohistory, individuals and everyday events don't matter — there is too much uncertainty at that scale to make meaningful predictions. But when taken as a large population over time, people begin to exhibit patterns. Hari Seldon, the fictional creator of psychohistory, uses the equations of psychohistory to predict the collapse of the galactic civilization, followed by 30,000 years of barbarism. He then devises a secret, millennia-long plan to prevent this catastrophy.