Author Archives: Lou Franco

How Programmers Can Beat the Market

In my last few posts I’ve been trying to model net worth over time as a function of savings. In my last post, I used real historical market data instead of a constant 6%. Looking at a few scenarios, the market returned more like an average of 9.5% over those time periods.

I still think you should use 6% in your plans (if it’s actually 9.5% in the next 60 years, then that’s good news—you can make adjustments every decade if you are way ahead of plan).

Reminder: I am not a financial advisor and this is not advice. I don’t know anything about your personal situation. Talk to a fiduciary if you want advice.

But, you might think: “I bet I can beat the market—I understand tech/bitcoin/stonks better than most people.”

It’s not likely.

S&P keeps a scorecard of actively managed funds against their benchmarks. In a single year, active funds may do ok against the market, but go to page 9 and look at their longer term performance. 75% don’t beat the S&P 500 over 5 years, and 94% don’t beat it in 20.

These are funds with professionals with a staff who spend all day, every day thinking about this and are paid based on performance. You can beat 94% of them by just putting your money in an index fund.

But, then what do you do with all of that free time?

To beat the market, remember that you are also a player in a market. If you work full-time, you are in the labor market. You could also create products and sell them (in the market).

Look at your current net worth. To pick a random number, let’s say it’s currently 100k. If the market returns 6%, you’ll have 6k more at the end of the year. If you try to beat the market by picking stocks, and get 10%, you have made $4k more. Let’s say your net worth is $500k. Working to get that 10% return will get you an extra $20k.

Is this really the best way to make an extra $4-20k? It’s not a sure thing—you might not beat the market (like over 50% of active managers each year). You could lose money.

So, instead, invest in yourself.

To “invest” in the labor market, you could take courses to make yourself worth more and then either ask for a raise or change jobs. You could raise your profile with an open-source project, writing, or by giving talks. You do not need to be “famous” to do this. Your projects or work don’t need a million followers. You could beat the market with a few dozen.

Outside of your job, you could seek side-income. If you make $100/hour, you only need 40 hours of consulting (less than 1 hour/week) to “beat the market”. Technically, you beat the market in your first hour.

Or with your first sale.

And there aren’t a lot of costs to consulting, e-books, or software (other than your own time). But, at least you know that the time spent will net a positive return. Even if you make no sales, it’s pretty likely that you have made yourself more valuable.

If you spend 40 hours and make $4k in the market, that’s a one-time effect. You haven’t made yourself more valuable, and it’s unlikely you can do this year after year. If you get a $4k raise, your salary is $4k higher the next year too. Beating the market is automatic and you can build on it.

More good news: the less you money you have, the more “return” you can make this way. If you have $10k in the bank, making $10k on the side doubles your net worth. Getting a $5k raise is like a 50% return.

You can’t beat that picking stocks.

Adding Market Data to the Net Worth Spreadsheet

I found some historical market data on an NYU business professor’s home page. I put the first four columns on a new sheet in the Google sheets version of the net worth estimator.

I also put a sample portfolio that you could play with. It’s 70% stocks and then a mix of bonds.

Then, on the main sheet, I use the portfolio return column instead of the fixed 6% return.

Historically, a portfolio like that returned more than 6% — more like 9.5% on average. I showed three lines, one for starting in 1928, one for 1948, and one for 1958. Since I am trying to simulate 60 years, that’s about as late as I can can start. But, for planning purposes, being conservative is still a good idea in my opinion (which is worthless as I am not a financial advisor and this is not advice).

There are many things wrong with this model that I’ll address soon. The main issue is the the post-retirement spending model seems way too low. I am also using a constant inflation rate instead of historical data. Finally, wage inflation has not necessarily kept up with inflation, and certainly in down market years, we could expect wage freezes or temporary unemployment.

All of these things are a lot easier to model in python.

FIRECalc only simulates net worth after retirement, so it can do many more simulations (because of the shorter duration). Still, there are more than 40 possible scenarios in this data.

Next, I’ll add this data to the python version and try to draw more scenarios.

FIRECalc

In my net worth estimation spreadsheet, I used 6% as a default market return and recommended that you keep it conservative. If the market happens to be better that that, that’s good news. If you estimate it too high, then you might not save enough.

Another way to model this is to use historical market returns year-by-year.

The site FIRECalc does this for understanding post-retirement spending vs. expected market growth. It takes your portfolio size and starting expenses as input and then draws a line on a graph for each possible retirement year using real market data. You get an idea of what would have happened in all possible historical scenarios and what percent of the time you would not have had enough in your portfolio.

