Vibe Coding

Vibe coding is a term popularized by Andrej Karpathy and set in motion by Pieter Levels who recently launched a multi player flight simulator game created with a combination of Cursor + Claude and some prompts. Sound too good to be true?

I was a skeptic, but hey what do we have to lose if it actually works. So armed with the Pro version of Claude, this weekend I set out to make an Archery Game purely for fun and learning inspired by Arjuna, the legendary Archer from the Mahabharata.

The good news is it works. The bad news is that it’s simple but not easy. I started my journey asking Claude Sonnet 3.7

“lets create a game with three.js that is Mahabharata themed, with Arjuna trying to hit different targets with his bow and arrow, start with easy static targets then as levels progress move to moving targets.”

That was enough to create a game that works on a desktop. Then I added a few refinements to draw the character better, have some ray tracing etc. Claude was trying to re-generate the game html every single time which was making the context long. There were console errors it tried to fix. Then I added some more precision to the prompt to make changes inline. That seemed to help a bit but the mobile experience was lacking. I had to describe with increasing precision what I wanted.

“The mobile game has a flaw that I need to tap a separate shoot button which directs arrows towards that, Instead lets show the bow string being drawn and release arrow when user releases it towards direction that its pointed to.”

That wasn’t enough too, there were bugs in the game that prevented launch on mobile or desktop and both. So the trick was then to tell it

“you are an expert game developer with three.js and html, you helped me create an archery game for desktop, I want to add mobile capabilities so that someone on a phone can play the game with taps. The current game has a shoot button which is unintuitive. To make it intuitive let’s have it such that user draws the bow string with finger or click, also mimic that on desktop. When finger or click is released, arrow is released in direction that Arjuna is pointing to. Here is the original game you created. Instead of emitting a completely new file make edits inline. Keep it simple and complete the file in one attempt”

What kept happening was the context kept on reaching its limits without the mobile functionality being enabled. Then I tried a different approach Telling the model to “Take a deep breath, pay attention and do the best work of your life.”. It improved its performance to the point that it did exactly what I wanted it to. AI is weird.

I’ve hosted the game here https://arjunaarchery.com and it runs completely in your browser – mobile or desktop.

So where does that leave us? What is Vibe Coding actually good for? Based on what I see, you can prototype any Software Experience rapidly & also make end-end applications. So the cost of prototyping is close to zero now. You are really limited by your imagination & distribution. I wrote zero lines of code to build this, wrangling with prompts instead of code.

Vibe coding is not deterministic yet. I was surprised at the level of prompting required to accomplish a working game in desktop and Mobile. I anticipate models getting better that even the part I was stuck on gets one-shotted soon.

What is needed to vibe code is to have a broad understanding of the world & how things work. That combined with precision of prompt with some anthropomorphism towards the AI model to encourage it to accomplish what you want. This is how things are getting built. It is a strange feeling. It wasn’t as intellectually satisfying seeing claude churn out line after line of code that makes this work as it would have been to be deep in it. That being said this is the first ever graphic game I’ve built. So seeing that work is an incredible feeling. I can imagine apps of extreme complexity being created with Vibe coding.

I definitely see product and engineering melding into one. Tell the AI what to build then have enough engineering chops to deploy, debug and maintain it. Perhaps there will be another AI that does that too.

So if the future is prompting based on understanding the world better and not being limited by your imagination, I think it makes sense to read as much history, science fiction & develop expertise in your field, so that you are empowered to craft the best prompts. The one with the best prompt and imagination wins.

A decade at Apple

The first computer I ever used was a Macintosh in 4th grade, generously loaned to me for the summer by my father’s uncle. I spent countless hours exploring the mac and playing games. Though I received a PC at home in 5th grade, I didn’t use a Mac again for the next decade.

During my time in engineering college back in India, I came across iWoz, Steve Wozniak’s autobiography. I was amazed by his creations and his relentless motivation to tinker and build the early Macintosh computers. That spirit of tinkering inspired me to move to the SF Bay Area. This was when I really dove deep into the unix ecosystem. It was Wozniak’s engineering genius, combined with Steve Jobs’ Product & Marketing brilliance, that seeded the Apple culture we know today.

