Human Systems: The Body as I/O

You profile your code. You ignore the substrate running it. The body is a process with inputs and outputs, and most bad afternoons are downstream of bad inputs you've been treating as optional.

Karan Batra / /

You debug your code. You profile your servers. You measure latency to the millisecond. Then you eat a packet of chips at 2pm, sleep four hours, and wonder why the afternoon felt like wading through tar.

The body is a process. Inputs go in, outputs come out. You can program it like any system — pick the output you want, change what you put in.

   INPUTS                 SYSTEM                  OUTPUTS
   ──────                 ──────                  ───────
   food          ─┐                            ┌─ focus
   water         ─┤      ┌───────────┐         ├─ energy
   sleep         ─┼────→ │    you    │ ──────→ ├─ mood
   light         ─┤      └───────────┘         ├─ skin / hair
   movement      ─┤                            ├─ recovery
                 ─┘                            ├─ decisions
                                               └─ work shipped

Bad inputs, bad outputs. No flag in the runtime overrides this.

Why Programmers Get This Wrong

We tune the visible layer. Editor, framework, hotkeys, prompt templates, second monitor. The substrate running the editor — you — gets default settings, untouched for years.

   what we tune              what runs the work
   ┌────────────────┐        ┌────────────────┐
   │ editor / IDE   │        │     brain      │
   │ keybinds       │        │     body       │
   │ shell aliases  │        │     attention  │
   │ LLM prompts    │        │     mood       │
   └────────────────┘        └────────────────┘
       100% tuned                 ~0% tuned

A 5% drop in attention costs more than any keybind ever paid back. The cheapest perf win on the table is the one nobody profiles.

The Inputs

Food: Fuel Quality

A meal isn’t “calories in.” It’s a payload — macros, micros, fiber, water, timing — and the system reads every field. Two meals with the same calorie count can ship you opposite afternoons.

 spike-and-crash meal               steady meal
 (refined carbs, no protein)        (protein + fat + fiber + carbs)

 glucose                            glucose
   │   ╱╲                             │   ____
   │  ╱  ╲                            │  /    \___
   │ ╱    ╲___                        │ /         \__
   └────────────→ time                └────────────→ time

   focus follows                      focus follows

The first one ships you a 2pm bug. The second one ships you a working afternoon.

A floor that holds up for most people:

  • Protein at every meal. Builds tissue, keeps you full, flattens glucose.
  • Fiber and fat with carbs. Slows the spike. The crash never happens.
  • Whole foods over packets. Less stuff the body has to fight before using.
  • Water before coffee. You woke up dehydrated. Caffeine on dry tanks is just stress.

Not a diet. A floor.

What Each Food Actually Does

Two layers. Big stuff (macros) is the fuel. Small stuff (micros) is the parts the engine needs to actually use that fuel. Miss the small stuff and the fuel sits there.

   macros = the fuel               micros = the small parts
   ───────────────                 ─────────────────────────
   carbs, protein, fat             iron, magnesium, vitamins,
   the bulk of your plate          zinc — tiny amounts, big jobs

         ┌──────────────────────────────────────┐
         │  fuel without parts → engine sputters│
         │  parts without fuel → engine empty   │
         │  both, in balance   → engine runs    │
         └──────────────────────────────────────┘

Most of what you eat breaks down into a small set of building blocks. Once you know them, food labels stop being a wall of words.

Protein

Long chains of small pieces called amino acids. Think LEGO. Your body breaks the chains apart, then snaps the pieces back together to build muscle, skin, hair, hormones, enzymes, immune cells. Twenty piece types in total. Nine of them your body can’t make on its own — you have to eat them.

   food protein                  your body
   ────────────                  ─────────
   ●─●─●─●─●─●─●─● → cut apart → ● ● ● ● ● ● ● ●
   long chain                    loose pieces
                       rebuilt into muscle, skin,
                       hormones, enzymes, etc.

Eat protein, get pieces. No protein, no pieces, no rebuild.

Carbs

