3 Years into Self-Taught Programming, 9 Things I Wish I’d Learned Earlier

For anyone without a technical background, there’s a feeling of magic the first time you write code that makes a computer do something. Within a few days of any introductory programming course, you get a peek behind the curtains of the endless possibilities of what a human can tell a computer to do. 

While most intro courses focus on the language–variables, loops, conditionals, objects and classes, etc–soon enough you’ll find that there’s a part of programming that’s separate from the language itself. This includes the tools, strategies and workflows that help you write good code, and actually construct and deploy useful programs.

While there are upsides of learning how to program in a self-guided way, it can be hard to know which fundamentals you’ll really want to learn and internalize early on. The real problem is you don’t know what questions to ask. 

Here are a handful of things I’ve learned along my journey, and wish I had learned much earlier. Some of them are simple, but I think all will make you a better, more productive programmer.

Note: since I primarily code in Python, I mention a few Python-specific tools, but the principles can be applied to any language.

1. Before you write the code, write the logic

Programming is an effort in logic, not typing. It’s our job to translate that logic into a language a machine can interpret.

The beauty of a language like Python is that you can write useful programs very quickly. This is also its curse, as it’s tempting and easy to immediately start writing code without fully knowing what you’re trying to accomplish. Resist the urge. 

Get familiar with pseudo-code. Write out what the inputs to your program are, what your program should do, in what order, and what the output should be. Think about what can go wrong–why won’t the data be what you think it will be? What conditions would prevent your program from running? Every time I spend more time than I think is necessary on the logic of a program, it benefits me. 

2. Master your text editor

The goal of any tool is to provide leverage for you. An axe makes felling a tree easier, and a text editor should make writing and running code, faster, easier, and less error-prone. Learn and customize keyboard shortcuts, master the core functionality and make it visually appealing. Try a few before fully committing to one. Your text editor needs to be a force multiplier, not a source of anxiety every time you open it. Take a few hours to understand how an editor can make your life easier. 

FWIW, after trying a few out, I use and love VS Code

3. Get familiar with industry-standard libraries and packages

New, exciting libraries, packages, and projects arise all the time, and it’s easy to get excited about all of them. While always keeping an eye on what’s new, mastery of the core, fundamental packages and libraries that are time-tested will serve you well.

Packages and libraries become popular because they solve common problems–ones you’re likely to encounter.

You’ll also benefit from community help. The more obscure of a tool or package you’re using, the less help you’ll be able to find online. 

In Python, depending on what type of work you’re doing, some core libraries to master include os, numpy, pandas, and requests (among many others). Learning these inside-out will make your life a lot easier, and give you the tools to solve the problems you come across most often. 

4. Build systems, shortcuts, and scripts for the things you do all the time

This is all about quality of life, and reducing cognitive load from the things that shouldn’t require it. The cost of the task that takes 30 seconds every day, or 3 minutes once a week, is more than just the time required. It’s also the mild annoyance that comes with spending time on something you know a computer can do, and it’s just another thing we need to hold in memory.

Do your programs often have the same set-up? Create a custom keybinding that auto-populates this structure.

Do you run a script at the same time every day? Schedule it.

Do some excel manipulation, then email that out? Automate it.

There’s a very real satisfaction when you outsource a repetitive task to a computer. 

5. Read professional code

If you want to be a better writer, you should read. This is also true if you want to be a better programmer. Luckily, the internet is overflowing with open-source projects that you can learn from.

Reading “professional” code has done a few things for me: first, it’s taught me how to write better code (what’s an appropriate level of extraction? what’s the best way to check for exceptions, etc.); probably more importantly, it’s built my confidence by realizing that all the basics–variables, loops, conditionals, functions–are also the things that professional programmers use. There’s a nice feeling when you see that a function is written the same way you would write it.

Flask and Requests are two, oft-cited as particularly well-written, Python libraries.

6. Use a formatter

This is the easiest step on the list and will take 5 minutes. Using a formatter will ensure the style is consistent across all of your Python files. No more weird spacing, inconsistent quotation marks, etc. You shouldn’t spend any mental cycles on how to format your code–this is a nice piece of software that takes care of it for you, and in the process, makes your code easier to read.

I use black and love it.

7. Use git

This was the most intimidating for me on the list, but git has become one of my favorite pieces of technology. At some point you’ll run into the following scenario: you’ll have working code, you’ll make an update which breaks your code, and you won’t be sure how to get back to the code that actually worked. You’ll stumble through a Project V2, then Project V3, and Project Final, only to forget which version contained that one feature you want. Git eliminates this whole process, and provides a traceable history of your projects.

Working off branches instead of a single master file makes coding more reliable, and less stressful. And if you ever collaborate with others on a program, this is likely the way you’ll do it.

I recommend starting with GitHub desktop, which makes branches, commits and pull requests a breeze, without needing to use the command line.

8. Use spaced repetition for the things you know you’ll rely on again and again

There’s a mountain of evidence on the effectiveness of spaced repetition for memory consolidation. The theory is that we should test our knowledge of something at the moment we’re about to forget it. Tools like Anki make spaced repetition easy to set-up.

While nearly everything is google-able, coding is a lot more enjoyable when commands, methods, libraries, etc are in your head, and you can stay off of Stack Overflow.

When you learn something new, create a new Anki card, go through them a few times a week, and be amazed at how much you retain.