If you want to do a more sophisticated analysis, there are advanced versions on the site. For example, it assumes constant (inflation-adjusted) expenses, but if you want to do something more sophisticated than that, it offers a few spending models. You can also adjust your portfolio stocks v. bonds balance.

Doing this kind of analysis is the kind of thing that’s fairly easy to do in a program, but not as easy to do in a spreadsheet. It’s not impossible, but you would need a couple of columns for each scenario. In my version, to show 30 different saving scenarios, I need 60 columns, plus a few columns for the actual historical data.

I’ll work on updating the spreadsheet to show a few scenarios to give you an idea.

My Second Lesson in Personal Finance

Last week, I wrote about the first lesson that made a big difference in how I thought about personal finance. Namely, that savings rate is a big driver to outcomes, and that it is very much in your control. Along with that is the binary outcome of whether your savings grow or shrink in retirement and the divergent net worth results you will have as a result of that.

The next big lesson I got was from reading Ramit Sethi’s I Will Teach You to be Rich [amazon affiliate link]. By the time I had read this (I was 39), my finances were pretty much in order, and most of the book was more of a reinforcement that I was doing the right thing. It’s also a very entertaining read.

However, I did get one thing—a change in mindset to focussing on income over expenses to increase savings.

Look at the Net Worth spreadsheet. If you set it to a fairly high earner, say 100k to start and a savings rate of 20%, then at 39, they need to save around 28k.

This is aggressive. It would be hard to do much more. If you pay 30% for taxes and 25% for rent, you only have 25% left for everything else. It’s hard to imagine that you could find another 10,000 in savings.

But, finding another $10,000 in income is really not that hard for a programmer.

The book (and his site and blog) give many examples, but simply asking for a raise is probably the simplest and most likely to work. If you get into a habit of renegotiating every year, the combined effect compounds.

His other suggestion is side income. If you are a programmer, there are many ways you could do this. I tried many things over the years. In order of income success:

  1. Advisory consulting on software projects
  2. Programming side-gigs
  3. An Excel add-in
  4. Tutoring/Coaching programmers (I mostly do this for free, but I charged people that could afford it or where their company paid)
  5. Writing a book
  6. Writing for Smashing
  7. Add-ins for niche software (including for a future employer)
  8. iOS Apps (they are all free now, but early App Store was more amenable to paid apps)
  9. iOS Skillshare classes

Over my career, I made significant side income directly from this, which I mostly saved. In addition, many of these things directly altered the course of my career and led to better jobs.

For example, writing apps led to getting a book deal and becoming an iOS programmer with at least some credentials. That helped me get consulting gigs when I did it full-time (or on the side) and was a factor in getting hired by Trello (along with, possibly, the add-ins I made for FogBugz and CityDesk).

The Net Worth Spreadsheet in Vanilla Python

This article is based on the spreadsheet I made to estimate net worth over time.

I think that Excel is basically a programming language, and I have an interest in bridging the gap from it to more traditional languages. And I needed an excuse to get matplotlib working on my machine.

Luckily, procrastination worked in my case. If I had tried it a few months ago, numpy was not yet working on M1 macs, but as of python 3.9.4, it installs normally using pyenv and pip.

I started a GitHub repo to hold the Excel spreadsheet and python port — I’ll be posting more ports to various frameworks. I like it as a simple example because it has conditionals, loops, arrays and is a pretty useful thing to know.

It’s also a good starting point for learning more programming. Excel is great, and there’s a lot you can do, but with the python version, I could add the following features.

  1. Instead of using constants for the various inputs (like market rate), use a lambda and define different ways the market could move rather than constant
  2. Do similar things with spending models in retirement, inflation, etc.
  3. Make it easier to have more lumpy spending/saving — meaning, assume aggressive spending in youth, then a period where you might have children and buying a house, then a house sale in the future, etc.
  4. Make it possible to show many more scenarios at once (like 30 historical market curves effect on your plan)

To be fair, all of this is very possible in Excel. It’s just a lot easier in python.

Write While True Episode 9: Deprivation

I don’t use a lot of social media, but if I don’t plan my time intentionally, I’ll find myself watching a lot of YouTube.

It’s not that I think that my life should be 100% dedicated to making new things or in solitary contemplation. But, there are times when I notice that level of output isn’t where I want it to be, and so I take a good look at how I am spending my time.

Transcript

The Net Worth Spreadsheet Documentation

