Friday, February 8, 2019

Living the Dream, Part 2: What It Costs to Live in San Francisco





A few years ago, we did a calculation on what it costs to live in San Francisco,  one of the greatest cities in the world. A few years have passed, and much has changed. The City, the world, and probably even you are very different from when we took a look at the economics of living in San Francisco. Today, we'll take a look at what it takes to own a house and possibly raise a family as a married couple in San Francisco.

TL;DR: If you make $600K/year, live frugally, and send your 2 kids to public school, yes. Private school, maybe.

How Much You Make

Let's assume you and your spouse are both gainfully employed, each making $300,000/year. Or maybe one of you is working and making $600,000/year. We'll ignore any (potential) windfalls from stock options at this point and assume this is your (adjusted) annual compensation. We assume that you'll fully contribute to your company's 401K plan and it's employee stock option plan (at $25K/year).

The good news: You and your spouse (assuming you are both working) are saving $88K year (not adjusting for taxes or appreciated stock gains from your ESPP). Congratulations!

The bad news: After taxes/deductions, you only get to keep $289K.



You Buy a House

You're an adult now, so it make sense you want to own a home -- at least join the club of people that have a mortgage instead of renting. In San Francisco, a modest 3 bedroom, 2 bath starter home (perhaps 2000 sq/ft) will cost you about $2,000,000. Assuming you are able to make a 20% down payment of $400,000, it will cost you about $125K/year (and this is with a 5% interest only loan). Your monthly housing costs will be about $8700/month.



Basic Living

Living in San Francisco is expensive not just because of housing -- everything is a little more expensive than the rest of the country. And, for whatever reason, you like to "live larger" than others in other parts of the country. On average. Dinner at Saison will set you back $398/person. Drinks at Black Cat are $15. I'm sure our estimates are often high and often low -- there's a lot of variability. For example, do you own two cars or one? What kind of car? Are you including loan payments?  What about rideshare? We guestimated $20K/year for your automobile/transportation costs. In totality, we're guessing you'll spend about $125K/year for the two of you, not counting housing. YMMV. 




So, given you after savings take home pay is $289K, and your spend is only $249K -- hooray! --You're in the black by $40K.

More good news: Assuming you qualify for the full mortgage interest deduction (the deduction is capped by the interest on up to a $750,000 loan) , you save an additional $17,625 in taxes plus another $8800 for a property tax deduction. So you save another $26,505. So, you are net $66,505 in the black!


But wait...

What about Kids?

Tick, tock. Tick, tock. 

You're in your thirties now. And the desire for kids grow every day. Congratulations on your coming of age entry into full adulthood. Thank goodness your employer has provided you with stellar insurance, possibly including IVF/IUI options, pregnancy coverage, and a great family plan.

And your life plan probably calls for two kids. What's this going to cost?

Since both you and your spouse are working, a day care or nanny plan are likely needed. Call it $35K. And, maybe the incremental cost (food, clothing, summer camp, etc) will be $20K. So, maybe you are in for another $55K/year for two kids.

Awesome -- you are still spending $11K/year less than you are taking in.

...And Private School?

Apparently, many parents are choosing to send their kids to private school. Getting into a great/acceptable public school is literally a lottery in many cases. So, what is this going to cost? I'm told this is between $20K and $50K per year, per child. The base cost is highly variable depending on where you send your kids, plus there are  multi-kid discounts and possibly "negotiated rates." Let's call it $30K/kid.

Your "all in" spend is $365K.  Your tax deductions are $26K, so your net spend is $329K. Your take home earnings are "only" $289K.

So, now you are running a $50K/year deficit. Bummer!





Tap the Savings and Hope for a Windfall?

So, how do you make up for this shortfall? Well, you are saving $50K year with your ESPP. And, you're employer is likely buying stock for you at a 15% discount. So, maybe you will choose to use this money. Further, hopefully, your company ('s stock price) is doing well, so you are actually earning more. 

Finally, perhaps those stock options or RSU are worth more (not less) over time, so you cash in on the success of your company. After all, it is the equity incentives that have drawn us to San Francisco. We must have hope and dream big.

Does It All Add Up?

The two million dollar house in San Francisco is surprisingly small in San Francisco. And the down payment may be hard to save for. And you may want something bigger and better. Say $2.5 million? 

You could trim your lifestyle back -- seems like "keeping up with the Joneses" is an unstated driver for many of us. 

The big unknown is public school vs. private school. 

So, if you can live in a modest home, trim back your living standards, and send your kids to public school, this is doable. With private school, it's a big stretch.

And, of course, is making $600K/year reasonable?

Last maybe you can "wait it out," and hope those stock options convert.

Or move to Modesto.






Sunday, January 27, 2019

Google v Oracle: APIs as Intellectual Property

