It's interesting to me that many developers don't know the...

@anthonysheww
Anthony Shew@anthonysheww
7 views Jan 24, 2025 ~1 min read
Advertisement
1
It's interesting to me that many developers don't know the difference between `export FOO=bar` and a .env file that has `FOO=bar` in it.

So, in case you don't know this:
- "Environment variables" defined in a .env file are fake. They get added onto a process after the process has started and aren't present on the host machine. The values from .env get tacked onto the process after it has spawned in whatever place your runtime thinks environment variables exist at.
- Real environment variables are literally on the machine, man, for lack of a better description. They're a part of the environment where the process gets spawned.

While you may not need to think about this distinction daily, mutating the process vs. "it really is the process, bro" has some severe implications for programs that need to know what your real environment and fake environment look like.

Turborepo sits right in a sweet spot where we're handling processes and need to know the environment for hashing purposes, so we care a lot about this. It's a tough problem and we've put a lot of the burden of understanding this paradigm on users at this point. If you've felt this pain, we're thinking about how to make it easier (even zero-config, if we can).
Actions
What You Can Do
  • Export as PDF or Markdown
  • Batch Export to Notion
  • Bookmark & Highlight
  • Screenshot Tweet
Create Free Account

Includes 7-day Premium trial

Advertisement