9. Conduct an After Action Report when you’ve finished your project

Once you’re finished with a project, it’s easy to move right on to what’s next. An After Action Report helps you consolidate your learnings, and reevaluate how you went about solving the problem.

Could you have structured your program in another way? Does part of the code run slower than you would have anticipated? Did you find some quirk about your data? This exercise will make you a better programmer. It will help you think more critically about your code, and even lead you to novel solutions.

Nothing replaces clear thought, a well-structured program, and legible code. But there’s more to the craft of programming than the code itself, and hopefully this list helps you consider a few ways to up your effectiveness as a programmer.

Towards Better Health Apps

Data is only useful when it leads to better decisions and behavior. While many of us collect and possess troves of health-related data about ourselves, I think we’re in the very early stages of extracting value from that data.

I spend most of my time these days around pro athletes and former athletes, a health and performance conscious bunch. The majority use some kind of personal tracking device—Whoop bands, Oura rings, Apple Watches, FitBit, etc. Many of us also log our workouts either by hand, or with an app like Strava.  While the wearable and training data are fun to look at, they don’t often change our behavior, or better yet, facilitate some action on our behalf. We are collectively succeeding in data acquisition, but failing to use the data to make ourselves healthier and fitter, the ostensible goal in collecting all of this data.

In many parts of the digital world, past data is used to make a decision about the present, whether that’s deciding which ad has the highest probability of getting clicked, or how to translate a phrase from English to Spanish. This is the allure of self-driving car technology: use past data to train a system that makes better decisions than humans, in a realm where the downside of a bad decision can be fatal.

Current State

Unfortunately, we haven’t reached the point where we can use our health data in the same way. Even if we’ve collected all the personal data we need in order to know what we should eat, how we should exercise, or when we need more recovery, the data is often in disparate systems, with no central layer aggregating, learning, and recommending the best action on our behalf, greatly reducing the value of any data we’re collecting.

With existing technology and standard lab tests, we can track our sleep, the physiological load and intensity of our workouts, how recovered we are, how different foods impact our glucose levels, all of our hormone levels, etc. On their own, all of these datasets are interesting and potentially helpful, but the biggest value comes through integrating them together. 

While apps like Gyroscope and Apple Health connect some of these disparate datasets, it’s still difficult to answer questions like how does what I eat affect various hormones and energy levels over time? What’s the optimal food and timing to eat before an afternoon workout? How should I change my workout after a poor night of sleep? The most dedicated trackers can get these answers by spending a lot of time wading through and matching raw data files, but most will never go to these lengths. Eventually, I think we’ll see a centralized layer of our personal health data that provides very specific, personalized insights that answer these important questions.

Recommended Actions

Once we have a common layer where our data reside, the next logical step is a system that recommends and automates decisions based on our personal data. In the current wearable and testing ecosystem, our data live in separate vacuums, behind the walls of the testing or tracking company, which leaves the individual responsible for connecting the dots, and making behavioral changes based on the data.

I think there can be a better way; instead of a system that decides which ad to serve, we’ll be interacting with a system that takes as inputs our sleep data, most recent blood tests, workout data, glucose levels (and whatever other data we have), and produces an ongoing series of recommendations for us:

  1. an auto-generated Instacart grocery order each week consisting of only foods we know we tolerate well and supplements that our blood tests suggest we could benefit from. With a click, we confirm the order.
  2. a daily workout that responds to our most recent workouts, diet, and recovery metrics
  3. on nights we need more sleep, the system triggers our phone and computer to require 2-factor authentication to access past a certain hour, and our lights automatically dim earlier in the evening

The list of potential use cases goes on, but the point is that the insights that already live in the data we have today actually turn into actions that improve our health, mood, and productivity.  Humans have a long history of acting with amazing irrationality regarding their health, and technology like this can help our plight.

Examples of technology using personal health data to recommend an action already exist. After a suspected fall or elevated heart rate for an extended time, Apple Watch will prompt you to make an emergency call, which has likely already saved many lives.  How do we get technology to take similar actions for us in more benign, non-life-threatening scenarios?

Where to next?

The progress of companies that are built on recommendation engines is staggering–Google, Netflix, Spotify, and Amazon are all world class in predicting what you want to see, hear, or buy next. While Google has an online fingerprint of all of us, there’s not yet a great physical fingerprint–just disconnected smudges that give partial information about us. Once these various pieces coalesce, technology’s ability to provide better lifestyle guidance will reach new heights.

If our goal in tracking biological and physiological data is to feel better, be more energized to do the things we love, perform better, and have more mental clarity, then we have to understand how these various biometrics connect together, and how the lifestyle choices we make impact the quality of our lives.

Better Sleep and More Recovery with Nightly Cold Showers

In my original sleep analysis, I highlighted my REM sleep and sleep efficiency as two areas to improve. Unfortunately, when it comes to improving either, an internet search returns a deluge of articles with generic advice and no data backing up their claims.

To try to get to an answer of what actually works, I’ll run a handful of sleep experiments over the coming months. I decided to start with cold showers because (a) I like them (b) they’re easy and cheap and (c) there is some evidence that they have health benefits.

It turns out that quarantine is the best time we’ll ever get to conduct self-experiments because almost every day is the same, limiting the number of variables between the control and intervention periods.

The Experiment

