That’s a good question. You might ask this when you are implementing a new project and trying to figure out where to store your secret configuration values.
Before getting into the difference, let’s state the similarities:
Both allow storage of environment specific configuration values and secrets from outside of your codebase.
Both allow retrieval of environment specific configuration values and secrets from outside your codebase.
Both files use a key value pair type format.
Both allow comments within the files.
So what about the differences?
The names are different .ini vs .env
The method of storing the data is different.
The method of retrieving the data is different.
The syntax is different.
That probably doesn’t answer your question though. You likely aren’t interested as much in what the differences are as you are in why you would use one over the other.
Why use .env instead of .ini or .ini instead of .env?
This is likely what you are wanting to know, why would you use one over the other. So let’s list some pro’s and cons of each format to help make the decision.
.env Pros
language-agnostic
allows referencing other .env values as variables
libraries like phpdotenv provide robust functionality
Let’s expand a little on the language-agnostic pro above.
First Scenario. You are coming to PHP from another environment, like Ruby, you are probably wondering where to put your secrets and configuration values for your code. A .env file just makes sense, these are supported in Ruby so there must be a way to add them in PHP. Voila! There is a package that supports .env files that you can easily include in your PHP code and you don’t have to think anymore about it. It probably doesn’t even occur to you to use the build in .ini support.
Second Scenario. You are using both server side JS, like Node, and PHP. You want to share configuration values between the two systems. Both support .env files allowing you to easily share your secrets between both languages.
.ini Pros
built-in PHP Support
allows grouping of values via sections
supports typed values via INI_SCANNER_TYPED
allows interpolating other config values and environment variables
.env Cons
requires third party library and composer to work
features provided change based on library used for loading
*some libraries load configuration secrets into globally accessible variables like $_SERVER or $_ENV which will could expose your secrets to code you don’t intend to
.ini Cons
requires familiarity with PHP
Which one should I use?
I’m going to give you the answer you don’t want to hear. That’s up to you. It really depends on the needs of your environment and your program.
As far as my personal preferences go. I don’t like including unnecessary dependencies in my codebase. Therefore, if I’m using PHP to develop my app, and I have no need to share my config secrets with other languages, then I would use an .ini file and the built in support for those that PHP provides.
At the end of George Orwell’s 1984, Winston Smith is sitting in the Chestnut Tree Cafe. Upon hearing of the victory in Africa we are told he enters a dreamlike state. He has finally defeated himself. He loves Big Brother.
That’s it, right? That’s the end of the story. Or is it?
Join me for a moment and think through the last chapters of the book, if you will.
Did Winston Smith die?
There are a number of theories about whether Winston died or not. Some say he was literally shot in the back of the head. Some believe that the person who was Winston Smith ceased to exist, the death being metaphorical.
Either way, the end is ambiguous, correct? Either Winston physically died, or in admitting a love of Big Brother, he metaphorically died.
I don’t believe either is true. Winston Smith is alive at the end of 1984.
Why is Winston Smith alive?
Winston is alive both physically and mentally.
First, his physical death is described from within a dreamlike state. He is blissfully dreaming of going to the Ministry of Truth and confessing everything and incriminating everyone. He describes a long-hoped-for bullet entering his brain. However, this isn’t actually a description of his physical death, just a part of his dream.
Later, we’ll get to why Winston is alive mentally.
What is Winston’s Plan?
Above we see that Winston Smith perceives that the only way to keep a secret is if one keeps it from oneself. You must always know that it is there but never let it emerge into your consciousness.
After this thought Winston hatches a plan. He believes that one day the Party would decide to shoot him. It was in that instant that Winston would reveal his secret, his hatred of the Party, his hatred of Big Brother.
You can see Winston’s plan. He was going to die hating them. Because, as he says, “To die hating them, that was freedom.”
From that moment forward Winston was resolute. He shut his eyes and committed to this purpose.
Why is Winston Smith mentally alive?
Now we come to the crux of the issue. We know that Winston is not physically dead. But why is it that we know he is mentally alive?
Think of his plan. “To die hating them, that was freedom.”. Now, think of how he was going to accomplish that. He must keep secret his hatred of them and of Big Brother. He must keep this secret from the Party and from himself. And yet, while keeping this secret he must also know that it is there.
How can we know that Winston Smith is mentally alive? It is in the way that he describes the bullet that we know he is mentally alive. Winston is surely successful in convincing himself and the Party of all else. He loves the Party, and in the end he is able to convince himself of the hardest thing, he even loves Big Brother.
Or does he?
He does not. Winston knows of his secret hate of Big Brother, and we know of it too. He has succeeded in keeping this secret from the Party and himself.
However, he betrays his knowledge of this secret in the way he describes the bullet that would spell his doom. He describes the bullet as “long-hoped-for”.
A long-hoped-for bullet.
Why hope for a bullet? Why does Winston Smith describe the bullet this way in the end of the book?
He hopes for a bullet because to him it represents his freedom. The bullet is his plan. He told us this.
This is why he hopes for the bullet. This is why he describes the bullet as long-hoped-for. His rebellion is not quashed, his mind is not gone. No, he has simply succeeded in his plan. He loves Big Brother, and his hatred is known to but secret from him. The long-hoped-for bullet will be his freedom.
However, for the sake of this answer I will lay out Winston’s plan.
First some information:
Winston perceives the only way to keep a secret is if it is a secret to everyone, including yourself. You must have knowledge of this secret, but it should never enter your consciousness.
Winston concludes that the only way to have freedom was to die hating them (them being the Party and Big Brother).
Winston believes that at some point in the future he will be shot and a bullet will enter the back of his head.
Winston’s Plan
He will keep his hatred of the Party and Big Brother a secret, even to himself.
He will be shot with a bullet in the back of the head.
The instant he is shot, he will let loose his secret hatred of the Party and of Big Brother. In this way he will be free, because “To die hating them, that was freedom.”
Winston knows of this secret, however, and we know to. He betrays his knowledge of this secret in the slightest by describing that bullet, which was to enter the back of his brain, as “long-hoped-for”. After all, why would one hope for a bullet?
He hopes for the bullet, because the bullet is his escape, the bullet is the penultimate step in his plan. The bullet represents his freedom. It is then that he will die with dignity, his rebellion complete, finally unveiling the secret he is keeping from them, and from himself. He hates them and he hates Big Brother.
Do you hate seeing a sliver of light between your monitors? I sure do. I’ve spent a lot of time getting my monitors lined up just right so that they are flush against eachother with no gaps. However, a slight bump of the desk can throw all that hard work out the window.
So, I figured out another solution. Instead of adjusting the monitors to make sure that they are “perfect” I took some black electrical tape and ran it down the seem behind the two monitors. The black tape matches the black border of my monitors and it blocks any light from coming in!
I highly suggest running black electrical tape down the back seem between your monitors. It really helps!
Yesterday I took my son to SmileKeepers Medford Childrens dentist office.
I had to fight with the dental staff just to be allowed in the room where the work would be done. They suggested I wait in the car. I pushed to the point where I actually met with the dentist before the appointment. The dentist said to me that he’d been doing this for 40 years and he didn’t need my help “back there”. However, I was prepared to leave if my request was not met. So, after much pushing on my part they allowed me back in the room with my son. They said, that if I was going to come back they would just have to do less work on his mouth than they had planned. Note: This has never been a problem with any other dentist. I’ve been in the room with my kids numerous times and my kids draw comfort and courage from knowing that I’m in the room.
I sat in the corner of the room, as I normally do at the dentist, and the staff worked with my boy. My boy was great, he let the assistants work on his mouth, easily took the laughing gas, and was following directions well. Then the dentist came in and began to work. It wasn’t long before my son was silently writhing in pain, trying to tough it out. My son then began to tell the dentist that what he was doing hurt. The dentist would stop working on my sons mouth and ask “does it hurt?”, my son would answer “Yes”, then dentist would say, “I’m not doing anything right now, so it can’t be hurting” and then would continue working. My son was telling the dentist continually that it was hurting. However, the dentist was not listening to my boys concerns when my son said he was hurting. Instead the dentist was arguing with my son about whether he hurt or not. He was demeaning and was not treating my son with respect, he wasn’t treating my boy the way I would expect a person to be treated. He exasperated my son. There was nothing I could do, I wasn’t just going to leave the office with my boy bleeding from his mouth and try to rush him to another dentist. I also wasn’t going to risk telling this man who’d been doing this for 40 years how to do his job. Who knows if he’s the kind of person to take “revenge”. I had to let the man finish what he was doing as quickly as possible.
Now, anyone who knows him knows my son is tough. When my son says something hurts, he is telling the truth and I believe him. That said, I have never seen any one of my six kids like I saw my boy yesterday. I listened as my son yelled “No, no, no!” and the dentist ignored him to continue “working”. I sat there in silent rage as my boy screamed and writhed in pain, and instead of validating my sons concerns, the dentist argued with him and tried to prove him wrong.
What’s more is that when the appointment was over the dentist turned to me and said “this is why we don’t allow parents back in the room” as if it was my fault.
Now, I’ve taken the day to let my feelings subside and to think about this logically…
I am livid. There is a word that describes what happened to my son yesterday, abuse. I don’t even want to think of the additional “work” they would have done had I elected to wait in the car as they’d suggested. Anyone who knows us knows that we will push our kids through their tears when necessary. This was not one of those times.
Dr. Zirkle from SmileKeepers Children in Medford Oregon is the dentists name. He is not a safe dentist. I strongly recommend keeping your distance from him. We’ve pulled all 5 of our kids who are patients out of that office and we won’t be using another “SmileKeepers” or affiliated brand of Interdent dentist office (Gentle Dental) ever again. The fact that Dr. Zirkle is allowed to continue to represent Interdent is indicative of the bad decisions Interdent makes. A representative like Dr. Zirkle reflects very poorly on the Interdent company as a whole.
Other Parents Experiences
Other reviews are just as horrific. Apparently this has been happening for YEARS.
The other day I was thinking about how, in the future, “street-view-esque” spherical cameras will be used to capture events. These events can then be played back via VR, and eventually encoded directly to the brain via a project like Neuralink. Add in “kinect-esque” sensors that can map a 3 dimensional environment, and you could reconstruct an event in a virtual 3 dimensional space. I wouldn’t be surprised if future “videos” went that way, especially given FB’s push towards VR (think Meta).
But today I was thinking about being able to predict the future. Imo, the best way to accurately predict the future is to receive messages from the future. Receiving messages from the future sounds a bit weird, until I realized that’s literally what we work on every day. We design interfaces that receive future interactions. Code written to record transactions from today will record transactions from tomorrow. Webhooks are written specifically to receive receive future events. All of the code we write is intended to receive messages from the future. Think of the simple logging methods we use log('location', 'message'), even those are intended to log messages from the future.
That got me thinking of quantum entanglement, mapping polarization states to binary 1’s and 0’s, quantum routers, and an article I read years ago about delayed-choice entanglement swapping. The idea, in the article, was that a choice made in the present can “affect” measurements made in the past. It occurs to me that this also means, a choice made in the future can “affect” measurements made in the present. Could that same delayed-choice mechanism be used to receive a string of bits from the future?
Assume you define a state-binary mapping that you consistently use. Imagine measuring the polarization state of eight separately entangled photons, mapping those states to binary, you’d have yourself a byte of information from the future. Expand this to a logging method, maybe one that sits on a Starlink satellite, and you can imagine logging a bit, byte, kilobyte, megabyte of data that passes through that satellite all of it “from the future”. Assuming you have information from the future, could you then predict the future?
One of my friends recently asked me what my thoughts were on “Working from Home” vs Commuting. So, I wrote down a list.
The Pros of Working in an Office
There are definitely a couple pros that I can think about when working from the company office.
The People.
You get to have the random watercooler conversations.
You don’t feel so “alone”
You can easily bounce ideas off of others or weigh in on conversations that you otherwise would not have been involved in.
It’s harder for people to avoid you. (So you can finally get Bill to provision that extra RAM you requested weeks ago)
You have a better sense of the state of the company.
You overhear information about how the company is doing
You can literally see Manager1 and Manager2 rush down the hall to the CEO’s office. Which gives you a clue that something might be up.
You can take part in the office perks (only available to office goers)
Work provided lunch?
On site Gym?
On site Massage?
Work provided chairs and desks
The Cons of Working in an Office
On the other hand there are certainly some flaws too.
The People
They are loud
They don’t know when to leave you alone.
Manager stands behind you pretending not to look directly at you (might as well be parked in a big white van right across the aisle from your desk).
You overhear conversations you don’t want to hear
Gloria complained that it was too cold in the office so now the thermostat is set at a flat 76 degrees during the summer and 82 degrees in the winter.
Ted never washes his hands after using the restroom.
Ted enjoys randomly giving you back massages while telling you some inappropriate joke.
Ted works here.
The restroom is always out of toilet paper.
Ted is your boss.
The restroom is also out of acceptable toilet paper substitutes, like paper towels, because someone decided using a TON OF ENERGY to heat up and blow hot air at your hands was better for the environment.
Amanda plays with the action figures on your desk when she comes over to ask you a question. (BTW you’ve already answered this question three separate times via email, chat, and in a meeting).
MEETINGS -> you are all literally in the same room. Ted is there.
You have a better sense of the state of the company.
Nobody knows what they’re doing. This company is doomed.
You can take part in the office perks (only available to office goers)
Work provided chairs and desks. Why do they even buy them?
There is no work provided lunch, gym, or massage. But they do pay half the monthly fee for your space at the parking structure a couple blocks down the street.
You have to commute to work, which means you might get stuck in traffic.
Your space at the parking structure has a pillar in it.
That couple blocks is a long way to walk.
Your company believes in an “Open Office” environment. That means you work at a long fold out table in an old warehouse. The good news is that there are no cubes so you can see Ted clipping his finger nails. Also, you’re elbows are constantly bumping into Bills elbows who sits immediately to your right. You don’t bump into anyone on the left, because on your left is the wall and you’re just squished against it all day.
I think that sums it up? Feel free to drop your own Pro/Cons in the comments.
I watched a documentary titled “Disneyland: Secrets, Stories, & Magic” recently. Towards the end of the documentary they interview the Chief Creative Officer of Disney and Pixar Animation Studios, John Lasseter. In his interview he talks about the time he spent as a guide on the Jungle Cruise. At one point he mentions his “favorite joke”.
John Lasseters Favorite Jungle Cruise Joke
As you go through the cruise the guide tells you about various parts of it. At one point the guide sees a pile of skulls and he hides behind a small child. The guide explains how you are now entering the land of the natives. The natives are very dangerous but can sometimes be friendly.
They’re doing their famous “I can’t find the bathroom” dance. Everybody laughs, you let them laugh a little bit and you go on… long pause and then you go “that’s why they call them headhunters”.
But what does it mean?
I’m going to be honest. I had no idea what this meant. I mean it’s one of those jokes that you laugh at because everyone around you is laughing but you really don’t know why anyone is laughing and everyone actually feels the same way just looking at eachother in a weird state of laughter.
I researched it. Turns out that a “head” is what they call a “toilet” on a ship. So. Now you know. They are “head hunters” because they are looking for the toilet. You probably deduced the meaning of the joke from the context. However, you may not have known what a toilet on a ship is called. And now you do. And now it makes a bit more sense why the guide on the jungle cruise might call a toilet a “head”. You are on a boat after all.
I’m pretty sure that “The Truman Show” is an accurate description of what it’s like to be a software developer. Take the following clip for example starting at 55 seconds in:
“Blocked at every turn!”
I cannot tell you how many times I’ve thought about this line as it relates to the very real *struggle* it is being a software developer.
I mean here is Truman, he knows where he wants to go, Fiji. Getting to Fiji seems like it should be so simple. Really. All you need to do is get down to an Airport, hop on a few planes, maybe take a boat, and you are in Fiji in no time.
It should be so simple.
The reality is that it is not simple. In fact getting to Fiji is quite possibly the most difficult thing he has ever done in his entire life. He runs into issue after issue after issue trying to get to Fiji. He tries to implement solution after solution, and consistently fails. If that doesn’t reflect how I, a software developer, feel *every day* than I don’t know what does.
Here is the thing. Truman is persistent. He keeps going. He get’s creative. And in the end he finally benefits from all his hard work. The problem was *a lot* bigger than he could’ve ever thought. The problem was huge, but Truman solves the problem and he learned a heck of a lot along the way.
So, fellow Software Developers, as you struggle today remember Truman. Remember to be persistent. Remember to be creative. When you run into a blocker, back up, and try a different approach. I believe in you, you can do it.
What follows is my experience thus far with Discovery Benefits. This post is more of a frustration dump for me than anything else. Discovery Benefits administers the COBRA accounts for my previous employer. My experience with them thus far has been frustrating. Their website is: https://www.discoverybenefits.com/
Discovery Benefits runs very slow and has little knowledge about the internal workings of their organization.
I have contacted Discovery Benefits multiple times. Each time asking them to add a dependent to my COBRA plan. Initially I provided dependent information to them via their own forms. After I contacted my insurance provider I was informed that not only did Discovery Benefits enter my wife’s name incorrectly, but they also did not pass on my dependents information.
I called Discovery Benefits and talked to a COBRA representative. The representative looked through my file and found the information I originally provided. They did not have any idea why that information was not entered into their system. The representative informed me they were entering the information now. They told me everything should be resolved within 3-5 business days.
Nine business days later I contact my insurance company to confirm that my dependents have been added. Most of the information is correct, but they are still missing information about one of my dependents. The insurance company tells me that I need to call Discovery Benefits to add the dependent. (Which I’ve already done).
I call Discovery Benefits up again. The customer service representative tells me that they have all the information that they need from me. However, the internal department responsible for adding dependents has not added the dependent yet. I ask the representative for a reason why. The representative cannot give me a reason. The representative repeats that “for some reason” the dependent has not been added. The representative tells me that they will add a note to my account about this issue.
I call Discovery Benefits back. I ask to talk to the department responsible for adding dependents. The representative does not know what I am talking about. I have to explain to them. There is a department within Discovery Benefits responsible for adding dependents to COBRA accounts. I then explain to them that one of my dependents has not been added and I want to talk to someone who can tell me why. The representative tells me that I cannot talk to that department. The representative still cannot give me a valid reason why the dependent has not been added. They continuously repeat “for some reason”. When I ask to talk to someone who knows what’s going on, the representative tells me that there is nobody I can talk to who knows what is going on. They communicate to me that the best that can be done is to add a “prioritized note” to my account.
To summarize. Discovery Benefits does not know what is going on. They cannot connect me to somebody who knows what is going on. And furthermore, there is nobody at that company who knows what is going on.
The best that Discovery Benefits can do for me is to add a prioritized note to my account. I am stuck. All I can do is hope that somebody sees this note and chooses to address it.
Discovery Benefits has proven that it is not capable of providing satisfactory service or information.
I ran into this post by Michael T. Richter a while ago and found it to be an interesting read. I certainly recall the regex question he’s talking about and I remember stumbling upon that question myself back in the day. In the past StackOverflow did seem more like a community of developers who wanted to have fun and help eachother out. The dude makes some good points in his (now old and deleted) post.
However it has been archived and so I link to the archive here, mainly for my own future reference.