Sugar molecules linked into chains. Your body cuts the chains down to glucose — the main fuel your brain and muscles run on. Short chains break down fast and spike you. Long chains break down slow and drip.

   simple carb               complex carb
   ───────────               ─────────────
   ●─●                       ●─●─●─●─●─●─●─●─●
   short chain               long chain
   (sugar, sweets,           (oats, brown rice,
    white bread)              vegetables, fruit)
       │                              │
       ▼                              ▼
   glucose fast              glucose slow
   spike → crash             steady release

Same energy in the end. Different curve getting there. The curve is what you feel.

Fat

Energy-dense, but also the raw material for cell walls, your brain (roughly 60% fat), and most of your hormones. Three rough types:

  • Unsaturated (olive oil, nuts, fish, avocado) — generally good for you.
  • Saturated (ghee, butter, fatty meat, coconut) — fine in moderation, problem in excess.
  • Trans (deep-fried fast food, many packaged baked goods) — avoid. The body doesn’t know what to do with these and they wear the system down over time.

Calorie density per gram:

   1 g protein  =  4 cal
   1 g carb     =  4 cal
   1 g fat      =  9 cal   ← more than twice
   1 g alcohol  =  7 cal   (no nutrition, just calories)

Fiber

A type of carb your body can’t break down. Sounds useless — it isn’t. It slows digestion (smooths the sugar curve), feeds the bacteria in your gut (which you depend on more than you’d think), and keeps things moving.

Vitamins and Minerals

Tiny amounts your body needs for thousands of small jobs it can’t do without them. Vitamins come from living things — A, B, C, D, E, K. Minerals come from the earth and what grows in it — iron, calcium, magnesium, zinc, potassium, sodium. You don’t eat these for fuel; you eat them so the fuel can do its work.

That’s it. Everything else on a label is just packaging.

The big stuff:

Food groupWhat it’s forWhere to get it
Proteinbuilds and repairs you, keeps you fulleggs, dal, paneer, chicken, fish, tofu
Fatbuilds your brain, makes hormones, runs your cellsghee, olive oil, nuts, fish, seeds
Carbsfast fuel for brain and musclesrice, roti, fruit, oats, potato
Fiberfeeds your gut, smooths energy, keeps you regularwhole grains, vegetables, fruit, dal

The small stuff that punches above its weight:

NutrientWhat it’s forWhen you’re low you feelWhere to get it
Ironhelps blood carry oxygentired, breathless, cold handsred meat, dal, spinach (eat with lemon or citrus to absorb)
Vitamin B12keeps nerves and energy workingtired, fuzzy thinking, tinglingeggs, dairy, meat. Vegetarians often run low — get a blood test
Vitamin Dbones, mood, immune systemflat mood, weak, getting sick oftenmorning sun, eggs, oily fish
Magnesiumsleep, muscles, calming the nervesbad sleep, cramps, tensenuts, seeds, dark chocolate, leafy greens
Zinchealing, immune, hormoneswounds heal slow, getting sickseeds, lentils, meat
Omega-3brain food, settles inflammationlow mood, stiff jointsoily fish, walnuts, flax, chia
Salt + Potassiumwhat nerves and muscles need to firecramps, headache, tiredsalt, bananas, potatoes, coconut water
Waterthe carrier for everythingfoggy, headache, dry skinwater

A varied whole-food plate covers most of this on its own. If your plate isn’t varied, you’re guessing. A blood test once a year turns guessing into knowing — it shows which dials are low so you can fix the right one instead of every one.

Eat for the Output You Want