My experiment was dead simple: 3 weeks of normal sleep, followed by 3 weeks with a cold shower every night within 90 minutes of bedtime. The showers, which were as cold as my shower would go, lasted between ~3 to ~10 minutes, but I didn’t time them every night, and didn’t use the duration in this analysis.

I tracked my sleep with the Oura ring, which you can read more about in my last sleep post. I’m a fan of the ring because it’s non-invasive, holds a decent charge, and provides quick feedback on the main things I care about.

One night I forgot to take a shower, and another I forgot to charge my Oura, so I ended up with 19 nights of sleep data.

As far as I could tell, I had similar exercise, diet, stress, caffeine intake, and schedule during the Cold Shower and non-Cold Shower periods, but didn’t track most of this. 

Cold Showers

Representative of the first 15 seconds in a Cold Shower

There’s a masochistic element to cold showers. The first 15 seconds suck, but they’re unbelievably invigorating and have an immediate positive impact on my mood, at any time of day.

There is some science behind cold showers. If you’re interested in the details, this is a good meta-analysis of various studies. Among the potential effects: short-term increases to noradrenaline and dopamine, increased well-being and decreased anxiety, antidepressant effects, and immunity boosting.

Whether any or all of these purported benefits are true, it’s hard to deny the subjectively great feeling when hopping out of a cold shower or plunge. 

Results

My total sleep was impacted the most, up 30 minutes during the Cold Shower experiment. My Deep Sleep remained unchanged, while I saw a 13% boost to REM Sleep for an extra 10 minutes of REM sleep a night. While my REM Sleep:Total Sleep ratio was largely unchanged (18% → 19%), I’m happy about any increase in overall REM.

Sleep Efficiency

In addition to REM, I’m most interested in increasing my sleep efficiency so I can spend the same amount of time in bed, while getting more sleep. I was happy to see a bump from 90% to ~93% during this experiment.

Recovery

I’ve spent less time focused on recovery metrics like Resting Heart Rate and HRV, but it was encouraging to see the positive impact cold showers had on both of these metrics. My RHR was almost a beat and a half lower, and my HRV increased about 10%. 

Conclusion

I didn’t track my energy levels or mood, but my subjective review is that my “top end” energy was about the same, with a more consistent, steady energy throughout the day. Those mid-day energy troughs were eliminated, which was a big win.

This is decidedly not evidence that cold showers are a sleep panacea. I’m always wary of n=1 experiments, but the results were uniformly positive, so this is something I’ll definitely continue.

As for the mechanism of action, my hunch is that there are equal parts placebo, and a stress-reducing, mood-enhancing effect, leading to better sleep. 

I highly recommend people give this a shot for at least a few consecutive days. Once you get past the initial burn, you’ll settle into what soon becomes an unexpected endorphin high that lasts longer than you’d expect.

With this in the books, my next experiment will be not eating for at least 2 hours before bed. This is a commonly espoused sleep tactic, so we’ll see what the impact is. I’ve noticed that very large meals before bed increase my heart rate, so I’d expect that to come down, but I’m not sure how or if this will affect other metrics. Stay tuned.

On Joining the Giants

Context: The MLB Draft just took place, and instead of the usual 40 rounds, this year’s draft had only 5 rounds. In addition, there’s a $20,000 signing bonus cap for all undrafted players who sign with a team after the draft. To put that in context, 6th round picks from 2019 received bonuses anywhere from $237,000 – $301,000. As you might imagine, there will be fierce competition among teams to sign great undrafted players at a rate far below historical levels.

This post is primarily for undrafted free agents of the 2020 MLB draft who are weighing their options about which team they want to sign with. This is not objective–I’ll make my case for why I think the San Francisco Giants present an opportunity that no other club does–but I also want it to be a resource for any player thinking through this decision.

For most of you, this decision will have a bigger impact on the trajectory of your career than any other decision you make during your time in this game. It’s worth thinking this one through carefully.

My background

Out of high school, I committed to play at Stanford, and got drafted by the Nationals in the 6th round of the 2007 draft (so, yes, there’s definitely the feeling that this 5 round thing wouldn’t have played in my favor). The Nationals let me attend Stanford while playing in their farm system, where I played through 2012. In 2013, I was drafted in the Minor League Rule V Draft by the Red Sox, then signed with the LA Dodgers, where I played the 2014 season, my last in professional baseball.

After spending a few years out of the game, I worked at Driveline, where I had previously trained as a pitcher in 2013, long before Driveline became what it is today. For the last year and a half, I’ve been an Analyst with the San Francisco Giants.

Your Decision

This is the way I’d frame your decision of which team to sign with:

Think of this as an optimization problem, where your objective is to pick the team that will make you the best player and, consequently, the most money over the course of your career.

In making this decision, here are three things to consider, ranked by importance.

  1. Pick the organization that will make you the best player. 

The only thing that truly matters in your career is how well you play. This is one thing you just can’t fake. The reality is that there are maybe a handful of players a year that could play in the Big Leagues the day they get drafted. You’ll need to improve A LOT if you want to have a long Major League Career. So find an organization where you think that will happen.

  1. Pick an organization where you can get to the Big Leagues as quickly as possible.

By age 29, the performance of most Major League Baseball players starts to decline. If you’re going to play in the Big Leagues for a long time and make a lot of money in this game, you need to be in arbitration or a free agent in your prime years. 

