this post was submitted on 26 Jun 2023
11 points (92.3% liked)
Web Development
3444 readers
3 users here now
Welcome to the web development community! This is a place to post, discuss, get help about, etc. anything related to web development
What is web development?
Web development is the process of creating websites or web applications
Rules/Guidelines
- Follow the programming.dev site rules
- Keep content related to web development
- If what you're posting relates to one of the related communities, crosspost it into there to help them grow
- If youre posting an article older than two years put the year it was made in brackets after the title
Related Communities
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
Wormhole
Some webdev blogs
Not sure what to post in here? Want some web development related things to read?
Heres a couple blogs that have web development related content
- https://frontendfoc.us/ - [RSS]
- https://wesbos.com/blog
- https://davidwalsh.name/ - [RSS]
- https://www.nngroup.com/articles/
- https://sia.codes/posts/ - [RSS]
- https://www.smashingmagazine.com/ - [RSS]
- https://www.bennadel.com/ - [RSS]
- https://web.dev/ - [RSS]
founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
My biggest gripe with the dotenv pattern is people treating it like a configuration file. If you want a configuration file, just use JSON/YAML/INI/XML. A lot of the implementations now try to add "improvements" to the format that makes them now not always reliably compatible with just sourcing them in bash, or as Docker environment file, which just kind of defeats the purpose?
I'm also not sure what's so hard to just... source the
.env
file before you run your app.It is a quality of life improvement - maybe a minor one but it is an improvement. I think small quality of life improvements are important, as the fewer of them you have the bigger the problem as a whole they become.
That said, I think .env files are the wrong solution to the problem at hand. As you said, configuration files are the better way to solve this specific problem.
Sourcing the
.env
requires extra knowledge about shell scripting (even if it's basic knowledge, not everyone has it).On the other hand, not all shells are POSIX compatible (for example, PowerShell in Windows), so if we want to make a cross-platform solution, it becomes a bit more complicated (and also requires more knowledge than the previous case).
Regarding what you commented about those incompatible "improvements", I understand what you mean, but until now I didn't find any case of this (so far, variable expansion is a native functionality of most shells nowadays).