This is the part that matters. The body is general-purpose — same machine, different programs. Pick the output you care about today, weight your plate toward it.

 GOAL                          EAT MORE OF                          EAT LESS OF
 ────                          ───────────                          ───────────
 sharp focus, clear head    →  protein at breakfast,                sugar, refined carbs,
                               eggs, fish, nuts, leafy greens,      heavy lunches, alcohol
                               water, coffee (morning only)

 steady energy all day      →  whole grains, legumes, vegetables,   refined carbs, sugary drinks,
                               protein with every meal,             skipped meals, late caffeine
                               nuts, seeds, fruit

 better sleep               →  nuts, seeds, leafy greens,           caffeine after noon, alcohol,
                               dark chocolate, banana, warm milk,   sugar at night, big late meals
                               light, early dinner

 faster recovery            →  protein at every meal,               processed food, alcohol,
                               colourful vegetables and fruit,      sugar, undersleeping
                               oily fish, water, sleep

 stronger immunity          →  vegetables and fruit (variety),      sugar, ultra-processed food,
                               garlic, ginger, citrus, yoghurt,     alcohol, late nights
                               seeds, lentils, sun, sleep

 better mood, less flat     →  oily fish, eggs, dairy, sunlight,    alcohol, big sugar swings,
                               whole carbs, fermented food          isolation, late-night scrolling

 less brain fog             →  water, protein, healthy fats,        skipped breakfast,
                               sleep, slow carbs                    sugar crashes, dehydration

 more stamina               →  iron-rich food (red meat, dal,       smoking, undersleep,
                               spinach + lemon), whole carbs,       eating too little
                               regular meals, water

 better skin               →   water, oily fish, nuts, seeds,       sugar, alcohol, dairy
                               vegetables and fruit, vitamin C      (varies), late nights,
                               (citrus, peppers), sleep             ultra-processed food

 stronger hair             →   protein every meal, eggs, dal,       crash diets, low protein,
                               nuts, seeds, iron-rich food,         under-eating, harsh styling
                               omega-3, biotin (eggs, nuts)

Not a diet plan. An interface. Same body, different program — point it at what you need this week. Tomorrow’s output gets tomorrow’s input.

Sleep: The GC Pass

Sleep isn’t downtime. It’s when the body runs the jobs it can’t run while you’re awake — memory consolidation, hormone reset, glymphatic clearance (the brain’s literal waste sweep, only open while you sleep).

   awake                          asleep
   ─────                          ──────
   collect signal                 consolidate memory
   make decisions                 clear metabolic waste
   accumulate fatigue             reset hormones
   damage tissue                  repair tissue

   skip the sweep → next day starts with yesterday's garbage in memory

Ship code on four hours of sleep and you’ll spend the day writing bugs you’d have caught on seven. The “I save time by sleeping less” math never closes. The cost moves, it doesn’t disappear.

 8h day, 7h sleep:    [████████ work ] [recovery ████████]   → tomorrow 100%
 8h day, 4h sleep:    [████████ work ] [recovery ████░░░░]   → tomorrow  70%
                                                               then 60%, then 50%

Sleep debt compounds. Compounding works against you here, not for you. A week of “I’ll catch up on the weekend” doesn’t catch up — you start Monday already behind.

Water: The Bus

Every transport in the body — oxygen, nutrients, waste, heat — moves through water. Drop a few percent and the bus runs late everywhere.

  hydrated                       ~2% down
  ┌──────────────┐               ┌──────────────┐
  │ blood thin   │               │ blood thicker│
  │ heart easy   │               │ heart works  │
  │ brain clear  │               │ brain foggy  │
  │ skin OK      │               │ headache     │
  └──────────────┘               └──────────────┘

Thirst is a late signal. By the time you feel it, you’re already behind. The fix is boring: a glass first thing, a glass with each meal, one near the desk.

Light: The Clock

The body runs a 24-hour scheduler called the circadian clock. The signal it uses is light — bright in the morning, dim at night. Get this wrong and sleep, hunger, mood, and energy all drift.

  morning sun on face            phone in bed at 1am
  ─────────────────              ────────────────────
  cortisol up    ✓               melatonin suppressed ✗
  melatonin off  ✓               clock thinks: noon
  clock anchored ✓               sleep starts late
                                 wake-up drifts later
                                 drift accumulates daily

10 minutes of morning daylight (outside, not through a window) beats most caffeine for waking up. Free, repeatable, no side effects.

Movement: The Pump

Blood and lymph don’t have their own engine — muscles pump them. Sit for 8 hours and the pump idles. Energy drops, mood drops, back complains, and you blame the chair.

   sedentary day                  walk break every hour
   ─────────────                  ─────────────────────
   ░░░░░░░░░░░░░                  ▓░▓░▓░▓░▓░▓░▓░▓
   energy curve falls             energy curve holds

