backend, javascript, Node

Building My First App With Node

I’ve made it through the end of the first half of my programming intensive course at General Assembly. Just barely.

After a 3-week frontend introduction, we shifted gears to the backend. To do so, we downloaded something called Node.js. We also installed a bunch of “modules” onto Node to do specific things.

Traversing from the frontend to the backend
Traversing from the frontend to the backend of software development

I’m going to level with you: during my first week of learning about Node, I was completely lost. Like “I-have-no-effing-clue-what’s-going” lost. And it was particularly frustrating because I spent countless hours after class trying to understand what exactly Node was. I read a bunch of “intro” tutorials, watched at least 10 videos on YouTube, and even bought a few books on the basics of Node. Despite all my effort, I still couldn’t explain Node to my wife.

The tutorials, videos, and books presumed some basic knowledge of server-side applications. But I had no foundation to connect so many new concepts and terms. It reminded me of a recent passage by Tim Urban on his blog “Wait, but Why?“:

I’ve heard people compare knowledge of a topic to a tree. If you don’t fully get it, it’s like a tree in your head with no trunk—and without a trunk, when you learn something new about the topic—a new branch or leaf of the tree—there’s nothing for it to hang onto, so it just falls away. By clearing out fog all the way to the bottom, I build a tree trunk in my head, and from then on, all new information can hold on, which makes that topic forever more interesting and productive to learn about. And what I usually find is that so many of the topics I’ve pegged as “boring” in my head are actually just foggy to me.

So I set out to build a “tree trunk” and stick all these branches of knowledge together. I started at the most basic level by asking simple questions such as: “What’s a server?” Of course, I kind of knew what a server was, but “kind of” was not good enough.  I needed to understand how things worked at a more fundamental level. Admittedly, I was embarrassed at first to google these things or ask my instructors these questions during review sessions. Once I got over my fear of sounding ignorant, I started getting a much clearer and deeper picture of how the Internet and our computers work.

So, what is Node?

Node is a platform that extracts JavaScript out of its natural habitat – the browser (ie. Chrome or Firefox) – and provides a non-browser environment that JavaScript can run on. Through Node, we can access databases, listen to network traffic, and receive/respond to http requests – all with JavaScript. By embedding Google’s really fast and really awesome JavaScript engine onto our computers, Node allows us to build scalable network applications using solely the web’s lingua franca.

Since JavaScript is the only language I have been exposed to thus far, I initially failed to grasp the magnitude of Node’s impact. Before Node, a JavaScript programmer would have been confined to the frontend or would have had to learn a server-side language such as PHP, Python, or Ruby on Rails in order to connect to the backend and create a full-blown application. Thanks to Node, frontend developers can now work in the backend as well, and that’s pretty sweet since there’s now language consistency across the technology stack. More importantly, because of JavaScript’s asynchronous nature, we can write code that is non-blocking. In other words, a chunk of code doesn’t have to wait around for previous chunks of code to finish before it can start executing. Two or more chunks of code can run in parallel. The result: blazingly fast web applications.

An illustration of how Node's event loop enables non-blocking code
An illustration of how Node’s event loop enables non-blocking code

Using Node, I could create a chat server, an ad server, or a real-time data app. Indeed, using Node I was able to create my first application: a simple Wiki on startups. As a user, you can sign up and log in (I’ve encrypted passwords) as well as create, edit, and delete posts. Node is pretty low-level, so I also used a number of modules (such as Express and EJS) to build the server. Lastly, I hooked up to a Mongo database to store and retrieve information related to users and any posts on startups created.

I tried to go for a minimalist style that should make it intuitive to navigate. Due to the time constraint, I wasn’t able to build out all the functionality I wanted, but I’m still happy that I was able to build this Wiki over the course of a weekend. As simple as this application may be, the feeling of creating something from scratch is second to none.

Airbnb, marketplaces

Assessing Airbnb’s Billion Dollar Round

Airbnb is the premier online marketplace for short-term rentals. The Wall Street Journal reported that the company is raising a $1B round on a $24B valuation – approximately 26x this year’s projected revenue. That would make Airbnb more valuable than Marriott International, which is valued at ~$21B. How can we make sense of this seemingly crazy valuation?

Here’s how I think about it:

Timing: Smartphone penetration and social media growth have enabled consumers to grant each other temporary access to their under-utilized physical assets by removing key friction points to asset owners and potential users. In other words, these key Internet trends have unleashed the “sharing economy.”