Find an organization that’s going to make you a better player in Year 1, and an organization with a history of moving players fast.

  1. Pick an organization that invests in its people and facilities

You’re signing up for a grind, and you’ll spend more time with your organization than you’ll spend anywhere else. The facilities, amenities, perks, and people around you will impact your mental and physical well-being. Pick an organization that’s demonstrated a history of investing in its people and giving them top-notch resources.

How do the Giants fit into this framework?

  1. Find the organization that will make you the best player. 

Modern baseball players need coaches that understand way more than coaches of previous generations.  Today’s coaches need to be fluent in analytics, probability, biomechanics, pitch design, swing design, and how to use technology, among other things.

With this in mind, the Giants have built an insanely talented and multi-dimensional staff with a broad set of skills and a long history of developing great Big League players.

With the Giants, you’ll optimize your body, you’ll improve your baseball skills, and your approach on the mound or in the box will be the one that gives you the highest probability of success.

With us, you’ll have a development plan rooted in data, with the sole purpose of helping you become the best player you can possibly be. 

  1. Pick an organization where you can get to the Big Leagues as quickly as possible.

Your ability to reach the Big Leagues quickly depends mostly on your performance, so spend even more time on Question 1.

The Giants priority is to win at the Major League level. In 2019, we set an all-time NL record for most players used in a season, with 64. If you can help the Giants win games, you’ll be playing in San Francisco.

Here are two examples of Giants that played in the Big Leagues last year. With great performance, you can have a similar trajectory.

Conner Menez was a 14th round pick in 2016. He started 2018 in High-A, and a year later, pitched in the Major Leagues at age 24.

Logan Webb was a 4th Rd pick in 2014 at age 17. He opened 2018 at High-A, and by August 2019, was in the San Francisco Giants rotation at age 22. 

  1. Pick an organization that invests in its people and facilities

Prior to the 2020 season, the Giants announced we would pay Minor Leaguers more than the minimum amount that MLB requires, in addition to providing free housing, or a housing stipend to all players. Almost no teams in baseball do this.

The Giants have invested a ton of resources to provide our players with the best environments possible. We’re in the middle of building a best-in-class Minor League complex in Scottsdale, fully equipped with a baseball research lab.

We also completed a full makeover to our Major League Spring Training complex. Saunas, steam rooms, float tanks, recovery rooms–they’re there not just to make you recover, but to make you feel comfortable in a place where you’ll spend countless hours over the next several years.

We have analysts at every affiliate, and the biggest field staff in MLB. We believe players get better with more hands on work, and have made investments accordingly. 

Remember: you’re on a journey to be the best baseball player you can possibly be. You want to be in an environment with the tools, facilities, and people that make that possible.

Hopefully this has helped you think through what’s important as you make this decision. I know it sucks to have to sign for less money, and if you’re optimizing for a short-term payout, you should go back to school, dominate next year, and sign for more money than you will this year. 

But if you’re optimizing for the next decade of your career, you have an opportunity now that almost no player gets. If you believe that an organization will develop you better than other organizations, take control of your future and go. The upside of being even a little better–whether that’s the difference between making the Big Leagues or not, or getting to arbitration or not–is so much greater than the bonus money you’ll forgo by signing in 2020.

This might be your last true choice of where you get to play in your whole career.  And if it’s with the Giants, you won’t be disappointed.

Should We All Have Coaches?

One of the most noticeable differences between professional athletes and knowledge workers is the prevalence of deliberate practice. Athletes are admired and celebrated for their intense dedication to honing their craft, be it a baseball swing, a jump shot, or a wide receiver running the perfect route.

This type of consistent, focused practice is typical in any performance-based arena: sports, music, dance, or comedy. Yet for knowledge workers, it’s easy to go through our entire professional lives without deliberately practicing any of the skills we need to maximize success in our careers.

I think we’re collectively leaving a lot of career potential on the table by not explicitly identifying the skills most impactful to our success, and using coaches to aggressively train those skills. 

Why Should We Practice?

Professionals need a finite set of skills to thrive in their careers. For many of us, we need to communicate well in written form and verbally; create excitement and buy-in about what we’re doing; make great decisions about how to tackle complex problems; understand our domain well; execute well on our plans; do all of this as quickly as possible.

Most people are really good at one or some of these. We all have our natural skills, and hopefully are in roles and companies where those shine. Some people naturally communicate and persuade really well, others have amazing technical skills or possess rare technical knowledge, while others have a knack for generating great ideas.

But most of us have plenty of room for growth in the skills and competencies that are most important to driving success in our jobs and careers. And I think it’s common to go through the years without a true self-appraisal and gathering honest feedback about how effective we are in these areas.

It’s even rarer to deliberately practice the skills we know we could improve, and that would positively impact our career. Why? It’s hard, and our environments aren’t set up for it. It takes a ton of motivation to pause our daily responsibilities and proactively work on skills that aren’t directly impacting what’s on our plate at the moment, even if these are skills that will be a critical part of our jobs for the next several decades. Furthermore, there’s rarely an immediate payoff, so any sustained effort must be buoyed by the belief that a payoff down the road is worth the trouble today.