I see that Google is going to battle again with Oracle over its use of Java in Android. This is mired in complicated legal issues, and both Google and Oracle seem to use some very detailed technical arguments to make their case.  The legal arguments are probably too nuanced for lay-people to really understand. However, ultimately, it seems to boil down to an important question:

Should APIs (Application Programming Interfaces) be protectable intellectual property?

In this specific case, should APIs be copyrightable?

There are perhaps other mechanisms for protecting intellectual property rights for APIs (such as patents) as well -- but I think the fundamental question is whether a company can "protect" and monetize their APIs. Protection includes who can use a API, who can implement it, who can modify it, and who can define the semantics of it.

In deciding the complex legal questions, it would seem a basic understanding of APIs would be valuable. In reality, maybe legal minutiae will settle this dispute, devoid of any technical understanding. Nonetheless, here's my basic take on APIs. For programmers, this should be obvious. For those that are not, it should be informative. For all, it provides a framework for how one might think about the intellectual property protection for APIs.

APIs are fundamental for building complex software systems. APIs allow programmers to breakdown large, complex problems into smaller simpler ones. They are allow for a "divide and conquer" strategy to allow multiple people to work on a large problem. A programmer can, in theory, only concern themselves with the details of their subsystem and how it interacts with other subsystems. The API defines a contract between one subsystem and another.

Specifying good APIs is hard. An API should be easy to understand and use, implementable (in variety of ways), useable by a variety of applications, and scalable (within some specified boundaries) or possibly scale-free. Careful thought to extensibility, compatibility, and versioning are needed. Specifying good APIs is the job of a season programmer.

APIs are code. While APIs are different from implementations, APIs are code just like implementations. A header file or class definition is code.

APIs are valuable. An implementor of an API provides value to users of the API. The API is the access point to some service. Without the API, understanding how to access the value provided by the service is not clear. Conversely, the API is valuable to the client -- it provides access to services that the client would have to implement itself if it were not available.

Who Is Getting Paid?


Implementors of an API dictate how and how much they will charge for the services they provide and how they can be used (ignoring the issue of GNU General Public License (GPL) for now). Clients are contractually obligated to abide by the terms specified by the implementor.

So, the question remains -- who owns, controls, and monetizes the API -- the contract between the client and the implementor? And, maybe in this case and others, when the definer of the API is the same as the (first) implementor of it, the situation is even more murky.  How is the implementor of an API restricted by the "owner" of the API? This seems to be the crux of the dispute between Google and Oracle.

We've been here in the past.

Namely, follow on implementors of APIs avoided legal troubles by various (legal) mechanisms. Amdahl built computers that were compatible with IBM mainframes, IBM allowed for clones of the IBM PC, PC DOS implemented much of the CP/M interface, and AMD implemented the Intel x86 instruction set and built compatible x86 chips. These are all examples of implementations of  an interface that have been specified by other parties. Rights to implementing an interface were gained through payments, anti-trust rulings, and licensing agreements. Sometimes, the second party's implementation was just ignored. Finally, "clean room" implementations allowed some to sidestep the API IP issue.

SUN Microsystems (ironically the company bought by Oracle who inherited the Java Intellectual Property), created one of the first "Open API" models. SUN explicitly made many of their APIs freely available for anyone to implement. NFS, the Network File System interface, is the prototypical example. Anyone can implement the NFS protocol free of charge and distribute implementations without licensing fees. (SUN also sold implementations.) Note that while SUN explicitly made some APIs freely available, others had restrictions.

Programming languages seem to be an interesting exception. Other than the language at hand, Java, most programming languages are not copyrighted (or protected intellectual property in general). It's not hard to argue that a programming language is an API. Why haven't they been protected in the past? In the EU, its been ruled that programming languages can't be copyrighted. However, this doesn't seem to be the fundamental driver for them not to be protected. Perhaps leaving them "unprotected" allowed for greater adoption or there was just a lack of desire to secure IP rights. In a more innocent time, perhaps programmers were more likely to be altruistic idealists with less desire or awareness for commercialization and control.

My Take


APIs are necessary and valuable. They are difficult to get right, and they require talented people to do so. Ultimately, APIs are code. Given these attributes, APIs are Intellectual Property. As such, creators of APIs should be able to protect, control, and monetize them as allowed by the existing mechanisms such as copyright, patents or trademarks.

Finally, it seems the detailed technical arguments over things like "classpath exception," "rangeCheck function," and even "Structure, Sequence, and Organization" only obfuscate the fundamental issue:

Are APIs copyrightable? 

Because APIs are intellectual property of the written form, I think it is.

It is up to the owner to decide what legal mechanisms it wants to use to protect it (copyright or otherwise). Further, within these mechanisms, the owner chooses the terms for the use of the API.

In the specific case at hand, if this is all about whether or not APIs are protectable intellectual property, I side with Oracle. They have the right to determine how the the JAVA APIs can be used and at what cost. But it would be shame if  they didn't put the appropriate intellectual property protection and Terms of Service in place.