In May 2014, I found myself at Apple’s Mariani office. I had parked my car there for a weekend trip with friends who worked at Apple. My main concern was whether the car would get towed. When I returned, the tires were marked with chalk, but thankfully, the car was still there.

Co-incidentally,  an Apple recruiter contacted me while the startup I was working at was going through some troubling times, and I went through a rigorous interview process. I took it one interview at a time, stretched across several days. Midway through the process, on a Friday night, I was given a homework problem: implement a variant of TF-IDF. The challenge? I was scheduled to travel to India over the weekend for a couple of weeks.

It turned out I was an expert on that problem, Just two months earlier, in March, I had given a talk on computing document similarity which at its heart used TF-IDF at the Bay Area Python Interest Group. As the saying goes, “Fortune favors the prepared mind.” However, I wasn’t out of the woods yet. The additional challenge was to implement the solution in Golang, a language I was unfamiliar with. So diving in, I learned Golang on the plane to India and implemented the best-crafted solution I could muster. After settling in at my parents home, I submitted my work. To my delight, I soon heard back and completed the remaining rounds of interviews after returning to the Bay Area. By September 2014, I found myself working at Apple Inc.  I attribute my working at Apple to a combination of skill, hanging out with friends who worked there & all that I learned from my colleagues at my previous jobs, they infected me with the energy needed to elevate myself. 

Working at Apple over the past 10 years has been an incredible experience. One of my favorite aspects has been the process of turning an idea into reality—collaborating with engineering, product, and marketing teams to launch features that now run on over a billion devices. This journey has been both challenging and deeply rewarding. Along the way, I’ve made lifelong friends—some who have moved on to other FAANG companies, some who started their own companies and others who I still see every day.

Charlie Munger has a quote “The highest form which civilization can reach is a seamless web of deserved trust. Not much procedure, just totally reliable people correctly trusting one another.”

Working at Apple I’ve experienced this, when solving a problem. Apple operates on the DRI model where each component has a directly responsible individual who is an expert. It is this seamless network of experts that makes it tick. What’s unknown to one person is known to someone else, and if you look around, there’s always someone who knows the person who understands a particular component inside and out. This culture of collaboration is what makes solving complex challenges both efficient and rewarding.

I’m filled with gratitude for the opportunities I’ve had and the projects I’ve been a part of. Recently, I received a tenure award—a beautifully crafted piece of aluminum, which is Apple’s way of reminding employees that even a simple block of aluminum can be elevated to its highest state. It is this devotion to Craftsmanship and innovation that excites me to be part of this journey.

With the advent of AI and the constantly shifting technological landscape, who knows what the next decade will bring? But I will always remember the 10 years I’ve spent on this spinning planet, in the middle of nowhere, as part of this incredible company. That’s something I will cherish forever.

Why I love Lego?

My lego obsession began around the time I was around 10, I distinctly remember constructing a police van & a gas station providing for an amazing build and hours of play later. I also remember an incredible Airport set that my friend had. Just thinking of it gives me joy.

Today as an adult I still have fun building legos. Lego provides a model to see the world. When you see an object like a car, an airplane or even a city, you think about it in terms of building blocks. What building blocks is something made of?

Lego teaches you to build an object one brick at a time. The steps are tedious in larger builds but seeing a goal of where you are headed, it’s exciting to combine bricks into a part & then parts into a larger object. Building lego is a very physical act, it forces you to work with your hands. Thats deeply satisfying to me.

Building Lego is an immersive experience and you can find yourself in a flow, you have to pay attention or risk getting a wrong part in or missing a step. A process which may derail your build if the error is discovered late. Lego teaches patience & dealing with consequences of being wrong.

Lego when built with family or friends is a social act. Divide and conquer the build & also use it as a teaching moment when done with little ones.

The Technics are great showing gear movements and its fantastic to see the gears moving in harmony, whether it be to move a lever or retract wheels in an airplane. Each time I’m on an airplane when the landing gear is deployed or retracted I think about the gear mechanism I built in my cargo plane.

Separately, There is nothing more motivating that seeing an unfinished lego build. Once the build starts it must be completed.