I’m a big believer that we learn by doing, but just doing something isn’t enough. The world is full of golfers that are no better today than they were 50 rounds ago. The book, Peak: Secrets From the New Science of Expertise, provides a great look into the science of gaining expertise, be it poker, coding, or sales. The thrust is that improvement comes from challenging, focused practice beyond one’s comfort zone, with consistent feedback on whether the practice achieved the desired outcome or not.

Deliberate practice and focused reflection speed up the learning curve. We don’t need to wait until we make mistakes “in the game” to learn lessons. For many things, we can gain battle scars, learn what works, learn what doesn’t, and build up confidence all through more focused practice, where the risk of negative consequences is zero.

If we’re always waiting to learn lessons from “game reps,” we’re at the mercy of how many reps we actually get. And for the decisions, situations, and opportunities that have the biggest impact, we don’t get many swings of the bat.

What Should We Practice?

If you accept the premise that deliberate practice and reflection make sense, the most important (and most difficult) decision to get right is figuring out what to practice. We can’t spend all of our time practicing and not doing, so we want to make sure our limited time and energy are producing force in the direction that leads to the largest payouts. 

Deciding what to practice often boils down to whether we spend time bolstering the skills we’re already great at, at the expense of things we’re not great at, or whether the value of improving a weakness is so great, that it makes sense to invest our time and energy there.

This decision is highly context-specific, both to the industry and individual. Helping guide this decision is one of the two main value adds I see for coaches. The great coaches I’ve worked with have a crystal clear picture of the domain they work in, and the individual they’re working with. They understand industry trends, and most importantly, they’re able to identify what skills are important for success today, and in the future. They know what their students’ aspirations, capabilities, and limitations are, and how those match up with the demands of their jobs.

In making the decision of where to invest time and deliberate practice, the graph looks something like this:

The goal is to pick something as high on the Impact scale and low on the Energy Spent scale as possible. A coach’s experience working with other students — and judging the relative difficulty of improving certain skills — helps them calibrate this scale accurately.

Baseball is a great example of a situation with a lot of variables and uncertainty when deciding what to practice. Take a Major League hitter that has trouble handling high pitches due to the shape of his swing, which is better suited to hit low pitches. As a coach, do you try to redesign the swing to handle high pitches better? Or do you focus on the existing strengths and try to help the hitter swing at as few high pitches as possible?

This is a partial list of some of the considerations: will a focus on mechanics disrupt the hitters confidence and athleticism? How well do they handle the low pitch? Are they bad on all high pitches or just some types? How consistently can pitchers actually locate a pitch in the top of the zone? If the batter doesn’t change his swing, but never swings at high pitches, what would be his estimated production? How long would it take to redesign a swing? Has he tried before? Have other players done this successfully? Why is his swing the way it is? Is he physically capable of changing his swing? Is he motivated to? If it takes a year of bad overall performance to get to the desired swing, is that an okay outcome?

These are complex decisions with a lot of variables, and a coach’s judgment and experience are huge in getting to the right strategy.

One of my favorite stories in sports is when Tiger Woods worked with Hank Haney to overhaul his golf swing in 2003, with 8 Majors already under his belt, and at the peak of the sports world. The swing that once led to insane success was starting to have an impact on his knee, and leading to inconsistent play. During his swing reconstruction, Tiger struggled mightily for 2 years, with just one Top-5 finish at a Major in 2003 and 2004, but when he finally figured things out, he came back to win 5 Majors in the next 3 years, with 10 Top-5 finishes.

This was his rationale for the swing overhaul:

“I felt like I could get better,” he says. “People thought it was asinine for me to change my swing after I won the Masters by 12 shots. … Why would you want to change that? Well, I thought I could become better.

“If I play my best, I’m pretty tough to beat. I’d like to play my best more frequently, and that’s the whole idea. That’s why you make changes. I thought I could become more consistent and play at a higher level more often. … I’ve always taken risks to try to become a better golfer, and that’s one of the things that has gotten me this far.”

Knowledge workers rarely face the same downside risks that an athlete might when trying to develop or improve a new skill, but we can borrow the framework of bolstering skillsets through focused practice.

Unfortunately, the most impactful decisions we make and actions we take–the ones that present themselves only a few times a year or less–are the ones we get to practice the least. These are the decisions and projects that if we get right, make everything else pale in comparison. Despite their low frequency, they’re the things that we should absolutely be practicing so that when they arise, we’ve already worked out the kinks, we’ve learned from our mistakes on reps that don’t hurt us, and we have more confidence that we’ll make the right decision when the time comes.

Negotiation falls in this bucket. It’s something that few people do on a regular basis, something few people likely spend any time practicing, but something that can have massive impact over the course of a career. Not just monetary impact (though of course there’s that), but also impact in acquiring resources and support.

How We Should Practice?

We obviously live in an era where anything we want to know is immediately available on the internet. Want to be a better public speaker? Learn a new programming language? It’s all there, and with enough time and motivation, we can find what we need to start learning and improving at anything.

Having had some very good coaches in my life, and also going through a lot of my own trial and error in learning new things, I view the second primary value add of a coach as the ability to expertly teach the right skills. Good coaches, having successfully identified what’s worth spending time on, understand the specifics of skill acquisition in their domain. If they’re teaching a physical skill, they know how humans best develop new motor skills and construct drills and practice accordingly. If they’re teaching a language, they understand the techniques that lead to fluency fastest.