But “the pump” is just the floor. Above it, four different stresses tune four different systems. Stack them across the week and the whole machine works better.

   the four flavours of movement
   ─────────────────────────────────────────────────────
   walking / standing  →  the pump (always-on baseline)
   strength training   →  muscle, bone, posture, metabolism
   cardio              →  heart, endurance, mood, sleep
   mobility / yoga     →  joints, range of motion, recovery
   stillness / breath  →  attention, stress response, sleep

You don’t need to do every one every day. You need to hit each across a week.

Cardio

Heart and lungs adapt to what you ask of them. Don’t ask, and they shrink. Ask regularly, and resting heart rate drops, blood pressure drops, mood improves, sleep deepens. Cardio is the single most evidence-backed intervention against early mortality — by a margin that nothing else gets close to.

The baseline most public health bodies converge on:

   minimum weekly cardio
   ─────────────────────
   moderate (zone 2)         150 min      brisk walk, easy jog, cycling
   vigorous (zone 3+)         75 min      running, hill cycling, fast swim
   or any mix that adds up

“Zone 2” = you can hold a conversation but it’s clearly an effort. That’s the band where the heart adapts most efficiently and you can do it without trashing recovery.

If you’ve never done cardio, start with 20 min walks 3-4× a week and build from there. Compounding works in your favour here, the way it works against you for sleep debt.

Strength

Muscle isn’t aesthetics. It’s:

  • The metabolic engine. More muscle means more glucose handling, fewer crashes, easier weight management.
  • The frame. Pulls posture together, protects joints, prevents most “back issues.”
  • The bank. Past 30, you lose muscle by default unless you train. Every decade after 40 the rate accelerates. Strength training is the deposit.
  • The hormone driver. Lifting moves testosterone, growth hormone, insulin sensitivity in the directions you want.

Minimum useful dose:

   minimum weekly strength
   ───────────────────────
   2 sessions      45-60 min each
   covers          push, pull, legs, core
   compounds       squat, deadlift, push-up, row, overhead press

You don’t need a gym. Bodyweight (push-ups, pull-ups, squats, lunges, plank) gets most people surprisingly far. Resistance bands fill in the rest. The actual barrier is consistency, not equipment.

Mobility / Yoga

What strength builds, mobility unlocks. Tight hips, locked shoulders, stiff back — these don’t fix themselves and they cap how well everything above runs.

   mobility floor
   ──────────────
   2-3 sessions / week    20-30 min each
   yoga, stretching, or movement flows
   joints through full range, not just held muscle stretches

Bonus output: yoga sessions also calm the nervous system. People who train hard often miss this — and wonder why their sleep, mood, and heart rate variability drift down even as they get fitter. Mobility is the recovery setting nobody schedules.

Stillness / Breath

The mind is also an input. You can train attention the same way you train muscle, and it pays out across every other output: sleep deeper, react slower (in a good way), focus longer, decide better.

   minimum useful dose
   ───────────────────
   5-10 min / day       meditation or breathwork
   most weeks           count it like brushing teeth

Doesn’t have to be guru-grade. 5 min of slow nasal breathing (in for 4, out for 6) drops your heart rate, lowers cortisol, anchors you for the next hour. Apps help if you need a structure to follow.

A Weekly Floor

If you took nothing else from this section, this is the floor:

   weekly minimum (research-backed, average adult)
   ───────────────────────────────────────────────
   ▓▓▓▓▓▓▓▓▓▓ cardio        150 min moderate (or 75 vigorous)
   ▓▓▓▓▓▓     strength        2 sessions, 45-60 min
   ▓▓▓▓       mobility        2-3 sessions, 20-30 min
   ▓          breath / mind   5-10 min/day

Stack the bars. Don’t try to max one and skip the rest — that’s how injuries happen. Every bar feeds outputs the others can’t.

Peripherals (Stuff You Don’t Eat)