Yesterday, I posted a spreadsheet to help you explore how savings rate relates to eventual net worth in retirement.

It’s a very simple spreadsheet with a simple model, so I wanted to document it here in case you want to play the formulas.

Here is a description of the inputs and how they are used.

Age/A2: Your age. You can set this to your current age, or a past age if you want to figure out a benchmark

Year/B2: The year associated with the age in A2.

The sheet allows you to compare two scenarios. I1:I8 corresponds to Scenario A (the blue line) and K1:K8 corresponds to Scenario B (the red line)

Starting Net Worth/I2/K2: Your net worth at the age in A2

Market Return/I3/K3: The market return that will be applied to your net worth at the end of each year to determine the starting point for the next year. Obviously, this is simplistic. I recommend keeping this conservative—Use the nominal return (not the return after inflation).

Starting Salary/I4/K4: The gross salary (or income) at your age in A2

Inflation/I5/K5: The rate of inflation to use on expenses after retirement.

Raises/I6/K6: The expected % raise to your salary you will get each year. I set this a little over inflation. It is expected that your expenses and savings increase proportionally such that your saving rate stays constant.

Retirement Age/I7/K7: The age you plan to retire. At this point, you start to draw down against savings. Inflation is applied to the expenses every year. The starting expense amount is estimated based on your savings rate.

Savings Rate/I8/K8: The % of your gross income that you save.

Things this spreadsheet does not try to model:

  • Big expenses like houses and college tuition
  • Increasing expenses because of children
  • Volatile markets
  • Windfalls

Very Simple Net Worth Estimator

Yesterday, I wrote about my first lesson in personal finance where I saw what the effect of savings rate had on retirement outcomes. I focused on the binary result of your net worth growing or shrinking after retirement.

I made a simple spreadsheet if you want to play with this yourself.

Here’s a link to a Google Sheet you can copy.

And here’s an Excel version.

To use it

  1. Put your age in A2
  2. Put your current net worth in I2 and K2
  3. Put your current salary in I4 and K4

I would leave market return, inflation, etc alone and concentrate on seeing the effect of different savings rates. You can see the actual saving amounts in Columns D and F.

Of course, you should not take this as financial advice or even assume these spreadsheets are correct — check the math (let me know if you see an issue).

They are not meant to be accurate models, they are a very simple way of looking at it.

Remember, you can’t really control a lot of the variables on this spreadsheet except saving rate, which you have a lot of control over.

I’ll soon talk about income, which is the other big variable you can control. In this spreadsheet, I have assumed that you get raises slightly more than inflation.

The Day I Learned About Personal Finance

When I was in my early twenties, I got a call from a financial advisor asking if we could have a meeting to discuss my finances. I would say at that point (compared to now) I knew very little, but I did save a lot, maxed out my 401k, and didn’t have any debt. But, aside from the 401k, my money was just in a bank.

I agreed to have coffee with him.

Over the phone he took a bunch of information from me. My age, my salary, my savings, etc, and then at the meeting, he brought a small spiral bound book with a personalized plan.

I can tell you right now, that that plan was probably not good. He, almost certainly, was not a fiduciary, and the mutual funds he wanted to put me in probably had high fees.

One page of that book, though, changed my life.

It was a line graph. The x-axis went from 1995 to 2055 or age 25 to 85. The y-value was my predicted net-worth. This was the result of using my expected salary growth, my savings rate, expense growth, my current net worth, inflation guesses, expected return, etc. You can find many such calculators on the web or do it yourself in Excel.

It was as you would imagine, an exponential growth curve that results from compound interest as long as returns and savings grow with respect to expenses and inflation.

The part that surprised me was that at 2035, when I would turn 65 and presumably retire, the curve had a noticeable notch, but still basically grew, but on a different exponential curve.

I asked how it could still go up after I retire, and he explained that at that point my investments would make more each year than I needed to spend, so they would keep growing.

I recreated the shape here.

In my mind, the red line was what I was going for—it’s not a bad outcome. He showed me that the blue line was not only possible, but actually, I was already headed there if I kept my savings rate. Most of the assumptions were fairly conservative. The only difference between those lines is expense growth (or, in other words, savings growth).

I honestly didn’t hear anything else he said that day. Look at what a difference it makes.

Assuming that you are not a stock-picking genius (spoiler alert: you’re not), and you are getting market returns from index funds, the only variable you control is savings rate. Of course, there are several components of savings rate, which I’ll talk about soon.