What is a convention on configuration?

Asked

Viewed 202 times

7

Currently I see that some frameworks, libraries and systems use the concept of convention on configuration, from which I raised the following questions

  • What is a configuration convention?
  • What are the advantages and disadvantages?

1 answer

5


It means that the tool is opinionated, that is, it decides what is good for you in most cases. In general are decisions made by skilled and experienced engineers with that problem and know how it is usually better to work, but the tool lets you change this standard already agreed and allows a different configuration than normal.

It’s a way to establish a default facilitating work and inducing the most unsuspecting programmers to do the right thing, without impeding the flexibility necessary for cases outside the standard that something different can work better if configured by a competent programmer.

With it you have to make fewer decisions and this is good or bad. It’s good because it uses what is called get the Things done. It’s bad because it’s common for the project to become simple, do wrong things for that scenario.

In general for the user of the tool only has advantages, it already has ready and does not have to think about the problem, has no work, has no risks to do wrong, without preventing another way of doing. It takes little or no work to use the convention and it takes a lot of work to configure something different, which can still count on conventions ready and you don’t even have to do, just configure what you want to use that way.

You can talk about a tangential disadvantage: the user will lose the chance to learn something, but only if he is not curious, the concept helps him to tend to be lazy, but it is a matter of attitude.

A very big advantage for the user is the much lower learning curve, even if it goes from one project to another using the same tool tends to adapt to the new project more easily.

Of course for the project can have the disadvantage of the inexperienced or lazy choose the convention when it is not the best solution. It can also complicate a little because it leaves implicit certain things and everything seem too magical, but again, it depends on the user being curious.

Perhaps the biggest disadvantage is not the concept itself, but because in some cases it tends to make the project too inflexible and does not suit everything it needs with configurations. It’s more a matter of how it’s done than a premise of the concept.

For the tool has the disadvantage of being a little more complex. But this is not so serious, or is not bad because an alternative is just to have the convention that makes it simple but very rigid and not useful to many people. Depending on the case it might be better if she just had something simple with the convention. On the other hand do only the way that requires configuration without a convention gives practically the same job creating difficulty for the user.

It is common for these tools to require that the project be created within certain premises and even use certain names or file structures because internally it expects so. In a way this can reduce complexity, so it depends.

If well done it is very advantageous if the tool demands it. If done poorly the disadvantage is not hers, but the misuse of it, a convention that displeases the majority is not good.

In general they adopt the least surprising principle (what is most likely to happen here).

Of course there can be abuse and be done poorly and the convention does not adopt "best practices".

This is present in complete tools or very simple things. If you have a function that does something with a past argument, but if nothing passes it still manages to do something useful by adopting a default value that would have been passed, that is, there is a convention that that parameter has a certain value in many cases, when you pass the argument is setting the function to do something in a certain way.

Makes a lot of sense in frameworks because they control your application.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.