by gjm11 · 5y ago · 0 comments
This all seems like exactly the behaviour you would expect if having D3 users is not profitable and having Observable users is profitable. This would explain why the Observable team's explanations don't entirely make sense: the real explanation is "we are making things worse for you because we hope to make money by doing so". It would explain why they're unmoved by users' complaints that something allegedly meant to make things easier for them is making them harder: the real goal is profit, not making things easier.
On the other hand, (1) using Observable is free (at present, at least), and (2) in other respects mbostock has always seemed genuinely interested in providing good things for everyone to use. So I hope the cynical view in the previous paragraph is wrong. But it does seem like it explains what's happening better than "we just want to make things better for everyone, and Observable is so awesome we can't help using it for everything" which is pretty much the official line.
If you are using CodeMirror commercially, there is a social expectation that you help fund its maintenance.
Expecting free libraries is natural because the world is built on free libraries and free software. There's models to be paid within this of course (the largest by establishing expertise and then selling support). On the contrary, expecting everyone to pay for libraries is a model proven to have a much more limited lifespan (which also has implications on the developer's career).
In fact, if I learned something from free beer libraries is that it was a mistake to fall down that rabbit hole.
The harshest way to interpret unavailability of regular JS tutorials should be that the primary authors don't have enough bandwidth or the inclination to work on it, and the community hasn't picked up the slack to make it more accessible to beginners. The authors deserve nothing other than gratitude.
Having said that, Observable is not a mature system and there are some traps for the unwary: https://observablehq.com/@tmcw/observable-anti-patterns-and-... This kind of thing would certainly make me think twice about depending on Observable as a platform for a major project. There's a certain confidence in the act of name "anti-patterns" and "code smells" which belies the slightly ad hoc, provisional status of the platform.
And not everything is taken care of elegantly in Observable: making an animation tends to involve more JS control-flow tricks than would be ideal: https://observablehq.com/@mbostock/animation-loops
The idea that Observable makes life more difficult for people (in the service of building a profitable platform) doesn't ring true to me, though. To return to what I said in the first paragraph: Observable is conceptually simple (and most parts of it already have third party open source implementations). D3 is as intimidating as it's ever been, but I think the complaint "now I seem to have to learn Observable as well as D3" is not based on a good faith assessment of the complexity of learning Observable, and shouldn't be seriously entertained. It's in the "petulant" category of complaints about software.
Basically… the anti-patterns stuff is really not that different from "React anti-patterns". JavaScript supports mutability, a lot of frameworks embrace immutable patterns (like Observable, and React). Using the mutability will lead to bad situations, like mutating in Observable or mutating some state in React.
The same with selecting elements, too. Like - if you're in React (or Vue, or… most component libraries) doing a document.querySelector is no good. You break modularity and the ability to add multiple copies of a component to a screen. Same with Observable. Selecting elements from a necessarily-global DOM is bad.
The gist is: Observable isn't JavaScript but is really close to JavaScript. We could either make it mostly-JavaScript and have some gotchas around mutability and such (but make it a lot friendlier to JS devs, use existing libraries, etc) or make it something stricter and do a 'clean break.' If Observable was way different than JavaScript, this thread about Observable "having lock-in / being too hard" would be 10x bigger :) Such is the balance between practicality and purity.
You can see plenty of other things trying to do this balance. Like React (not quite JavaScript, because of JSX), Svelte (very much not vanilla JavaScript), Elm (pure, idealistic, also its own island because of its purity). Unfortunately you can only really do a pure system with those drawbacks, a practical system with those drabacks, or some combination of the two.
https://observablehq.com/@observablehq/observables-not-javas...
I think it's an amazing piece of technology, hosting some of the best interactive stories on the internet — but I too find it hard to use.
[0] https://github.com/d3/d3/commit/23b0212743d22e2dea3e20163980...