Market Size: Airbnb is competing in a massive market. Nobody knows exactly how big this market is. Beyond vacation rentals (an $85B market), Airbnb has enabled people living in cities to rent out spare rooms or entire apartments, creating a market that didn’t even exist seven years ago. Going forward, Airbnb will eat into parts of the hotel industry as well as other low-utilization-to-asset-value sectors. I estimate Airbnb’s total addressable market to be between $500B-$600B. It’s incredible to think that not-too-long ago Airbnb’s founders thought the total market was under $20B.

Business Model: I love online marketplaces because the economics are amazing. Marketplaces often command +60% gross margins and +20% operating margins. Moreover, as an online marketplace, Airbnb is asset-light and does not hold any spare-room inventory. Unlike hotels such as Marriott or Hilton, Airbnb is unconstrained by real estate and can add thousands of rooms in a matter of weeks rather than months or years. Airbnb’s +1M listings are more than Marriott’s 700K rooms. On a per room basis, the valuation starts to look more reasonable.

Competitive Advantage: Airbnb has created a very defensible company by building a global – and somewhat fanatical – community through its trusted service. Online verification techniques, a $1M host guarantee, and a secure payment platform have all helped build trust throughout its customer base. Airbnb also creates a continuous stamp of approval since each additional review is another valuable datapoint that fosters further trust among members. This, in turn, generates powerful “network effects.” What’s particularly unique about Airbnb’s network effects is that supply and demand are often one and the same, creating overlapping network effects. Guests are often hosts, and vice versa. From a competitor standpoint, this dynamic is incredibly difficult to break and even more difficult to replicate.

Team: Lastly, Airbnb’s founding team is just so tenacious and creative. This may be less important when we are talking about billion-dollar companies than those at the seed or Series A level, but it inspires confidence going forward (they still have much to execute). This blog by Fred Wilson about Airbnb’s founders designing cereal boxes and then selling them to keep their business afloat back in 2008 sums up their abilities quite nicely.

I put together a short investment recommendation on Airbnb last month. The deck highlights and expounds upon some of the points I’ve mentioned above. I definitely think Airbnb is a phenomenal company, and if it maintains its growth trajectory, it could very well be worth ~$24B – in fact, $24B is what I thought Airbnb was worth in my upside scenario. But that doesn’t mean I’d invest in Airbnb this late in the game. Separating a great company from a great investment is arguably one of the most valuable lessons I’ve learned at Columbia so far.

In case you’re interested, I’ve shared the deck below. Please note the context has slightly changed over the last few months, but I think the main takeaways still stand.

front end, programming

Humbled by Code

A few weeks ago, I started a 3-month intensive full-stack programming course at General Assembly. Full-stack is simply a fancy way of saying I’m learning web development and design (the “front end”) as well as server, application, and database programming (the “back end”).

I thought the first few weeks would be pretty straight forward. It’s been anything but. My mind has been stretched in many ways: first, by learning a lot of vocabulary and new syntax; second, by applying object-oriented and functional “paradigms” that string together disparate actions into a coherent body; and third, by thinking in a very explicit, step-by-step way so that the machine I’m working on can interpret my instructions. I’m amazed how tough this is for me, even though I’m writing very basic code.

So far, I’ve been exposed to primarily front end languages: JavaScript, jQuery, HTML, and CSS. Hard-core programmers don’t even consider HTML or CSS as code, but it looks like code to me when I’m writing it. I didn’t really know what either was before I started this course, but it’s pretty simple: HTML is used to “structure” a web page, while CSS allows a developer to “style” the page. Neither is particularly difficult to grasp, but manipulating pages and making them look good is both a skill and an art.

JavaScript, on the other hand, is a programming language. Many people confuse JavaScript with Java, but aside from sharing a similar name, they are pretty different. JavaScript is the language that powers the web: it enables webpages to have functionality. If a user clicks on something on your webpage, what happens? That’s JavaScript.

Front-end languages

It’s been fun learning JavaScript as well as jQuery – a library that simplifies writing JavaScript. JavaScript is considered one of the “lighter” programming languages to learn – and doesn’t carry the gravitas of learning something like C++ or Java – but it’s deceivingly simple. From what experienced programmers tell me, JavaScript has its quirks, but these quirks – when wielded properly – can produce powerful programs. In fact, according to a recent Bloomberg article on code, JavaScript is the world’s most-used computer language. Here’s what basic JavaScript looks like:

