Given the questions I see here and elsewhere, while contexts may be a stumbling block for some people, the real barrier appears to be Ecto. The hardest questions, often with the fewest answers, tend to be ones about Ecto.
Querying structured data is not the easiest thing in the world, and trying to create a nice abstraction between the storage system and your application is not easy. Ecto itself has been evolving rapidly, and so there are a few More Than One Way To Do Things, and many rough edges to be found (I created a pull request for one of those just 3 days ago).
Ecto is awesome, but it isn’t perfectly easy. And the amount of high quality examples out there is not … encouraging. Most cover the simple things (as someone else noted, real world use cases are rather more complex). … yet we don’t really hear toooo much here about the complexity of Ecto and how to make it more approachable.
So for me, worry over context is a sort of classic “bikeshedding”: contexts are easy to spot as a bump because they are new. New things without clear and unambiguous (perceived) benefits are often perceived as bad, or at least uncomfortable, at the start. Contexts are also somewhat trivial: they don’t REALLY introduce a new concept to the language or even the framework. You could have been doing something like contexts before, and you can ignore them now. So they aren’t really … critical. Contexts are also easy to understand and have been highly exposed.
So there are lots of discussions about them. Losing too much energy over that discussion is probably not useful, especially when there are bigger fish to fry out there such as Ecto.
What I think is likely to resolve the issue:
- time (as @josevalim noted already)
- a clearer statement and understanding among us developers what the purpose and benefits of contexts really are
- some nice examples / tutorials to show the path (as others have noted, having trailblazers to follow helps a lot more than documentation and marketing alone)
This is not to say that contexts are not a possible problem for newcomers. They may well be. And if people are saying that they are a problem for themselves, I think we have to accept that as true.
What we don’t know is what % of people coming to Phoenix are finding contexts an issue, for how long that persists, if it is a blocker, and/or what other issues are more important to them. Personally, I would very much appreciate a developer feedback survey that we could use to gather some data to understand what really is going on