Jump to content

Do you use dotenv?


NotionCommotion

Recommended Posts

Reading values from global variables is fine. Writing values is where the complications are, because it's not always easy to tell where a value comes from. If you only write in a small number of places (ideally one) then there's no problem.

 

Put another way, don't just repeat what you hear without knowing why.

Link to comment
Share on other sites

Put another way, don't just repeat what you hear without knowing why.

 

Never said they were evil, just that I have heard others say so.  I've gone back and forth trying to form my own opinion.

 

I've heard arguments against using them as it is more difficult to unit test.  I've currently never really gotten into unit testing, so I don't have an opinion.  Thoughts?

 

Also, I don't have a reason to think so, but expect it would not be a good idea to initially set a database connection to a global or use dotenv.  Thoughts?

 

Thanks

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.