3 ms·
> Learning to use the Swing API properly may be difficult, but would it really be easier if the Swing developers invented a new language to write it in? It abs
by tikhonj 4y ago
> Learning to use the Swing API properly may be difficult, but would it really be easier if the Swing developers invented a new language to write it in?
It absolutely would. I learned both Swing and web programming around the same time and web programming—with its domain-specific HTML and CSS—was far easier to learn, especially for anything beyond the most basic UIs. I never got beyond the point of making a Swing app that looked and behaved just like ≈every other Swing app; in substantially less effort, I could make web apps that looked and interacted in the way I wanted.
What made web programming so much nicer? I see a clear core dynamic: the web had a substantially better conceptual model. The layout system, the separation of content and styling (even if imperfect), the DOM... Compared to Swing and other non-web UI toolkits I tried, it was simpler, more regular and more adaptable. And the simpler conceptual model was directly supported by the web's core domain-specific languages! Sure, in principle, you could make a pure Java library that had a similar model but it would be much less natural and direct than having dedicated DSLs. Java and Java-style OOP is simply not expressive enough to reasonably encode that kind of conceptual model.