There Will Be No Web 3.0

|
husslin-vs-ballin-the-eternal-struggle.jpgThe recession reached its hand into Silicon Valley's now lukewarm tub and yanked the plug.  It's still draining out, and I wish it would go faster, because there are just too many fucking people in the San Francisco Bay Area.  I'm talking about you, guy in your Prius taking the left hand turn on to Middlefield Road too slowly.  Leave, now.  And don't come back.  Bonus points for wrapping your expression of environmental consciousness around a tree.  Be one with nature.

The guy who drives the Prius likely works at a Web 2.0 company that's burning its way through the $4 million it raised from Me2 Ventures, one of the many sheep-funds in the Valley who follow the trends of top-tier investors like Sequoia or DFJ but don't have the connections to pull liquidity out of hype.

In two years, this guy's company will finally run out of money, having failed to raise another round because investors are too busy conjuring up the next bubble.   The failure of Web 2.0 was a live demonstration in I-Told-You-So, as was the first bubble.  Both times, the world looked on and thought "what the fuck are you doing?", and Silicon Valley replied "shut up and bring me my Vaseline".  We went from bad business plans to no business plans, and saw much less liquidity this time.  The big bang was YouTube, and it was all down hill from there.


The Only Easier Money is Marijuana


So what will the next bubble be?  Green technology.  Green energy.  Green computers.  Green pants.  Green vomit after an Absinthe adventure.

Al Gore did a wonderful job creating awareness of global warming.  Awareness isn't the right word, but neither is hysteria.  Both are close enough.

San Franciscans were more motivated than usual by this cause, and have begun to care about their carbon footprints or other such nonsense.  Making a San Franciscan feel like he alone can make a difference is the best way to control his actions.  See also: spending habits.  Al Gore, with his nonthreatening voice and relentless assault of data has the power to cultivate the same feeling in stay-at-home-moms and college students.

Unfortunately, the average American mind can only be concerned with one crisis at a time.  Purveyors of fine doom-and-gloom are continuously vying for this spot.  Presently, it's the economy.  Foreclosures.  You're going to lose your house.  Oh fuck, you'll lose your house, your family, your car, and did we mention that you'll be living on the street?  Fear not.  Here's some shit you can buy to make it all better.  Here's a politician you can vote for who will fix everything.

Fear cycles last a few years.  Remember when we were afraid of terrorism?  What about peak oil?  Global cooling anyone?  When money comes back to the Valley, it's going to be aligned perfectly with the beginning of the next fear cycle, and the next fear cycle is going to be global warming.  Or climate change.  Or polar bear rescue.  You can call it whatever you like, as long as you spend money to fix it.  Do your part.  It's your obligation as a citizen of the earth.


Still Waiting For That Twitter Business Plan

Green tech hasn't taken off yet because liberal guilt can't support a very big market.  What you need is government collusion.  You need somebody with a gun to step in and say that if you emit more than 100 tons of carbon per year, you need to pay.  You need that same person with a gun to say that these carbon emission credits have value, and can be traded.  It helps if your typical Silicon Valley entrepreneur or investor believes the call to action.

That last part is easy.  Web 2.0 was all about San Francisco values.  Sharing.  Caring.  Understanding.  What would Web 3.0 be about? Many say it's some semantic bullshit.  Those are the same people who have figured out what Twine does (any hints?).  Whatever we can dream up to do over the internet won't draw any money; investors will be bored with web companies after this debacle.  The money will go to green tech, because there will be an obvious business plan, popular support, and a government mandate.  How can you lose? 

The entrepreneurs will follow suit.  Silicon Valley types love to feel like they're making a difference, and green tech will practically let them fellate themselves. (In Web 2.0 the Silicon Valley types fellated one another, so this is the natural extension)  It will be different people, as an extensive knowledge of Python doesn't give you much insight into solar panel construction, but the same kind of people.

I believe this because it's satisfying.  No more "get users, do something, get bought out".  This time, it's "invent something, build it, sell it".  Sure, we'll be turning a profit by taking sick advantage of alarmism, but it's a business. 