The body is a hardware system. Some of what affects it isn’t food, sleep, or movement — it’s what you put on the skin, what you sleep against, what you sit in. Cheap leverage if you bother, decades of small damage if you don’t.

   peripherals = the physical interface between
                 you and every input above
   ─────────────────────────────────────────────
   skin      → sunscreen, moisturizer, gentle cleanser
   hair      → oil, mild shampoo, scalp care
   sleep     → cool room, dark room, screen-dim filter
   recovery  → foam roller, yoga mat, massage tool
   posture   → standing desk, supportive chair, decent shoes

Skin & Hair

The most evidence-backed skin intervention by a wide margin: sunscreen, daily, year-round. UV is the single biggest driver of visible aging — wrinkles, spots, sagging. SPF 30-50 is the floor. Pair with a gentle moisturizer and a mild cleanser (twice daily) and you’ve already done more than 90% of the population. Retinol or vitamin C serums in the evening are optional add-ons if the basics are dialed in.

For hair, oiling weekly (coconut, almond, or argan — pick one), 1-2 hours before a wash, with a slow scalp massage. It’s traditional for a reason: the massage drives blood flow, the oil conditions the shaft, both make the hair you have look like the hair you want. Use a sulfate-free shampoo 2-3× a week, not daily — daily strips natural oils and dries the scalp.

What matters less than people think: brand, price, “active” complexity. Cheap consistency beats expensive sporadically.

Sleep environment

You spend a third of your life in this room. The setup affects sleep quality more than most “sleep hacks” do.

  • Cool room (~18°C / 65°F). Body temperature has to drop for deep sleep — a hot room blocks it.
  • Dark room. Blackout curtains or a decent eye mask. Even small amounts of light suppress melatonin.
  • Screens off / dimmed after 9pm. Night-mode filters help; phone-out-of-bedroom helps more.
  • Comfortable pillow + mattress. A bad pillow steals 20 minutes of deep sleep every night. That compounds fast.

Recovery & posture

If you train, foam roller + yoga mat are the two cheapest items that earn their keep. 5 min of foam-rolling post-training reduces next-day soreness; a mat means mobility actually happens because the friction to start is zero.

If you have a desk job, the chair and desk are not optional. Standing desk or sit-stand alternation, chair with lumbar support, decent shoes (rotate them — same shoe every day wears your feet predictably). Sitting badly for 8 hours undoes a lot of training. Sitting well for 8 hours is invisible but free.

These aren’t gear flexes. They’re peripherals — interfaces between you and every input above. Spend on them once, benefit daily.

Reading the Signal

The body sends bug reports. Most people don’t read them — they suppress them with caffeine, sugar, or scrolling, and the bug stays open.

Common signals and the inputs they’re usually pointing at:

 SIGNAL                       LIKELY INPUT IT'S ASKING ABOUT
 ─────────                    ──────────────────────────────
 tired all day              → sleep, iron, B12, sunlight
 brain fog                  → water, glucose stability, sleep
 2pm crash                  → meal composition (refined carbs, no protein)
 sugar craving              → low blood sugar, sleep debt, stress
 salt craving               → low electrolytes, sweat loss
 headache                   → water, sleep, screen time, posture, jaw
 cramps                     → magnesium, electrolytes, water
 bad mood / flat            → sleep, daylight, gut, social, movement
 anxious / racing heart     → caffeine load, sleep, blood sugar
 can't fall asleep          → screens, late caffeine, late food, evening light
 wake at 3am wired          → late dinner, alcohol, stress, low blood sugar
 cold hands often           → iron, thyroid (get checked)
 frequent colds             → sleep, vitamin D, zinc
 skin breakouts             → sleep, sugar, dairy (varies), stress
 dry / dull skin            → water, omega-3, vitamin C, sleep
 brittle hair / shedding    → protein intake, iron, B12, crash diet
 thinning hair              → protein, iron, thyroid (get checked), stress
 weak nails                 → protein, biotin, iron

Not a diagnosis chart. A starting list of inputs to interrogate before you decide it’s nothing or reach for a pill. If a signal persists for weeks after the obvious inputs are clean, see a doctor. The body isn’t always wrong, and you’re not always reading it right.

