Back from China

We just got back from spending 12 amazing days in China.  Given the 12 hour time difference, I feel a bit like the Panda in the picture below and a more detailed set of impressions will have to wait.  But one thing is for sure - it’s hard to look at the world in quite the same way once have seen China first hand. Just one example: we had flawless mobile phone coverage including data everywhere we went including a boat trip down the Li River and a visit to the rice terraces of Longsheng.  Hence my steady stream of foursquare checkins.

PS I am beginning to work through my email backlog.  Thanks for everyone’s patience and help during this trip.

Posted: 31st May 2012Comments
Tags:  China vacation

Off the Grid (China Edition)

We are about to go on a trip to China and I couldn’t be more excited.  I have never been to Asia before and am looking forward to the experience.  China in particular has held my fascination since taking Roderick MacFarquhar’s amazing course on the Cultural Revolution in college.  And now of course China has been seeing dramatic economic growth with a domestic Internet population that is approaching 500 million users.  For a variety of reasons that include language and culture but of course also politics and the great firewall the Chinese Internet market is completely dominated by local companies.  While this is mostly a family trip, I am hoping to spend some time learning more about that as well.  In any case though, I will be (mostly) off the grid for the duration of this trip including a break from blogging and Continuations will be continued upon our return. In the meantime, a big thanks to all the people who contributed ideas and connections for this journey.

Enhanced by Zemanta

Posted: 16th May 2012Comments
Tags:  vacation China

Tech Tuesday: Literals, Constants and Variables

I may have lost a bunch of Tech Tuesday readers with that post on semantics last week, so today I am hoping to gain some back with a much easier topic!  We are continuing the cycle on programming by looking at how programs refer to things.  Again let’s start by looking at human language.  If I say “William Henry Gates III” then I am referring to the co-founder of Microsoft by his full given name.  In the right context I could simply say “Bill” and everyone would know who it was.  Alternatively, I could say “co-founder of Microsoft” and that could mean either Bill Gates or Paul Allen.

In programming there are concepts that correspond to each of these three different expressions.  The first are so-called “literals” — they are values that appear directly in the program.  A value could be a number or it could be a piece of text.  For instance, the following piece of Javascript code when run in a browser will pop-up an alert box that says “William Henry Gates III”

alert("William Henry Gates III");

Now you might find it takes you too long to type that everywhere in the program that you want to do this.  So you could instead write

const BILL = "William Henry Gates III";
alert(BILL);

at every later time you want to do the same thing you now just need an alert(BILL).  The first line defines what is known as a constant (this is Javascript, but not supported by all browsers).  You can think of a constant as a way of referring to a value that does not change.  In this program BILL will always be replaced with “William Henry Gates III”.

Why might you want to have a constant instead of a literal?  We already saw one reason - to be able to use a shorter name to refer to something longer (not much longer in the example, but could be much much longer).  Another and stronger reason is if you have a number that has a meaning. Compare the following two pieces of code

alert(42);

and

const MEANING_OF_LIFE = 42;
alert(MEANING_OF_LIFE);

Now instead of having the literal number 42 throughout, you can refer to it as MEANING_OF_LIFE.  That’s not only clearer for someone reading the code but also lets you subsequently make a change to the code should you realize that the value should really have been 13.  The change now needs to be made only in one location where the constant is defined, i.e. const MEANING_OF_LIFE = 13 — all the rest of the code can stay the same.  That’s much preferred over a global search and replace, because what if you have a 42 somewhere else in the program that is supposed to stay 42 because it refers to something else?

That brings us to variables.  Like a constant, a variable is a name that we can use to refer to a value, but unlike a constant that value can change over time.  So we might have code as follows:

var coFounderOfMicrosoft = "Bill Gates";
alert(coFounderOfMicrosoft);
coFounderOfMicrosoft = "Paul Allen";
alert(coFounderOfMicrosoft);

The “coFounderOfMicrosoft” is the name of the variable and “Bill Gates” or “Paul Allen” are the values that it refers to in the example above.  The first line of this code snippet uses “var” to declare that what follows is a variable.  In Javascript this declaration is optional and you can just assign a value to a name without it but it is considered bad form to just introduce names without declaring them first.  The third line assigns a new value to the variable.  Here we omit the “var” because we have already declared the name above and only want to change its value.

The ability to have names to refer to different values is essential to programming.  Programs based only on literals would be quite boring.  You would not be able to keep track of intermediate results and it would be quite difficult to write programs that take inputs from the user (where would you keep those?) as part of their processing.  So the concept of a variable seems obvious and straightforward and yet as we will see when we look a bit deeper in a future Tech Tuesday there is a lot more to it and you can get a glimpse of that by looking at the following code:

var coFounderOfMicrosoft = "Bill Gates";
var myName = coFounderOfMicrosoft;
coFounderOfMicrosoft = "Paul Allen";

In the second line we are declaring a new variable and assigning an existing variable to it.  What does that do? The answer is far from obvious and is something that gives rise to a lot of issues which we will look at in subsequent posts.  For now, just think about what you expect myName to refer to once the third line of code has also been executed. Is it “Bill Gates” or “Paul Allen”?

One important thing to note is that just because you give a variable a name that is meaningful to a human it doesn’t mean anything to the computer (remember that discussion of semantics?).  For instance, the following is a perfectly legit bit of code that won’t produce a syntax error since it is syntactically correct and won’t produce a complaint about semantics (because the computer has no external knowledge):

var coFounderOfMicrosoft = "Napoleon Bonaparte";

This is the first example of something I call “The Program Is All There Is” or TPIATI. For you as the human reader of the code there is a lot of knowledge that tells you this is wrong.  For the computer it just says make a variable named “coFounderOfMicrosoft” and give it the value “Napoleon Bonaparte” — and it will happily do just that.

As an aside, you may have noticed that I used ALL CAPS for the name of the constant, but so-called camel case for the name of the variable.  In Javascript, those choices are based on convention — they are not a requirement of the syntax of the language.  In Javascript “mIX1ng_CAS3” would be perfectly allowed as either a variable or constant name.  The convention of using ALL CAPS for constants is relatively common across most programming languages.

Tech Tuesday will be taking a break for the next two weeks as we will be going to China on a family vacation and I am not planning to take a laptop along.  We will resume in the first week of June.

Posted: 15th May 2012Comments
Tags:  tech tuesday variables literals constants

What’s $2B Among Friends?

During the 2008 crisis, I argued that we should take over the big banks and restructure them.  Instead, we bailed out the banks with tax payer money and with an unprecedented increase in the Fed’s balance sheet.  We did nothing to get rid of banks that are “too big to fail” or to severely restrict their activities (which might lead them to break themselves up).

So yesterday, JP Morgan Chase had to announce a $2 Billion trading loss from what they claim was a hedge gone wrong in Credit Derivatives but looks awfully like rogue trading activity.  This particular error may be one the bank can absorb but I don’t understand why we would let this go on until we are at another crisis that can only be resolved by a government bailout.

It will be interesting to see how this issue makes its way into the upcoming presidential election campaign here in the US. While I have been disappointed with many aspects of President Obama’s first time I hope he makes this a part of his agenda going forward and in a second term would actually do something about it.  His support for gay marriage is a welcome sign of what might be a more principled stand (hope springs eternal). 

Posted: 11th May 2012Comments
Tags:  banks jp morgan chase trading politics obama

Wag.com #thistimeitsdifferent

Yesterday, I tweeted that 

with the following picture

and got quite a few replies and retweets.  Some people saw it as a sign of a potential new bubble (or even the imminent collapse of the same) while others said they were happy users of the service.

Those different reactions reflect the importance of approaching a recurrence with an open mind:

  1. Just because something has been tried before and failed (even failed spectacularly) doesn’t mean it won’t succeed at a later point.

  2. If you are doing something that has been tried before and failed, you need to have a point of view about how what you are doing is different.

  3. There are at least four possible sources of difference: different strategy, different execution, different design, different environment.

In the case of Wag.com there is a ton that’s different compared to Pets.com along all four of these categories.  For instance, the site is part of Quidsi (diapers.com, etc) which in turn is part of Amazon!  The total amount of ecommerce has skyrocketed since the days of pets.com.

With those differences there is a very good chance that Wag.com will work.  So #fullcircle as my choice of hashtag was wrong as it implied that it is the same as before.  I am “amending” my tweet to #thistimeitsdifferent. 

Posted: 9th May 2012Comments

Tech Tuesday: Semantics

During the last Tech Tuesday we talked about the syntax of programming languages as part of the cycle on programming.  That’s a term you will hear frequently in no small part because when you get it wrong the computer will complain about it with a “syntax error.” Today’s topic is much more elusive and less talked about: semantics or what a program “means.” The “means” is in quotation marks because paraphrasing Bill Clinton, the answer depends on what the meaning of the word “means” is. Yes, semantics is an area that can make your head explode if you think about it too hard.

Before we dive in a bit, why should you even care about semantics?  Tons of code gets written every day without heads exploding as people think about what that code “means” for the computer.  Still, I am convinced that spending some time learning and thinking about semantics will ultimately make you a better programmer. While the field is full of very theoretical ideas that you could get lost in (which is fun in and of itself), exposure to it will help you appreciate why some code is better than other code (for some meaning of “better” :) that will hopefully become clearer during this series of posts).