Coaches are ultimately responsible for accelerating the learning curve, and they can often do so in a way that we simply can’t as individuals. They have a broader perspective and sample of what tends to work and what doesn’t, which makes pattern recognition much easier. 

The ability to suggest the strategy most likely to work right away can significantly cut down development time. It’s not that individuals can’t figure things out–we do all the time–it’s that we don’t always need to learn by making a mistake first. Great coaches see the obstacles ahead before we can, and they help us navigate around them without missing a beat.

Using one more baseball analogy, consider a pitcher that’s trying to gain a little more movement on his fastball. A coach with a reservoir of examples of similar pitchers that have attempted the same adjustment can quickly get to the right strategy, as opposed to the pitcher going through trial and error without the context of what’s worked best for others. For many things, imitating what other successful people have done is a great strategy.

The final component of effective practice and great coaches is good, consistent feedback. For practice to be impactful, there has to be feedback on whether we’re achieving the desired outcome. Unknowingly practicing in poor form does more harm than good. Effort that’s intended to be productive ends up ingraining bad habits.

Conclusion

I think deliberate practice is so prevalent in performance-based industries because success and failure are largely binary. We can measure a wide receiver’s contribution in unambiguous ways, and we know exactly how many downloads of a song an artist gets. These are industries where you’re out of a job the moment you get outperformed, so there’s incredible urgency to continuously improve.

We can take a similarly aggressive approach to training and development in business roles. People are capable of a lot if they have the right plan and consistency. All of this starts with a real understanding of where we are, and that it’s okay if there are skills we need to work on. 

That said, there are a lot of things we simply can’t practice. The world evolves and novel situations arise all the time. No one was preparing for how to handle a pandemic, but these situations are the outliers. They’re the unrehearsed joke a comedian tells for the first time, or the new series of chords a musician plays on stage. For the predictable 90% of our jobs, we have the ability to master our skill sets, which makes us even more capable at improvisation on the other 10%.

There’s been a lot written on mastery being one of the key components to meaning, and I’d guess anyone that’s truly tried to master a skill has found it to be an incredible process–at times difficult and frustrating, but ultimately meaningful and rewarding. What I miss most about playing baseball is the daily act of trying to incrementally improve at this one skill, tinkering to find any edge possible. Approaching the skillsets we need in our working lives through the lens of mastery can lead not just to better performance, impact, and outcome, but a deeper level of satisfaction and meaning.

How an MLB Season Affects Sleep: Part 2

In Part 1, I outlined why our sleep environment is so important and what I’ve done to optimize it, explained why I track my sleep, and analyzed my sleep trends over the last year and a half, as measured by the Oura ring.

In Part 2, I’ll analyze my sleep data from the last year, which has been particularly interesting because I’ve had such a differing sleep schedules and a lot of travel.

I work as an analyst for the San Francisco Giants, and for 6 weeks during Spring Training in Arizona, I’m on a very early-to-bed, early-to-rise schedule. Once the 6-month season starts, the majority of games finish after 10pm, which leads to a much later schedule. This is followed by a 4 month off-season where I’m able to shift back to my natural circadian rhythm.

These graphs show the drastic changes in sleep schedule between the season (April-September) and the offseason.

The later bedtime and wake times in-season are in stark contrast with Spring Training (Feb-March) and my natural circadian rhythm, reflected in March-May data, when Covid-19 sent everyone home from Spring Training.

The most drastic sleep changes come in Spring Training, when overall sleep and REM sleep plummet, but deep sleep actually increases. My guess as to why deep sleep increases is that the days are long and intense, and your body tries to recover as much as possible.

Travel

While people with a later circadian rhythm don’t need to adjust their sleep schedules as much during the season, everyone deals with frequent travel and inconsistent sleep hours, which isn’t ideal for optimized sleep.

One downside West Coast teams have is increased travel. The Giants had the 5th most travel of any team in baseball last year, with 41,934 miles covered during the season.

Two scenarios are particularly tough on sleep quality. First, when the last game of a series is a night game. On a night getaway game at Dodger Stadium, by the time we eat, leave the clubhouse, drive to LAX, fly to SFO, take the bus to Oracle park, and finally go home, it’s around 3am.

The other scenario that impacted sleep the most were any East Coast trips, which usually got us to the hotel around 3am-4am. All of those trips were followed by an off-day.

Luckily those scenarios didn’t happen often–we had 4 night getaway days, and 4 East Coast trips. Unfortunately I’m missing sleep data from a lot of these nights.

The last collective bargaining agreement smartly mandated more day games on travel days, limiting the nights teams would arrive to a new city at 3am and play the next day. 

As you’d expect, day games were incredibly helpful for getting more sleep that night–I averaged a full extra hour of sleep on nights after a day game. 

Conversely, on nights before day games, I had significantly lower sleep quality. Not surprising, given the quick turnaround of a night game, and an early morning the following day.

For sleep quality, nothing beat home. On nights I slept in my own bed, I had more total sleep, more REM sleep, and more deep sleep. Given the sleep environment I’ve set up there, this isn’t surprising. One thing to note: I tended to go to bed earlier at home, which likely impacted these numbers, independent of the environment.

When looking at road games by time zone, it isn’t surprising to see better sleep in cities on PDT compared to CDT or EDT. Much has been written on the negative effects of time zone changes. The shorter travel definitely helps, and is reflected in all metrics.