The Debug Loop

Same flow as a code bug. Symptom, hypothesis, change one thing, observe, confirm or move on.

 ┌─────────────────────────────────────┐
 │ 1. observe symptom                  │
 │    "tired by 3pm every day"         │
 ├─────────────────────────────────────┤
 │ 2. form hypothesis                  │
 │    "lunch is too carb-heavy"        │
 ├─────────────────────────────────────┤
 │ 3. change ONE input                 │
 │    add protein + veg to lunch       │
 ├─────────────────────────────────────┤
 │ 4. hold the rest steady             │
 │    same sleep, same coffee, same    │
 │    schedule                         │
 ├─────────────────────────────────────┤
 │ 5. observe 5–7 days, log it         │
 │    energy at 3pm  /10               │
 ├─────────────────────────────────────┤
 │ 6. confirm, reject, or next         │
 └─────────────────────────────────────┘

Rules of the loop:

  • One change at a time. Change diet and sleep and caffeine on Monday and Friday’s improvement tells you nothing.
  • Hold confounders steady. Self-experiments break the same way real ones do.
  • Give it time. Sleep changes show in 3–4 days. Diet in 1–2 weeks. Movement in 2–3 weeks. Don’t bail on day two.
  • Log it. Memory lies about how you felt last Wednesday. One line a day is enough.
  • Get blood work. Some bugs aren’t observable from inside the system — iron, vitamin D, B12, thyroid. A panel costs less than a week of feeling broken.

Triage when you don’t know where to start: sleep first, water second, food third, everything else after. Most bugs are upstream of the thing you’re blaming.

The Outputs

You track none of these and wonder where the week went.

 OUTPUT LEDGER (today)
 ─────────────────────────────────────
 focus hours          :   ?  / target 4
 deep work blocks     :   ?  / target 2
 decisions made       :   ?
 decisions regretted  :   ?
 mood                 :   ?  / 10
 sleep last night     :   ?  h
 meals eaten well     :   ?  / 3
 water                :   ?  L
 walk breaks          :   ?
 ─────────────────────────────────────

Pick three lines. Track them for a week. The bad days will start explaining themselves.

Garbage In, Garbage Out

Same principle as code. The system can’t fix bad input — it can only forward it.

  late dinner + 5h sleep + skipped breakfast + no water
                ┌──────────────────────┐
                │  + irritable         │
                │  + foggy             │
                │  + 2pm crash         │
                │  + bad commit        │
                │  + bad meeting       │
                │  + short with family │
                └──────────────────────┘

You didn’t have a bad day. You ran a bad input set, and the body did exactly what it was supposed to with it.

The reverse is also true. Stack a few good inputs and the outputs follow without you trying.

  daylight + protein breakfast + water + 7h sleep + walk
                ┌──────────────────────┐
                │  + clear head        │
                │  + 4 focus hours     │
                │  + steady mood       │
                │  + good commit       │
                │  + good call home    │
                └──────────────────────┘

Same person, same job, same desk. Different input set.

The Rule

Treat the body the way you’d treat a server you depend on:

  ┌─────────────────────────────────────┐
  │  feed it well                       │
  │  let it sleep                       │
  │  keep it hydrated                   │
  │  show it daylight                   │
  │  move it every day                  │
  └─────────────────────────────────────┘
            output you can use

You don’t get a faster CPU. You get this one, the same one, for the rest of your life. Tune it.

Compile Yours

Two small interactive companions to this post:

  • Body program builder — pick the outputs you want, get back a daily program with a schedule, plate, training, signals, and a debug loop.
  • Food atlas — what’s actually in common foods, sorted by nutrient density. Filter by diet, scan the bars, pick what you’d actually eat.

Same body, your inputs.

Want to talk? Schedule a Call
Enjoyed this post? Subscribe on Substack
Karan Batra - Game Programmer
Karan Batra

Game Programmer & Co-Founder of PixelPunch LLP. I ship games, build tools, and make the web work harder.

Know more →