- Netflix and the Conservation of Attractive Profits (Stratechery) — Note the common element to all three of these companies: all have managed to modularize the production/delivery of their service which has allowed them to move closer to the customer. To put it another way, all of this new value is being created by specialized CRM companies: Airbnb for travelers, Uber for commuters, and Netflix for the bored.
- Origami — Facebook’s prototyping tool.
- Go as Open Source — keynote from this year’s Gophercon. I’ve been pondering lately how successful open source projects go beyond “anyone can scratch their itch,” and instead actively manage the tendency for scope creep. We’d rather have a small number of features that enable, say, 90% of the target use cases, and avoid the orders of magnitude more features necessary to reach 99% or 100%.
- The Universal Data Structure — Given the abysmal state of of today’s software engineering, I believe that a full embrace of the universal hash will result in better, simpler programs. Your weekly dose of snark.
What is Hack and what does it mean for the future of PHP?
Facebook recently released Hack, a new programming language that looks and acts like PHP. Underneath the hood, however, are a ton of features like static typing, generics, native collections, and many more features for which PHP developers have long been asking. Syntax aside, Hack is not PHP. Hack runs only on Facebook’s HipHop virtual machine (HHVM), a competitor to the traditional PHP Zend Engine.
Why did Facebook build Hack?
Much of Facebook’s internal code is first written with PHP. Facebook can onboard new developers quickly with PHP because the language is notoriously easy to learn and use. Granted, much of Facebook’s PHP code is likely converted to a C derivative before being pushed into production. The point is Facebook depends strongly on the PHP language to attract new talent and increase developer efficiency.
Unfortunately, PHP may not perform as well as possible at Facebook’s scale. PHP is a loosely typed language and type-related errors may not be recognized until runtime. This means Facebook must write more tests early to enforce type checking, or spend more time refactoring runtime errors after launch. To solve this problem, Facebook added strict typing and runtime-enforcement of return types to Hack. Strict typing nullifies the need for a lot of type-related unit tests and encourages developers to catch type-related errors sooner in the development process.
Instantaneous Type Checking
To make the development process and error-catching process even easier, Facebook includes a type-checking server with its HHVM engine. This server runs locally and monitors Hack code as it is written. Developers’ code editors and IDEs can use this type-checking server to immediately report syntax or type-related errors during code development.