My most recent builds have been lego trains. Trains offer complexity and a never ending canvas. You can keep adding tracks, trains & switch tracks. I started out with a cargo train & ended up with 2 more that I love to run on my ever expanding tracks.

Then I discovered that the power units for the trains were programmable with a simple visual programming language like MIT scratch. There is also a option to program lego in python called pybricks. So you can make the thing you built do something. The unit that controls the motor is programmable and so I’ve been building robot trains that avoid collisions, stop & go based on seeing certain bricks. This entailed getting special color & distance sensors

In building lego the journey is the destination with the most joy derived during the build. Building Lego is a creative act in the physical world & that is why I love lego. I’d love to learn about your experience with lego or similar toys?

9 Things I learned visiting the House of Mouse

There I was at the gates on Disneyland Resort in Anaheim on the 21st of April 2023. Disneyland is a magical place but even more exciting is the Parks & Recreation business. Uncle Scrooge would be a happy owner.

https://www.sec.gov/Archives/edgar/data/1744489/000174448923000097/fy2023_q2xprxex991.htm

Since the end of the pandemic the Parks division of Disney (DIS) has seen tremendous growth, 17% YOY in Revenue and 23 % YOY in Operating income. I was right there during this period and it feels about right.

The operating margin is an eye popping 25%, excluding the consumer products.

Financials aside, these are some observations I made.

  1. Captive Audience -Disney has a captive audience when people visit their resorts. People who are already persuaded to locate themselves in a real estate utopia owned by Disney. People who can be sold expensive food, drinks & souvenirs.
  2. The Power of Attention – In the park the attention is on all things Disney. IP that has been created by Disney over the past 100 years is front and center.
  3. Time is money – Disney will sell you the right to skip lines on rides with Genie+ and individual lightning lanes to save time. They are implementing the time is money maxim. Here’s a tidbit from their 10-K filing. This is literally money for nothing.

4. Product Placement – Stores right when the rides end, perfect persuasion for families to buy Disney Merchandise. Being aware of this, Me & my wife were successful in dodging this with the only souvenir being a 8$ driving license from Autopia.

5. Content is King– The fuel for Disney’s empire is the content they have. From Mickey Mouse to Lightning McQueen, the catalog of characters that Disney has is unmatched and they come to life in the park, giving users the Joy of interacting with their favorite characters. Here’s a photo of Woody!

5. Reinforcement – What Disney does well is reinforce its content via its rides and shows. So any character that you are familiar with be it Woody or Mickey or Lightning McQueen you would see the character and story being reinforced in a ride. For me the two favorites were Mickey’s Runaway Railroad & Runaway Racers. The Rides are reliving their content.

6. Immersion is Persuasion

You are in an environment that immerses you in the Disney, Pixar, Marvel and Starwars world. It’s easy to get caught up in the moment and make purchases. My favorite immersions were in Radiator Springs & The starwars world where I bought a special edition Coca-Cola. It was a lot of fun to meet Lightning McQueen in Radiator Springs.

7. The Power of Branding

Disney IP is front and center, be it on a ride, the name of a street or even a bakery item. I loved the Mickey Pretzels and cookies 🙂

8. Creating a Spectacle

No one does this better than Disney. That is some cool projection technology, projecting their content on their castle & waterworks. Their Parades are legendary too. A spectacle creates a feel good effect which gives people happy memories associated with Disney IP. This also serves as a reminder to check out content on Disney+ once you are out of the park.

9. Here is Walt Disney’s strategy chart from 1957 and it still rings true.(source). What a delight to see it in action.

I hope you find this educational and are amazed by the corporate machine which Walt Disney Created. Thanks for reading.

Why I love News

The earliest memory I have of reading a newspaper is 4th Grade which may be early or late depending on where you grew up. It was the most fascinating thing I ever laid my hands on. The ultimate never ending story. 

I remember reading the Times Of India discovering the intrigue of politics & business to the steady statistical reporting from Sports, It was magical. The story of the world unfolding in real time. I was hooked, News is my crack. I begin every day reading the Wall street Journal. I am restless on Sunday when there is no edition. I fill that gap by reading the Financial Times which thankfully releases their Monday edition when its Sunday afternoon in california.

