3.24.2009

Social networking

Almost weekly I hear someone or read something by to the effect of complete lack of understanding of why anyone would use a service like twitter. "Do you really want to know that your friend is eating a sandwich?" Of course not. The truth of matter is most people really suck at online social networking. Blogs, Facebook, twitter, most people write things that are useful to no one. This becomes amplified by a site like twitter which has no intrinsic usefulness and the utility is completely based on what you say and who you follow, so the media is baffled why it is so popular.

Let me start with Facebook. When Facebook was first released it was a site for university students so they could connect with other people in their classes. Over time it has evolved and has lost the utility to students and has become a more general networking site which aims to simply keep people connected. This is the general trend of web services for a while now. Being social creatures, everyone wants to be connected with people, and the web is an amazing tool for this purpose, however most people are clueless about it.

When Facebook first started the transition over to general purpose networking, the first effect was USELESS applications. Everyone could not wait to send everyone they knew an egg that would hatch into a puppy 10 days later, or super poke, or any other of the countless annoyances. Why did this happen? Sending someone an egg that hatches into a puppy is not particularly useful to anyone! It does however initiate and continue social contact with the recipient. These new facebook applications allowed people to seek attention from their friends in a new way, and that is all people want.

This is the problem with all new social media. People want attention. So if there is a way to get attention from friends or strangers people will use the service to accomplish that, even if it has no other utility. Yet even though most of the applications are useless there are plenty of features on facebook that are genuinely useful to me and so I continue to use the service.

Blogs. There are countless blogs that meaningless to me. I do not care about the life updates about everyone I have ever met. However I do care about what is going on in my friends close friends lives. Anything my closest friends and family choose to write about I care about, because I care about them. This is great because I can choose to follow my friends with an RSS feed and read their thoughts, but I am only going to read blogs about topics I care about.

Enter twitter. I genuinely care about what is happening in my friends lives and want to see their twitter updates. Even if only a small percentage of their tweets are something that I care about, I am happy to know what is going on in my friends lives. Just like facebook it seems the majority of people are idiots and think everyone will care about everything they do. This is what the media picks up on and why everyone is clueless what purpose twitter poses. For the people who use twitter like a game and see how many people they can get to follow them, twitter is not going to be of much usefulness. Directly analogous to the people who try to set a record for the largest facebook group. However both services have utility if used to keep connected with the people you actually care about.

Most people suck at twitter, and all social media. Just ignore them. These user driven sites work if you interact with users you care about, and not morons.

3.08.2009

Functional Programming

I have recently fell in love with functional programming. I am learning Haskell and loving it and would like to share the story.

Recently I made some real progress on my Chinese Chess application which I will eventually put on Facebook. It is written in python and the rules of the game are pretty much complete and so I can run through a bunch of simulated games where each side makes a random move each time. I now have to design and create an interface for it so the game can actually be played. I am making a web app for it and going to use jQuery to help me out with it.

In learning jQuery and implementing my python I started to fall in love with functional programming. To generate the legal moves for a piece I used map and filter. These are functions which take a list and another function as their input. Then they go through the list applying the function to each element on the list. While this can be done with a loop its is much cleaner with these higher order functions. It took me a while to realize how passing a function as an argument to another function is amazing, it is like magic.

This came up again in jQuery. jQuery is a javascript library that makes doing useful things with JavaScript much easier. The amazing part is that it takes advantage of passing functions around as well. While I am still learning javascript I already am loving the functional parts of it.

All these functions prompted me to take the plunge into Haskell. Haskell is a pure, functional, and lazy programming language. It is a whole new way of thinking about programming for me, and so far I am in love with it. As an example let me show this piece of code I wrote which still blows my mind:

derivative f = (\x -> (f (x+dx) - (f x) ) / dx)
where dx = 0.0001


This is a function, that takes another function and returns the derivative of that function! What?! To show you what it does

Main> (derivative sin) 4
-0.6536057796480144
Main> cos 4
-0.6536436208636119


the inaccuracy is only because dx is set to be 0.0001 rather than an infinitesimal but that is all it takes to create calculus!

While I am certainly not proficient in Haskell yet I am having tons of fun reading through http://learnyouahaskell.com. After just the first few chapters my head exploded a few times but I was able to solve the first 10 project euler problems with Haskell.

The only problem I have with learning functional programming is the frustration when first class functions are taken away from me. In my parallel computing class I have to write MPI programs in C or FORTRAN. I do not think MPI supports first class functions, but I keep wanting to pass functions to other functions! I will be posting more about my progress with my chess application and functional programming progress shortly. I feel I am progressing quite a bit as a programmer which feels nice.