Skip to main content
Share Your Experience: Take the 2024 Developer Survey
102 votes
Accepted

How bad of an idea is it to use Python files as configuration files?

Using a scripting language in place of a config file looks great at first glance: you have the full power of that language available and can simply eval() or import it. In practice, there are a few ...
amon's user avatar
  • 134k
54 votes

How bad of an idea is it to use Python files as configuration files?

+1 to everything in amon's answer. I'd like to add this: You'll regret using Python code as your configuration language the first time you want to import the same configuration from within code ...
Celada's user avatar
  • 654
23 votes

How bad of an idea is it to use Python files as configuration files?

The other answers are already very good, I'll just bring my experience of real-world usage in a few projects. Pros They are mostly already spelled out: if you are in a Python program, parsing is a ...
Matteo Italia's user avatar
13 votes

How to apply environment specific changes within the classic Git branching model?

Git is not suitable for managing different variants of your code. Git is not a deployment mechanism. Git is just a source code management system. One thing that gets lost when using git push as a ...
amon's user avatar
  • 134k
13 votes
Accepted

Why is it called Software Configuration Management (SCM)?

The term configuration management belongs to the general engineering vocabulary. Its purpose is to keep record of the characteristics of all the parts/components of a complex system (e.g a car, a ...
Christophe's user avatar
9 votes

How bad of an idea is it to use Python files as configuration files?

The main question is: do you want your configuration file to be in some Turing complete language (like Python is)? If you do want that, you might also consider embedding some other (Turing complete) ...
Basile Starynkevitch's user avatar
9 votes
Accepted

Java Properties Files for Both Operations and Developers

Use a tiered approach (not all tiers are necessary): Load base properties from classpath. Override with properties from /opt/app/conf, IFF such a file exists. Override with properties from $HOME/app/...
kdgregory's user avatar
  • 5,250
6 votes

What is the preferred way to store application configurations?

We are battling the same problem where I work. Right now all of our configurations are file-based and source controlled with the individual applications that use them. This leads to duplication and to ...
ssjcory's user avatar
  • 61
6 votes

Should the HEAD version of the trunk always build?

The idea of HEAD is that every time a developer starts a task, they start with HEAD, and when they are finished they merge back into HEAD. That way you always know where to find the latest version of ...
Winston Ewert's user avatar
6 votes

Managing the same files in four separate SVN repositories

If you are going to have the same file in four repos, and allow it to be changed in any of the four places, you will sooner or later run into the problems of collisions, how to work with branches, how ...
Doc Brown's user avatar
  • 209k
6 votes

Best practice for knowing the link between binaries (*.exe and *.dll) and their source code?

The general idea is always the same: whenever you create a release of your product, make sure you assign a new unique version number to the end product, and use that version number for tagging the ...
Doc Brown's user avatar
  • 209k
5 votes
Accepted

Best practices for handling large number of structured configuration/property files

I think you need to ask yourself some questions first, and clarify some points, then you can better decide how to solve your problem. First: who shall have control over the servers? Is it a single ...
Doc Brown's user avatar
  • 209k
5 votes

Should I check for non-existing users with correctly signed tokens?

Two options: Use a different signing key for each separate user DB. That way tokens cannot be valid in more than one system. Store only a random surrogate key in the token. This key is then mapped to ...
l0b0's user avatar
  • 11.5k
4 votes

What is the preferred way to store application configurations?

Instead of storing the whole configuration in one file, store it in several files. Have a configuration directory. All files there are interpreted as configuration files, except maybe README*. All ...
9000's user avatar
  • 24.3k
4 votes
Accepted

Where to store application configuration

The configuration values are fetched at runtime from environment variables or configuration files directly. It sounds like you already have the possibility of decoupled deployments because you say ...
Samuel's user avatar
  • 9,197
4 votes
Accepted

How to handle artifacts across multiple teams and repositories?

It sounds like you need a package management system. There's several available depending on the platform you are working with (NPM, Maven, Nuget, Chocolate, etc.) TFS has built in support for ...
Berin Loritsch's user avatar
3 votes

How bad of an idea is it to use Python files as configuration files?

Adding to amon's answer, have you considered alternatives? JSON is maybe more than you need, but Python files will probably give you problems in the future for the reasons mentioned above. However ...
CodeMonkey's user avatar
3 votes
Accepted

Dealing with settings that will change on a per-environment basis?

@amon's answer is spot on. The best way to deal with this in a tech stack agnostic way would be with build scripts, etc. to create the files you need at build time. However, since you are working in ...
Becuzz's user avatar
  • 4,835
3 votes

Right way to spread secret keys between microservices

If you use some kind of service orchestration tool like Kubernetes it's easier: Kubernetes helps you mount secrets into containers savely: http://kubernetes.io/docs/user-guide/secrets/
enzian's user avatar
  • 41
3 votes
Accepted

Should usernames and passwords to external systems be documented?

Credentials come in different flavors, so you need different approaches. User credentials should only be known to the user, who might employ password storage tools to protect against forgetting ...
Hans-Martin Mosner's user avatar
3 votes

How do I maintain configuration in the case of multiple test environments and application instances

In my view you should define separate execution environments in separate files, e.g. like Spring's application-test.yml, application-local.yml, application.yml etc. That way you can switch between ...
Kilian Foth's user avatar
3 votes
Accepted

Can Feature Flags replace Hotfixes in Devops?

Feature flags can't fully replace a hotfix process. You probably won't be putting every single change behind a feature flag. That would greatly increase the complexity of the code as well as the ...
Thomas Owens's user avatar
  • 82.8k
3 votes

Storing different configuration for the same application in a repository

First, I would heavily recommend against using branches for customization, even when the kind of customization will be as simple as providing a specific config file. The problem is, this will lead to ...
Doc Brown's user avatar
  • 209k
3 votes
Accepted

Best practice for knowing the link between binaries (*.exe and *.dll) and their source code?

as my current employer does not work with a build server You should have a build server. Which runs an automated build process. If you really can't get one, make a "build VM" which sits on ...
pjc50's user avatar
  • 13.6k
3 votes

Infrequent config set up

Changing content directly on production is considered (by all means) a bad practice. A better one would be to add this file to the SCM and roll out changes from there1. This might take you to automate ...
Laiv's user avatar
  • 14.7k
3 votes

Where to put DLL specific settings?

Why not have both? a global config.xml file, where both libs look first for their settings a DataProviderWeb.config.xml file, where DataProviderWeb looks for every expected property it cannot find ...
Doc Brown's user avatar
  • 209k
3 votes

Allow command execution in config file?

As with most security questions, the answer here is "depends on what threat you trying to defend against". Assuming that your program doesn't run with any elevated privileges itself: You ...
Philip Kendall's user avatar
3 votes
Accepted

Allow command execution in config file?

There are plenty of executable configuration files. Example: ~/.profile They can be protected from writing by advanced ACLs and security systems, and so can yours. Distribute your program with a ...
Basilevs's user avatar
  • 1,983
2 votes

Project configs for Java projects

Based on my experience, it's a normal way to keep several configuration/application properties files in the repo, but remove redundant ones during building a deliverable. Also I would like to add that ...
PavelPraulov's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible