Tag Info

Hot answers tagged

23

That would be super obnoxious. You: Wouldn't be able to see them all at once Wouldn't be able to place comments explaining why things are set the way they are Wouldn't be able to have documentation on what commands do, or what possible options are right in the configuration It would make backing up/version controlling your configs more obnoxious. Using a ...


21

My experience with developing on VMs in a corporate environment is that due to virtualisation of multiple cores being fraught with difficulties, it's difficult to get the kind of performance that many enterprise development machines need. Getting the code-compile-test inner loop to be as fast as possible requires the best machines possible - compilation and ...


16

In my opinion this is a huge issue. It tells me that company doesn't understand how their software works and is relying on voodoo to make it work without understanding why it works or why it fails.


14

I don't have a problem with a single config object, and can see the advantage in keeping all settings in one place. However, using that single object everywhere will result in a high level of coupling between the config object and the classes that use it. If you need to change the config class you may have to visit every instance in which it is used and ...


14

I think the first one will give you the ability to create a config object elsewhere and pass it to ExampleA. If you need Dependency Injection, this can be a good thing because you can ensure that all intances share the same object. On the other hand, maybe your ExampleA requires a new and clean config object so there could be cases where the second example ...


11

Configuration Management encompasses "everything else" that's not directly related to writing code. So it's how you manage releases, how you manage and triage bug reports and feature suggestions, how you perform your builds and so on. It often also includes how your source code is managed (e.g. what version control you use, branching strategies, how you ...


11

Martin Fowler and Pramod Sadalage have written an excellent article on this subject. Every developer has his own database to which changes can be made. These changes are then communicated back (as a changeset) to the DBA who implements them in the master database, so he's still involved in the process, he probably knows best about the structures and needs ...


11

Personally I would only use constants as default values, and let them be overridden by values from a configuration file. If the application takes command line arguments, then those would in turn override the configuration file parameters.


9

The same question arises in most of projects I work on. Usually I do this: If the set of possible values is unlikely to change any time soon, I use class/interface constants in the code and enumerable fields in the database. Example: state of publishing of blog entries: 'not published', 'under moderation', 'published', etc. Values will probably change, but ...


8

I think the better question is: Is what your doing now currently working for YOU? Alot of "experienced" programmers are quick to jump and say what is wrong and what is right, but sometimes what is right for them might not be the best for you. Just something to take into consideration, IMO if what your doing now is working well, I see no problem with keeping ...


8

I would like to add that certain types of development are much more difficult (if not impossible) through virtualized machines. I happen to work at a company where we offer software packages that integrate with a number of different USB peripheral devices (Eg. webcams, label printers, magnetic stripe readers, etc...). Even if I were to map USB ports to a ...


8

Do not forget about testability! Usually if the behavior of Example class depends on the config you want to be able to test it without saving/modifying the internal state of the class instance (i.e. you would want to have simple tests for happy path and for wrong config without modifying the property/memeber of Example class). Therefore I would go with ...


8

There are two extremes: Hard-code everything. This has the advantage of being easy and avoids the overhead of configuration. The disadvantages are obvious: maintainability, hot-deploying config changes, varying settings across environments, etc. Make everything a configuration setting. This has the most flexibility at the cost of having large ...


8

In my opinion, the nicest way for Exception handling in C# is the same exposed in this article: http://johannesbrodwall.com/2014/02/07/c-tricks-slimming-down-your-controllers/ (look for "Exception handling") Please note that the same pattern can be used for Java: http://johannesbrodwall.com/2013/09/25/offensive-programming/ The most important concept is: ...


7

With PHP in particular; the difference between an .ini file and a .conf.php file is negligible. Using PHP directly for configuration has the distinct advantage of only needing to relate to one well-defined, portable syntax for configuration, and the fact that the configuration file is properly code is occasionally useful. Compared to that; an ini file has ...


7

After looking at your requirements, and seeing that you have a dislike for XML, I would advise you to go with JSON. I must admit that I've only dealt with XML and JSON, so I cannot speak for any other common configuration formats out there. JSON is really easy to write, and if formatted correctly, easy to read. Google just LOVES JSON for configuration use ...


6

I segregate groups of related settings with interfaces. Something like: public interface INotificationEmailSettings { public string To { get; set; } } public interface IMediaFileSettings { public string BasePath { get; set; } } etc. Now, for a real environment, a single class will implement many of these interfaces. That class may pull from a ...


6

As others have mentioned it depends on several things: What does your environment look like? Do you have sufficient access rights to do development? Is your HW up to snuff? Environment Using a VM can help if you are working on multiple versions of a project; multiple projects; or targeting a different OS from the one you normally run (host OS). I do a ...


6

I do all my personal development in VMs. I have several VMs setup for different environments and it works fine. I have a dell studio 15 laptop (quad I7 2.8ghz, 8gb ram, ati graphics) running win 7 ultimate 64bit with virtualbox installed on. I have all my VMs running off an external 500gb usb drive velcroed to the laptop. VM 0 - Win 7 64bit clean install ...


6

I would say it's better to have multiple small classes with a single responsibility than one big god-configurator, even if that means you will have some duplication. If the duplicate logic is complicated, (I'm assuming that printLevel was just an oversimplified example) then you can solve it with creating an object specifically for printLevel and packing it ...