It’s also interesting to see how bad my sleep was in Denver–of all the cities we played in, it was where I had by far the worst sleep. 

Subjectively, I always felt like I slept poorly there, likely because of the altitude and dry air. It was also one of the hotels that didn’t get particularly cold AC, so I ended up bringing a fan for our last trip there.

What I Learned

Having gone through this exercise, I have a few ideas of what I’d do differently in Year 2 to manage the quirks of an MLB season, and keep my sleep quality as high as possible.

  • I’d take my sleep environment on the road more seriously. I remember two nights last year where I didn’t turn the AC up to full blast until I was ready to go to bed, only to find it wasn’t functioning properly. They got fixed the next day, but led to a few nights of poorer sleep. Moving forward, I’ll crank the AC up immediately when I arrive to confirm it works, and allow time for fixing if not. I’ll also travel with a fan for scenarios where the AC just doesn’t get that cold, or doesn’t make enough white noise.
  • Especially on East Coast trips, I’d get more sunlight early in the day, and possibly travel with a full spectrum light (I have one, but haven’t really used it yet). Sunlight helps regulate our circadian rhythm, so instead of staying in the hotel the morning after arriving in an East Coast city, I’d get outside and get some sun on my face and let my body know it’s time to go.
  • I’d take travel naps more seriously. Knowing my sleep on the road is going to be impacted, I’d make better use of buses and plane rides to sleep, which I didn’t do often enough.
  • I’d supplement more aggressively on days I know it will be harder to get good sleep. I’m cautious of taking melatonin or other sleep-inducing compounds, but I think they could be a very beneficial aid during nights when I know it’ll be harder to sleep well, like an East Coast trip, or night getaway day.
  • I’d take more saunas. I haven’t logged the data well, but anecdotally, I sleep better on nights I take a sauna, which I did for a lot of the offseason, and part of Spring Training. 

Experiments to Run

I haven’t formally experimented enough to see how different interventions impact my sleep. I’ve relied more on anecdotal observations, but I’d like to run the following experiments and see what, if anything, happens:

  • Cold showers. I take cold showers often, but at random intervals, and have never tracked them.
  • Full-spectrum light in the morning. I’m up every morning before the sun rises, so I wonder if getting exposed to this light early in the morning will impact sleep.
  • Monitor drinking. Anecdotally, 2 drinks or less has little to no impact on sleep, but 3 does. I’d like to test this.
  • Float tank. I floated 3 times last year, and felt great after each session. I can’t remember how I slept, but I’m interested to see if there’s an impact.
  • Epsom salt baths. Magnesium, one of the minerals in epsom salt, is a well-documented sleep aid (and a hypothesis for why the float tank could impact sleep).
  • Limit screens before bed. I’m good, not great at this. I wonder what would happen if I extended this to 60 minutes before bed.
  • Don’t eat for at least 2 hours before bed. A late meal skyrockets my resting heart rate, but I’ve never tested this over a long period.

Hopefully I’ll have something interesting to report back.

How an MLB Season Affects Sleep: Part 1

A paradox of the modern world is that we undervalue and deprioritize things we know to make us healthier, happier and more productive. Sleep is chief among them.

The research is unambiguous: Good Sleep is a powerful performance enhancer. With Good Sleep, we’re stronger, we’re smarter, and we look better. Everything we want to accomplish–physical goals, cognitive goals, relationship goals–becomes easier.

Going through the world with Bad Sleep is running a marathon with a weight vest on. Yet not sleeping has become a badge of honor. Imagine athletes bragging about their poor preparation and lack of training. Would we ever imagine they were in the best position to perform well? The same goes for sleep, for athletes and non-athletes alike.

The fact that we’re unconscious for a third of our lives provides a hint to the importance of sleep. It’s hard to think of a worse evolutionary disadvantage than conking out for a third of each day, prone to attack, and unable to find food. In spite of that cost, humans evolved to require a huge amount of sleep, something we fail to appreciate as a society.

Sleep Environment

Environment plays a prime role in sleep quality. You wouldn’t try to study at a construction site, and you wouldn’t try to PR your 10K in 10 degree weather, so why sleep in an environment not conducive to optimal sleep?

I can only speak for myself, but I think the optimal sleep environment differs for everyone. Over the years, I’ve experimented with different set-ups and gadgets, and have landed on a core “Sleep Stack” to create the optimal sleeping environment. I sleep best in a room that’s very cold, pitch black, with white noise. 

Cold

If I could choose one characteristic of an optimal sleep environment, it would be temperature somewhere between 62-65 degrees. Sleeping in a warm room is a slow drip IV of discomfort, so I avoid it at all costs.

Central AC is rare in San Francisco, so the tools of choice are a bedroom AC unit and Chili Pad. The Chili Pad goes under the sheet, and circulates cold water, keeping your sleep surface as icy as you want. The first night you sleep with the Chili Pad, you wonder how you ever slept without it.

Dark

Our circadian rhythms follow the pattern of the sun. We’re awake when it’s light, we sleep when it’s dark. I’ve found that any light shining through in the morning impacts my ability to sleep optimally. 

I’ve tried numerous black out curtains and have slept in loads of hotels with heavy-duty curtains, but nothing has blocked light as well (and at as low of a cost) as overlapping black towels. 

Let There Be No Light

If you can get past your significant other tolerating the eye-sore, this is highly recommended.

