4 ms·
Nice example of how good programming is often about meeting systems where they are: Whatever your feelings are about OOP and memory management, the reality i
by crawshaw 1y ago
Nice example of how good programming is often about meeting systems where they are:
Whatever your feelings are about OOP and memory management, the reality is that if you choose GTK, you're forced into interfacing in some way with the GObject type system. You can't avoid it.
Well you can avoid it and we did avoid it. And it leads to a mess trying to tie the lifetimes of your non-reference-counted objects to the reference counted ones. There was an entire class of bug that kept popping up in the Ghostty GTK application that could basically be summed up as: the Zig memory or the GTK memory has been freed, but not both.
- eviks 1y agoGiving in a bad system is more pragmatic rather than good
- hnlmorg 1y agoThe two terms aren’t mutually exclusive
- eviks 1y agoOnly in a dictionary. In a sentence that has the context of a poorly designed system, they are because you explicitly have to do worse programming to meet the system at a worse point
- hnlmorg 1y ago“Good” and “bad” are subjective. Being pragmatic about the design of an ecosystem and working with it, could be seen as good programming vs the alternative of fighting that ecosystem and thus creating entirely new classes of bugs. And this was what the GP was responding to. They were was that the pragmatism of working with that ecosystem showed good judgement.
- flohofwoe 1y agoCareful what you wish for. These days one has to be thankful if a badly designed old system isn't replaced with a new system that's even worse despite the best intentions ;)
- crawshaw 1y agoNo, it is about doing what you can, with what you have, where you are. That is good.
- eviks 1y agoSince you can do both (you're reading a post about a RE-write) your 1-dimensional framework doesn't help deciding what is good
- crawshaw 1y agoIf you believe everything around you must be good before you can do good, then you must trick yourself into believing imperfect things are good to do anything, or withdraw completely from the world. Your radical philosophy leads either to delusion or isolation and inaction. Just do what you can.
- renrutal 1y agoKinda reminds me of a quote attributed to Bjarne Stroustrup: "There are only two kinds of programming languages: those people always bitch about and those nobody uses" I feel there are no absolutely "good" systems, only the ones with added compromises over time. Battle scars on a beautiful body.
- giancarlostoro 1y agoGTK having this kind of scheme is why Vala was made and inspired by C# but uses GObject and all its joys, then transpiles your code to C. This is why a surprising number of GTK applications (more than I realized) are coded in Vala. I lowkey wish they had just adopted D instead of building up Vala. D is basically compiled C# to me in its own ways.
- pjmlp 1y agoThe problem is that D community keeps pivoting all the time, so now you get compiled C# with the breath of .NET ecosystem and IDE tooling, and is almost impossible to sell D, even if still has the edge in a few language features.
- giancarlostoro 1y agoI'm not talking about merging .NET into D I'm talking about instead of building Vala which transpiles to C, the creators of Vala could have just made a D library instead. D does not need the .NET ecosystem to survive.
- pjmlp 1y agoNeither am I. D needs a usable ecosystem, the point is that since Andrei Alexandrescu's book came out, the incomplete pivots have allowed the competition to get most of D features where it had an edge back 15 years ago. Even Andrei eventually got back to C++, now working at NVidia. Native AOT or .NET Native, plus all the Midori related improvements, and everything else C# has access to, was one example, there are others from other ecosystems.
- giancarlostoro 1y agoAh I understand. Yeah, what D needs is to build up a STD lib comparable to Go’s which lets you build nearly anything OOTB without a fuzz.
- WCSTombs 1y ago