I often see people saying that certain software is "very opinionated" or that Microsoft tends to write "un-opinionated" frameworks. What does this actually mean?
相关问题
- Name for a method that has only side effects
- Shared common definitions across C/C++ (unmanaged)
- Best way to keep the user-interface up-to-date?
- Long-lived RESTful interactions
- should I write more descriptive function names or
相关文章
- Should client-server code be written in one “proje
- Algorithm for maximizing coverage of rectangular a
- Is there an existing solution for these particular
- What is Scope Creep? [closed]
- What does “exposition only” mean? Why use it?
- Why doesn't there exists a subi opcode for MIP
- “Adapter” or “adaptor”?
- DDD Architecture - Where To Put Common Methods/Hel
Opinionated software means that there is basically one way (the right way™) to do things and trying to do it differently will be difficult and frustrating. On the other hand, doing things the right way™ can make it very easy to develop with the software as the number of decisions that you have to make is reduced and the ability of the software designers to concentrate on making the software work is increased. Opinionated software can be great to use, if done well, if your problem maps onto the solution nicely. It can be a real pain to solve those parts of your problem that don't map onto the tools provided. An example here would be Ruby on Rails.
Non-opinionated software, on the other hand, leaves lots of flexibility to the user (developer). It doesn't proscribe one method of solving a problem, but provides flexible tools that can be used to solve the problem in many ways. The downside of this can be that because the tools are so flexible, it may be relatively hard to develop any solution. Much more of the solution may have to be hand-coded by the user (developer) because the framework doesn't provide enough help. You also have to think much more about how to provide a solution and mediocre developers may end up with poorer solutions than if they had bought into some opinionated software. PERL is probably the classic example of non-opinionated software.
My ideal is a non-opinionated framework, but one with strong conventions. I would put ASP.NET MVC in this category. In reality all software is opinionated to some extent (though perhaps not PERL). MVC has strong conventions in its choice of model but offers many different ways to solve problems within those conventions. Some of those ways may even break the model. Used correctly, however, in accordance with the conventions developing in such a framework can be a real joy.
For balance's sake I will provide a (rather opinionated) description that is more favourable to the opinionated approach (in contrast to some of the other answers).
Opinionated frameworks provide a "golden path", which is supposed to be the best practice for most people and most scenarios (in the eyes of the authors).
This however doesn't necessarily mean lock-in. It means that it may require some extra effort to do things differently.
Less opinionated frameworks provide a number of different options and leave it up to you to decide.
Opinionated frameworks usually remove the burden from developer to reinvent the wheel or rethink the same problem again and again and thus help focus on the real problem at hand.
In the open-source world you can find many opinionated yet competing frameworks, so you still have a choice. You just have to choose your own golden path.
tl;dr:
If a framework is opinionated, it lock or guides you into their way of doing things.
For example: some people believe that a template system shouldn't provide access to user defined methods and functions as it leaves the system open to returning raw HTML. So an opinionated framework developer only allows access to data structures. By design, the software is limiting and encourages the designer into doing things their way.
Another example (taken from the signals link) is that of wiki. The designers of wiki had a lot of opinions. They thought HTML was too complicated for people to write, so they came up with what they felt was a more natural way to update content. They also stripped it of fancy design because they felt the focus ought to be more on content than design.
Apple has strong opinions when it designs its products.
Un-opinionated software design is more like PERL/PHP. It allows the developer and trusts the developer to make the right decisions and puts more control in their hands.
I would also place Microsoft in the non-opinionated column. A good example of a Microsoft framework which is un-opininated:
.NET
. By opening the CLR and the specs, it opened it to all sorts of languages and styles of implementations.It's basically software that works the way its authors think it should work, instead of trying to please everybody. That means a lot of people will not like it, but the ones that do will love it.
Rails is probably the canonical example of an opinionated framework: you do things their way, and everything is smooth. If you don't, you're in for some pain. But that's OK -- if you don't want to do things their way, you don't want to use Rails.
It's the amount of conventions implemented in a framwork and the number of decision that have been taken.
If, for instance, there are 5 (or more) different ways to submit form data to a controller action (which is the case in ASP.NET MVC), the framework seems to be pretty "un-opinionated" - the decision is up to you!
If, however, the framework enables (either through directly disabling other ways, or by strongly encouraging it) only one way of doing that thing (which is the case with Fubu MVC), you could say that the decision has been taken by the framework, thus making the framework opinionated.