Social networks not learning anything from IM networks
No man is an island, entire of itself.
Social networks are popping up like zits on a teenager. Every network features a lot of the same functionality. You can designate people as a “friend”. Your “friends” can see what you post or do.
Another thing they all have in common is that they never read Donne. I have to add the same people on each network I join. Some of them let me import friends. But if I add a new friend on one, the new friend isn’t added to the other networks unless I manually make the connection. This isn’t a new dilemma. We had the same problem with Instant Messaging networks in the early part of the century.
What happened back then? Well, a bunch of different developers all reverse-engineered the different IM protocols and figured out how to integrate them into a single desktop client. The big vendors (AOL, Yahoo, Microsoft, and ICQ) drug their feet on interop. Now, we can finally add MSN Messenger contacts to our Yahoo client and vice versa (provided our friends are all running the latest version of either client). But with social networks we’re still stuck. Now a lot of the social networks are coming out with public APIs and Google has launched it’s OpenSocial platform. But that still doesn’t unite them, it just makes it easier for developers to write widgets/gadgets and applications for social networks. We still need a single point of contact for our social networks.
Modern Javascript Development: constructors and objects
JavaScript doesn't have a "class" keyword or any formal class construct. Instead, functions are 1st class objects. When you write a function, you are essentially writing a constructor for a new object.
Here we are defining a object constructor called "newClass" and assigning some member values.
-
function newClass() {
-
this.name = "newClass";
-
this.options = {size:42};
-
};
-
-
var myInstance = new newClass();
-
alert(myInstance.name);
-
alert(myInstance.options.size);
You can also specify arguments for the constructor just like any other function and assign the argument values to the objects members.
-
function newClassInitialzed(name, options) {
-
this.name = name;
-
this.options = options;
-
};
-
var anotherInstance = new newClassInitialzed("John", {size:42})
-
alert(anotherInstance.name);
-
alert(anotherInstance.options.size);
So what happens if you don't want to pass the name and options to the constructor every time? You can specify defaults for the member variables values using the logical OR ( || ) operator in JavaScript. The logical OR operator has a short-circuit which always returns "true" if the first argument is true.
-
function defaultArgValues(name, options){
-
this.name = name || "unknown";
-
this.options = options || {size:42};
-
};
-
var defaultArgsInstance = new defaultArgValues();
-
alert(defaultArgsInstance.name);
-
alert(defaultArgsInstance.options.size);
Since functions are first class objects, we can pass them as arguments in our constructors as well.