6

I think YAML is best fit for your case. To my understanding, YAML is the de facto standard format for configuration files that need to be edited by hand. Many programming languages have a library for reading and/or writing YAML. JSON is closely related to YAML, but is little bit less easier to write than YAML, and is used more for communication between web ...


6

This is a perfectly fine way of representing tree-shaped data. A file system is a tree database, why re-implement one on top of it? The most well-known implementation of this idea is the Windows Registry. Its main flaw is that it implements a filesystem alongside the filesystem and doesn't support the filesystem API, which means you can't use filesystem ...


6

What we've come up with is the following. We only place one config file under version control. It contains the settings of the development environment. It serves two purposes. One, if a developer opens a project and runs it, it should just work (see also the Joel test :)). Two, it serves as a template only. You shouldn't actually store actual configuration ...


5

Suggestions 1) Use two different SVN repositories. 2) re-structure the current (I'm assuming, single) SVN repository to: /cm/trunk/ /cm/branches/ /cm/tags/ /project/trunk/ /project/branches/ /project/tags 3) If the CM is specific to the project: /project/dev/trunk ... /project/cmd/trunk ...


5

IMO, somebody's first few years in an industry set an internal standard for what is acceptable and what isn't. I seriously question if working somewhere who a) doesn't know better and/or b) doesn't care, is good for your long term career. I'd suggest alerting them to the problem (in a non-condescending manner) and if they don't make it a priority to fix ...


5

In our company we are now using the VM for development and testing. Although there are some drawbacks for using VM's the benefits significantly outweighs them. Before we started using the VM's we were having constant problems with setting up development machines for new developers. The first task for new developer in the team was usually to set up his own ...


5

I would consider any change that forces a user to modify their code/configuration as a result to be a breaking change. So, in this particular case, I would wait till v2 to introduce the default of enabled=false and would instead add a note in the next minor release that explains this known scenario, that you should explicitly set enabled=false to avoid it ...


5

If your team find email disruptive or tune it out, something is wrong (they've set their notifications to be too in-your-face, or they're getting too many private emails, or they haven't set up filters/triggers properly). Email is, in my opinion, the perfect tool for this. Set it up right and it will serve its purpose. You could do something silly and ...


5

There are many other pressures: Writing a config file requires write permission on the file system (in fact, it requires a file system in the first place!). Environment variables can be set even if you are running a rescue system from a CD. Environment variables can be set quickly and temporarily just for one invocation, which is much better for use in ...



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