4 ms·
GUI toolkits have been written in the OOP style since it's the paradigm available. If SML had become popular, I'm sure we'd be writing that.
by adamnemecek 6y ago
GUI toolkits have been written in the OOP style since it's the paradigm available. If SML had become popular, I'm sure we'd be writing that.
- monocasa 6y agoML is from almost exactly the same time period as SmallTalk and it's work creating GUIs.
- adamnemecek 6y agoI'm well aware, what's your point.
- monocasa 6y agoThe paradigms have been available for pretty much exactly the same amount of time, down to the year.
- adamnemecek 6y agoI'm aware. What's your point?
- wtetzner 6y agoThe point was that OOP was popular, ML wasn't.
- monocasa 6y agoML was pretty popular in the day. But my point is that it's pretty weird to bring up SML in particular around GUI programming. The GUI framework only example I know of is mGTK and SML/tk which are far from idiomatic and pretty much require you to write imperative OOP code in SML. Meanwhile SML has existed for decades. It's one thing to say "people aren't using this great model we've developed the basics off, please help make it better", but if you wanted to write an idiomatic GUI app in SML today, your first step would be to have to write the GUI framework itself because no one else has. They don't provide any real options even if you fully buy in and want to jump in with what they're saying.
- scns 6y agoReact has been prototyped in SML
- adamnemecek 6y agoAnd note that it's not oop.
- dkarl 6y agoI got the impression from what I saw (coming into the scene a little too late to say from direct experience) that languages like C++ and Java, intentionally or not, did a great job of capturing how procedural programmers implemented the thick, rich, stateful GUIs that were common at the time. GUI widgets were literally the textbook example that many books used to explain classes and inheritance in a way that procedural programmers could relate to. So, I would say that the OOP style of GUI programming was a continuation of the procedural style that brought the old way of thinking to new "heights" through the new OOP language constructs.
- marcosdumay 6y agoYes, GUIs have both been greatly benefited by the availability of OOP and a great force on the popularization of that paradigm. I think nobody will disagree that GUIs are kinda hard to create in purely structured code, and OOP makes compares much better. But we are not at the 80's anymore, and have more options now. There is very little you can do with OOP that you can't in Rust, and a whole lot of things Rust adds to it. Just because things evolved this way it does not mean they are optimal.
- moldavi 6y agoRust is great, but it can't do very basic things that OOP offer. You can't make a simple observer in Rust without RC<RefCell<T>>, unsafe, global-ish mutable state, or being forced into some framework.
- marcosdumay 6y agoYou can always copy the observer into the observed structure (and avoid a lot of complications - observers are best created with FP, not OOP). You can also carry the GUI and whatever else you want as a parameter when executing the observer. But, of course you won't be able to mutate arbitrary global state.