News today has evolved beyond the traditional news paper to Twitter feeds, Substack and Patreon. So the question really is, do you really need the news?

News to me is entertainment & a window to the world. If you are seeking truth, it may be disappointing as news is littered with bias and misinformation. The way to fix it according to me is to read a lot of it, right, left center and then form an informed opinion about where the truth lies. Following people on twitter, Subscribing to newsletters from Individuals who are subject matter experts is good too. For me, that means following Matt Levine, Ben Thompson and the anonymous Doomberg.  

News can be terrifying reading about the War in Ukraine or the massive earthquake in Turkey. News can be humorous too, with articles such as Jeff Bezos’s yatch being stuck in rotterdam because a bridge would need to be dismantled to reports about a person who went for a fish bone extraction from his throat and complained about nearly dying from starvation due to the amount of time it took before the 10 minute procedure was performed. News reveals the quirks and edges of humanity.

News can also be inspiring. I learned about Warren Buffet and Charlie Munger &  How they built Berkshire, to learning about how software is eating the world. For someone in technology hacker news is a fantastic source of information, that is where where I first read about bitcoin and now chatgpt.

Reading news for me is energy. Connecting the dots across different stories and perhaps getting a peek into what’s next.. 

That is why I love the news. I’d love to know where you get your news from?

Why I love Golf?

It so happened that a friend suggested we take up Golf. So there I was at a driving range trying to hit but not quite succeeding. This was followed by a 9 hole following my learn by doing philosophy. I ended with a sore arm. It was so frustrating and indeed time for a lesson. I learned my grip was completely wrong as was my stance. My coach corrected that and “Thwack” a perfect hit with a 7 iron. Never thought a grip could make such a difference.

Golf is ridiculously simple, get the ball in the hole, yet incredibly hard. Golf is the perfect pandemic sport with distancing made easy after tennis of course. Golf is about strategy and execution, How do I not land in the sand pit or pond ? What club do I use? Remember Archimedes, “Give me a long enough lever and I will move the earth.” Well It turns out the different numbered clubs are actually levers. The lower the number the longer the length and the farther you can hit. I thought it was the reverse when I played my first 9 hole. Golf is about learning technique and applying it.

Golf is a vacation for the mind. When I go to the course I forget about everything else. Golf is about making that drive that lands you on the green. Golf is about making that perfect putt that will land the ball in the hole or that prized hole in one. Golf is about cheering your friends land that perfect shot. Golf is about walking a lot. Golf is about building camaraderie and that is why I love golf.

The value of a dollar.

Imagine I write a contract which will give you exactly 1 dollar on 1st  January of each year forever.  Now I put up this contract for sale. What is the value of this contract?

A 100$, a 1000$, a million dollars?

It turns out there is a rational answer to this question. But first lets dive into the concept  of time value of money.  What it means is that a dollar today is worth more than a dollar tomorrow due its growth potential when invested, risk and inflation.

For example a investing 100$ today at 5% annual interest would yield 105$ one year from now. Therefore 105$ a year from now is same as 100$ today at a 5% interest rate.

We can verify this with.

FV = PV x (1 + r) ^n

where FV = Future value

PV = Present value

r  = rate of interest

n = no of  periods

Coming back to our problem:

Compute the value of a contract that gives 1$ on the 1st of January of each year forever.

Assume a discount rate of 5%. [the return that could be earned per unit of time on an investment with similar risk]

To compute the value of a our contract we need to discount each payout to its present value and sum them up.

PV = FV/(1+r)^n

Present value of 1$ 1 year from now = 1/(1.05) = .95$

Present value of 1$ 2 years from now = 1/(1.05)^2 = .90$

Present value of 1$ 3 years from now = 1/(1.05)^3 = .86$

………..

Present value of 1$ 10 years from now =1/(1.05)^10 = .61$

………..

Present value of 1$ 100 years from now = 1/(1.05)^100 = $.007

 

……..

 

Note that as the no of years increase the present value of a future 1$ tends to 0.

asymptote