Simple JavaScript to create a sliding menu bar
Simple JavaScript to create a sliding menu bar

I struggle quite a bit when using JavaScript to manipulate the CSS and HTML of a page. Nonetheless, I’m astounded that in three weeks I’ve managed to write several programs, including:

  • A stopwatch
  • A calculator
  • A To-Do list
  • A game called ‘Snake’
  • A game of ‘Tic Tac Toe’

I won’t post these programs since I’ve received plenty of help from my instructors, peers, and online material. The code I wrote is also plain awful and riddled with bugs, so I don’t feel comfortable sharing these just yet. But as I continue to get better with programming, I look forward to sharing some of my projects on here.

Back to coding.

Tech Trends

Christmas in May: Internet Trends

Every May, Mary Meeker of Kleiner Perkins releases a ~200 slide deck entitled “Internet Trends”. And every May, I anxiously await its release much like a kid looking forward to opening presents on Christmas morning.

The deck is overflowing with really great data that captures the current state of technology from a bird’s-eye view. Below are some of my key takeaways in this year’s deck:

  • There are over 5.2B mobile phone users, and approximately 40% of all mobile devices are now smartphones. Mobile subscriptions increased 23% in 2014. That pace, however, should slow down as new user adoption shifts from predominantly developed markets to less developed pockets.
  • There is a still a big disconnect between time spent on mobile for media consumption (~25% of total time) and mobile ad spend (8% of total spend). In general, ad spend per medium is very much in line with consumption time. Reaching parity in mobile ad spend presents a ~$25B opportunity in the US alone.
  • Meeker highlights that enterprises’ application of computing is moving away from process optimization and toward process redesign – a fundamental shift that is allowing small technology insurgents to aggressively compete against incumbents. Banking and transportation come to mind. Many more industries will likely follow.
  • In terms of consumer spending, the top spending categories for the average US household are housing (33%), transportation (18%), food (14%), personal insurance (11%), and healthcare (7%). We’re witnessing an explosion of startups and investment activity around 4 of those 5 categories. The notable exception in the US remains personal insurance. Could we expect innovation to finally take hold of this trillion-plus dollar market in the next 5-10 years?

I highly recommend digging into the entire deck. Here it is:

programming, technology

Hello World!

Welcome, dear reader!

This is a blog about technology, innovation, and change. I hope to take stock of what are some incredibly interesting times, both on a personal level and a global level.

On a personal level, I just finished my first year of b-school at Columbia. It flew by. Although I’ve been exposed to a lot of ideas, I haven’t really internalized all the great stuff I’ve learned. In part, I hope to use the space here to solidify some useful concepts by applying them – when appropriate – to the world of technology ventures.

It just so happens that I recently started to program at a coding school called General Assembly. I’m interested in technology but don’t have a computer science or engineering background. So I’ve decided to plunge into tech by learning some of the languages and frameworks that power the web: HTML/CSS, JavaScript, Node, Ruby on Rails, Angular, among others. In this blog, I hope to share, think through, and hone “granular” concepts that will initially seem difficult or novel to me.

But if I’m a business student, why am I learning to code? It’s a valid question, and one that was asked a lot by my classmates who are on their way to top consulting and finance firms. Here’s my take.

On a global level, technology is having an unprecedented impact. Of course, technology has always had a huge impact in the world. This time around, however, the ensuing change will be more diffused and profound than ever before.

Smartphones will account for over 50% of all cell phones within the next decade. A billion+ people who have never had access to a computer or been connected to the Internet will soon come online. This means that business models and industry structures in every corner of the world will be completely redefined. It’s already happening in the US. On balance, this is a good thing.

Today, most businesses outside the software industry consider technology an ancillary support function. Indeed, technology is often relegated to a musty “IT Department,” operating as a cost center. But the businesses of the future are baking technology into their core operations. Is Uber a transportation or tech company? Is Airbnb a lodging firm or a tech firm? The lines that divide technology firms and traditional businesses are being blurred – quickly.

Going forward, having a team of software engineers and UX designers will become the business norm. To be effective, future business leaders must be able to communicate, challenge, and empathize with their developers. Understanding the flow and logic behind the codebase will become as important as being able to read and analyze financial statements.

Too many outside Silicon Valley still find these assertions to be outlandish. My hope is that this blog helps you think otherwise.