Re:GNOME has no thumbnails in the file picker and my toilets...
by polynomial on Sunday January 10, 2021 @08:21PM
(#25722940)
This is a great example of where OOP and FP necessarily part ways.
Re:GNOME has no thumbnails in the file picker and my toilets...
by FridgeSeal on Monday January 11, 2021 @08:37AM
(#25728681)
That’s a cool idea, how so?
Re:GNOME has no thumbnails in the file picker and my toilets...
by polynomial on Wednesday January 13, 2021 @01:15AM
(#25758820)
I'm sure there are far more qualified hn users than I to elaborate, but basically you wouldn't have a dependency on an mutable object. Rather, the object would have to be directly passed to a function.
Having said that, I meant it more generally in the sense of their respective architecture design paradigms than details of a particular implementation.
I don't find such a design that surprising. If you like simplicity, you would be tempted to go for it, because it doesn't involve duplicating data (namely, the selected filepath) between the main GUI state and the event handler for opening the selected file. If you're writing in a memory-managing language like C, it's even more tempting - by not copying data, you don't risk forgetting to free it later.