Using the  NPV (net present value) formula found in excel or summing all  individual present values that were computed gives us an approximate valuation of 19.85$. Note that changing the discount rate would change the valuation.

To conclude given a discount rate of 5% the value of a eternal contract paying out 1$ every year is only 19.85$ today !

 

 

 

References:

https://en.wikipedia.org/wiki/Time_value_of_money

https://en.wikipedia.org/wiki/Net_present_value

 

The Snowball

I read “The Snowball: Warren Buffet and the Business of Life” recently.  The Snowball is about the power of compounding. How Warren Buffet has applied it to his money, his business and his relationships.

I couldn’t have though of an more apt name. Now this is a person who does not use email or computers.  Rather serendipitously I also saw “Becoming Warren Buffet” the documentary on his life.  I am blown away by his simplicity.

Here is a person who doesn’t work for money and has been tap dancing to work for over 50 years. Surely We can learn something from him.

Health – We have one body and one mind. Take care of it. Warren Buffet doesn’t drink alcohol and exercises every day. What did you do today to take care of your health?

Reading – Warren Buffet is a reading machine, reading 500 pages every day. Transforming information into knowledge. Reading is one of the best investments we can make. What have you read recently?

Leverage  – Warren  Buffet transformed Berkshire Hathaway from a struggling textile company to Global conglomerate with the power of  Leverage. He was the first to use insurance premiums to buy public companies rather than invest it in bonds.  The premiums effectively were other people’s money (OPM) . Premiums collected for years before any payouts were made. How can we find ourself in a situation of leverage? I can think of automation, effective teams and unique knowledge.

Moats – Warren Buffet is a master of investing. He is an expert identifying companies with moats that are hard to breach. A moat can be thought of as an unfair competitive advantage. Berkshire is a company with a huge moat. Each time an iPhone is bought, a Coke is consumed, a Geico insurance policy is purchased and much more Berkshire gets a part of the profit. What Moat are we creating with our skills?

Time- He gives his investments time. Think Decades. What was the last time you thought about something in a decade timeframe? When we think and act in the long term the power of compounding can take effect. This applies to money as well as knowledge.

By being 1% better each day we can have an outsize impact over our lifetime. Good luck on this journey!

“Life is like a snowball. The important thing is finding wet snow and a really long hill. ” – Warren Buffet

 

 

What I learned in 2017?

Happy new year to you on this first day of 2018.  Here is what I learned.

  1. The most important thing is to cherish time with loved ones. Death is final. You and I both move towards it each moment even as  we pretend it will never happen. I lost my grandfather early in 2017  and was deeply anguished by his loss. He had led a full life, so there wasn’t much to mourn but I was surprised by my own reaction.  I read a beautiful quote by Osho “We mourn not for the person who died but for ourselves, we mourn for the lost opportunity.” That has led me to meditate more and be in the present. Make death a guide to take the important decisions in life.
  2. Persuasion is a skill every software engineer should learn. To execute ideas you care about, you will need to persuade managers, program managers,  executives and even your peers about its value. Every product you see has an enormous amount of persuasion baked in by the creator.  A good place to start is http://blog.dilbert.com/2015/09/24/the-persuasion-reading-list/.
  3. To become a better public speaker and communicator, I completed the Dale Carnegie course. This I did on the recommendation of Warren Buffet and Scott Adams. Try it out, it will transform you. I went from being a nervous public speaker to enjoying it. One nugget I got out of this is that adults are as starved for appreciation as children. Sincere appreciation shown to people will energize them. You being here and reading this post tells me that you are a seeker of knowledge and a constant learner. I wish you a very fulfilling 2018!

Why I love to Swim

I enter the water, feel the change in temperature and dunk inside. Then I swim, propelling forward as I exert my body in this amazing medium that is water. Swimming is a way to summon my attention. Attention which is constantly stolen by the internet, by phones, by people. Swimming is a way to clear clutter from the mind. A garbage collector for the mind.

Each breath utilized to move forward. Each action taken with the purpose of  floatation or movement.  Swimming is meditation. Swimming  is a reminder of life with each breath. Swimming is a reminder of death with each dive. Swimming is about living in the present and being in the moment.A good swim is energizing. That is why I love to swim.