To prevent heads from exploding, here is a simple crack at understanding semantics. Think of it as a formal description of the steps that a hypothetical computer will perform when it executes a program.  This approach is known as operational semantics and is the only one we will cover here (see here for others).  Lets unpack this a bit.  The “hypothetical” is there because semantics doesn’t operate at the level of a hardware configuration by tracing the steps inside specific CPU but concerns itself with a higher level of computation (and that’s OK because those execution details don’t matter for the meaning of the code).

The “formal” bit is there because semantics is not some vague description of meaning in say English but rather a precise set of rules.  At this point some alarm bells should start to go off.  What language exactly are we using to describe those rules?  Ah, welcome to the rabbit hole. There are several possible, closely related and equally intriguing answers. One answer is to use formal logic, such as the lambda calculus. The other answer is to use the programming language itself.  Come again? Yes - as it turns out for a whole bunch of programming languages you can describe the rules for what the language means in the language itself.  That results in what is known as a meta-circular evaluator and is not half as crazy as it sounds.

Most of this was first figured out in the creation of LISP, which in various incarnations still remains the most intriguing programming language.  John McCarthy wrote a seminal paper titled “Recursive Functions of Symbolic Expressions and Their Computation by Machine, Part I” in 1960 (aside: there never was a Part II).  The opening paragraph of the most important section is:

We shall first define a class of symbolic expressions in terms of ordered pairs and lists. Then we shall define five elementary functions and predicates, and build from them by composition, conditional expressions, and recursive definitions an extensive class of functions of which we shall give a number of examples. We shall then show how these functions themselves can be expressed as symbolic expressions, and we shall define a universal function  that allows us to compute from the expression for a given function its value for given arguments.

The basic idea is that McCarthy is formally defining the meaning of the LISP language using only the elements of the language itself (which also happen to draw closely on the lambda calculus).

Even if you don’t immediately see the benefits of doing this, there is something wonderfully appealing about having a language describe itself (and of course that is usually what we do when we explain the meaning of an English word to someone else — we use other English words!).  As it turns out this is a very powerful idea and as we go through more of the concepts behind programming in upcoming posts we will come back to it repeatedly, for instance in looking at what an interpreter does or learning about data types.

Posted: 8th May 2012Comments
Tags:  tech tuesday programming semantics

Europe at Risk and What it Means for US Startups

Europe had three elections on the weekend: presidential in France, parliamentary in Greece and regional in Germany.  The results are strongly anti-incumbent across he board.  In France, Sarkozy is out and Hollande is in.  In Greece, the PASOK party went from 160 to 41 seats and no longer has a majority together with New Democracy the other incumbentAnd in Germany in the regional elections in Schleswig Holstein, Angela Merkel’s CDU had the worst results since 1950.  

The results are also strongly anti-austerity because that was the policy pursued by the incumbents.  The Euro is now at a 3 month low, European stocks are down with the Greek market down 6% and Nasdaq Futures are down also.  This comes on the heels of a 2.25% decline in Nasdaq this past Friday based on weak US jobs data. The risk that Europe will come apart with nations exiting the Euro and significant political and social upheaval to follow is now bigger than ever.

I had written last August that startups should raise money ASAP and I was wrong then. Europe managed to kick the can down the curb, the markets rallied and venture funding remained reasonably strong. I may well be wrong again now because we are dealing with probabilities but it should be pretty clear that the probability of Europe coming apart has gone up meaningfully with these elections.

What does that mean if you are a startup?  Again, I believe if you know you have to raise money soon, you should do it even sooner than you thought you would.  And if you have an existing strong syndicate you need to control your burn so that syndicate can finance you should new financing dry up.  The music can stop at any moment and when it does the change is dramatic.

Posted: 7th May 2012Comments
Tags:  Europe elections finance startups

Feature Friday: Feed of the Future (Shapeways)

I have not been writing nearly enough about many of the cool things that our portfolio companies are doing. To correct that I will start doing Feature Friday posts.  The opener is the feed introduced earlier this week by Shapeways.  

I love activity feeds.  They are a fun way to see what’s happening on a site.  But more than that, I have come use them in board meetings as way to think about what a company does (even if they don’t yet have a feed).  It’s a powerful way to organize one’s thinking about existing and future features.  And I guess we really have to thank Facebook for popularizing the activity feed concept (someone please correct me here if there is an earlier equally well known one).

Please go and checkout the Shapeways feed, which they cheekily call the “Feed of the Future” (as in: “the future of stuff”) 

Enhanced by Zemanta

Posted: 4th May 2012Comments
Tags:  feature friday shapeways feed

Older posts