When I’m on the road and don’t have black towels blocking all the light, I use this sleep mask, which works well. 

White Noise

For some reason, sleeping in dead silence is uncomfortable and my mind seems to wander more. To create some white noise, I blast a fan, with the air pointing in the opposite direction.

Blanket

My most recent acquisition is the Gravity Blanket, a 35 lb blanket that’s insanely cozy and meant to make you feel peaceful and comforted. I’ve only had it for a few weeks, but I’ve enjoyed it so far.

Sleep Tracking

I’ve been tracking my sleep on and off since 2013, originally with the (now defunct) Zeo and for the last year and a half, with the Oura ring.

There are a lot of devices that track sleep, but I enjoy the Oura ring because I don’t love wearing watches (to be fair, I don’t love wearing rings either, but this is the lesser of two evils). I’m less interested in non-wearable sleep trackers, because I think heart rate and heart rate variability are really important metrics to track, which non-wearables don’t get, or don’t get as accurately.

Tracking sleep nightly has several benefits for me. First, it’s a forcing function to do the things that lead to better sleep, knowing I’ll see the results in the morning.  Second, it builds up a dataset that’s useful in seeing trends over longer time-horizons. 

ROI

These things aren’t cheap. The combined cost of these items is over $1,000, but I look at them as investments, not expenses. If you could guarantee me a 10% increase in the length and quality of my sleep for the next year, the return on investment in the form of increased health, happiness, and productivity would be higher than any other investment I could make.

Analysis

I’ve collected 464 nights of sleep data from the Oura ring. The nights I’ve missed have been a combination of either forgetting to put it on, or a depleted battery. The missed nights seem to be distributed randomly, and shouldn’t skew the dataset.

Oura records a lot of metrics (full list here), but the ones I track most closely are total sleep, deep sleep, REM sleep, sleep efficiency, bedtime, heart rate, heart variability, and respiratory rate (breaths per minute). 

Over the last year and a half, these are my nightly averages:

Takeaway 1: Get more overall REM sleep, and increase my REM:Total Sleep ratio

My REM:Total Sleep ratio is currently 19%. Studies suggest 20%-25% to be optimal, so getting an extra 25 minutes of REM sleep a night would get me to a 25% REM:Total ratio, assuming the same amount of total sleep. More on this below.

Takeaway 2: I can get more total sleep without spending more time in bed

Increasing sleep efficiency (total sleep / total time in bed) from 88% to 93% would give me an extra “free” 20 minutes of sleep a night. That’s an extra 2h 20m a week, or 121h 40m in a year. That’s 5 full days worth of sleep a year by tossing and turning less, and spending 0 additional minutes in bed. Seems worth pursuing.

Correlations

I’ll start by looking at correlations across the entire dataset. The chart below highlights the correlation coefficients between different metrics. The size and intensity of the colors reflect the intensity of the correlation. Blue marks high positive correlation, where an increase in one metric is correlated with an increase in the other; red marks high negative correlation, where an increase in one metric is correlated with a decrease in the other.

Obligatory correlation ≠ causation note here. A lot of these correlations are simply results of other behaviors. For example, take the correlation between Bedtime and Heart Rate. I don’t believe going to bed later inherently increases my heart rate. But on nights when I go out and have drinks, I tend to go to bed later, and the drinking increases heart rate. 

Takeaway 1: REM sleep is highly correlated with Total Sleep

Shorter nights of sleep disproportionately impact REM. This is an important point. Because more REM occurs later in the sleep cycle, a night with 80% of normal sleep doesn’t impact all phases of sleep by 80%. It disproportionately crushes REM, which impacts our ability to concentrate, skill acquisition, problem-solving, and other things most of us need to function in the modern world. 

Takeaway 2: Total Sleep is highly negatively correlated with Bedtime

This confirms what I’ve always felt: if I go to bed later than usual, I still wake up around the same time and have less overall sleep. Because my circadian rhythm is so early, I try hard to go to bed early every night, knowing I won’t get a full night of sleep otherwise. In my ideal world, my sleep schedule would be something like 9pm-5am. Early mornings with no one awake yet are special times, and when I do my best thinking.

Takeaway 3: Heart Rate Variability is highly negatively correlated with Heart Rate

You can read more about the importance of Heart Rate Variability here, but it serves as a great proxy for stress levels, recovery, and readiness to perform. I don’t think Heart Rate directly impacts Heart Rate Variability, rather the things that lead to an increased heart rate–drinking, late workouts, stress–can crush Heart Rate Variability and our ability to perform at peak performance.

Takeaway 4: REM is positively correlated with Breaths Per Minute, and negatively correlated with HRV

I don’t know what to make of this. An increase in BPM is negatively correlated with sleep efficiency, deep sleep, and heart rate–all bad outcomes. Not surprising, given that the things that reliably make my BPM increase are drinking and eating a big meal close to bedtime.

So why the positive correlation with REM? Could it be that a late meal increases my BPM, but is stress-reducing which lets me get more REM? 

I’m also not sure why REM negatively correlates with HRV. I’d assume the things that lead to high HRV–good workouts, good sleep, lower stress–would also increase REM. Something to explore more.

I’ll stop here for now, but in Part 2, I’ll dive into how the schedule and travel of an MLB season affected my sleep, what I learned from the data, what I’d do differently, and what sleep experiments I’ll be running this year.