Shut Your Face, Commons Httpclient

|
If you're like me and every other user on the planet, you don't give a shit when an SSL certificate doesn't validate.  Unfortunately, commons-httpclient was written by some pedantic fucknozzles who have never tried to fetch real-world webpages.

If you want to turn off SSL certificate validation in httpclient, do this:

1. Put not-yet-commons-ssl.jar on your classpath.
2. Execute the following method before you start any SSL connections:


public static void trustAllCerts() throws GeneralSecurityException, IOException {
	ProtocolSocketFactory sf = new EasySSLProtocolSocketFactory();
	Protocol p = new Protocol("https", sf, 443);
	Protocol.registerProtocol("https", p);
}
This essentially makes commons-httpclient accept every SSL certificate it gets.  Yeah, that's what I thought. Who's bitching now?

Python Makes Me Nervous

|
wait-til-you-see-those-goddamn-bats.jpg
The amount of time saved by using Python as opposed to something like Java is inversely proportional to the number of people working on the project.

As a programmer in a team, you need rules.  You need structure.  You need order.  Freewheeling your way around a software project is going to create more problems than it solves.

What I'm butthurting about here is Python's duck typing.  It's cute when you're a lone wolf working on a simple Django application, but add a few more people to the project and it quickly becomes unmanageable.  Why?  Because with duck typing, you need to keep a lot more state in your head to interact with other peoples' code.

Pydev for Eclipse Sucks Too

Method signatures are virtually useless in Python.  In Java, static typing makes the method signature into a recipe: it's all the shit you need to make this method work. Not so in Python.  Here, a method signature will only tell you one thing: how many arguments you need to make it work.  Sometimes, it won't even do that, if you start fucking around with **kwargs.

Calling a colleague's method isn't as easy as looking at the signature.  You need to look at the method definition itself to see what it does with its input.

Let's look at an example from Thrift, Facebook's open source RPC server.  Here's the signature to a TServer constructor in Java:

protected TServer(TProcessorFactory processorFactory, TServerTransport serverTransport)
And there are a few other constructors that take different args.  Pretty straight forward, if you look at this, you know what you need to instantiate to get your TServer up and running.  Now let's look at the Python version:

def __init__(self, *args):
So, how do you use it?  Big fuckin' mystery!  You can't overload constructors in Python, so they had to mash the several different constructors into one.  To figure out how to instantiate a TServer, you need to look at the constructor implementation.  As a user of the library, the implementation is none of my concern, unless I'm programming in Python.

What a waste of time.

Whatever You Do, Don't Do It Wrong

What about errors?  Python exceptions are what really make me nervous.  Your code can run fine for the longest time then shit out with a runtime exception.  How do you know what exceptions a method can throw?  Well, you don't, unless you look at the method definition.  Fantastic.

Java has a well thought out hierarchy of checked and runtime exceptions.  Sure, handling checked exceptions means you need to write a bit more code, but it's better to spend the time in development than in debugging at 4am. 

Another example is in order.  In Java, the constructor to FileInputStream throws a FileNotFoundException if something goes wrong.  Since it's a checked exception, you need to deal with it somehow.  The fact that this exception is thrown is made obvious in the documentation, and your code won't compile if you ignore it.

Python, on the other hand, prefers to leave things up to chance.  This is the documentation for the open() builtin, that opens a file:

Help on built-in function open in module __builtin__:

open(...)
    open(name[, mode[, buffering]]) -> file object
    
    Open a file using the file() type, returns a file object.
(END) 
How does this function handle a failure?  Does it raise an Exception?  Does it return a special value?  Nobody seems to know!  Ah, fuck it, that's a runtime problem, right?

Sure, runtime exceptions happen in Java, but they are usually things that are indicative of a big fuckup like a NullPointerException, not something stupid like a file not being found.

Programming a large project in Python makes me uneasy.  Perhaps I'm just doing it wrong?  Do other Pythonistas drop a Valium before they begin the day?

pressflip: what I'm tracking

Pages