4 ms·
Interesting. I've mostly been programming clojure for the last couple years. But I've got one project I'd like to try to make that is very GUI centric. I don
by DigitalJack 9y ago
Interesting. I've mostly been programming clojure for the last couple years. But I've got one project I'd like to try to make that is very GUI centric.
I don't know what it is about GUI programming, but I pretty much hate it. It's a complete schlep for me... it seems to take so much energy and work for something that is tangential.
If I had to go through the same level of effort to print something to the console, I'd never program anything.
- nsxwolf 9y agoAdd me to that club. Every tool designed to make GUI programming easier seems to just add complexity and confusion. From hand coded Win32 C++ GUIs to Tcl to Swing to Interface Builder/Storyboards, AngularJS and Bootstrap, I've had to use it all and have managed to turn all those things into giant writhing masses of spaghetti code every time.
- colde 9y agoHave you tried C#/XAML? It is by far the best GUI library/setup i have used by a large margin. It really makes everything else seem completely shit.
- seanmcdirmid 9y agoI always go old school in my own GUI programming, preferring just to draw everything myself via canvas or other immediate mode drawing APIs. It always comes out much cleaner than using a retained widget library.
- GuiA 9y agoI've used a fair amount of GUI tookits (including all the ones mentioned by grandparent), as well as written my own. I have to say that I really like Cocoa (particularly UIKit over AppKit) and feel that of everything I've ever worked with, it gets the most right. Of course, you become bound to a specific platform (I've been meaning to give GNUstep a try, not sure how good it is).
- pjmlp 9y agoGNUStep is kind of dead. Expect not so good Objective-C support for anything later than 2.0 and API support at best around Panther timeframe.
- flukus 9y agoThe two things that have helped me write clean GUI code the most are having some sort of event bus and following the MVVM pattern. The event bus helps you to decouple various parts of the UI, like when a certain menu item has to be disabled by certain data. MVVM let's you embrace the inherent statefulness of UI's and to test them. Both add a fair bit of complication in the short term but reduce it when the app gets bigger. Neither seems to suffer from the performance/correctness trade off that other methods (like forcing every minor change to redraw the UI) often have.
- bsaul 9y agothat's because , as much as we backend dev don't like to admit, frontend development is actually quite hard to be done properly. You have pretty much the same issues as in the backend : state management, concurrency, latency; plus specific ones : aesthetic and ergonomic. i've seen many backend dev calling themselves code heroes falling apart after a few days spent trying to design an android interface. it's a great humility lesson.
- aeorgnoieang 9y ago> state management Every GUI of any significant complexity I've ever created ended up needing (if not having) an explicit state machine to work reliably.
- pjmlp 9y agoThat is the problem, hand coding instead of using the graphical tools for GUI design.
- flukus 9y agoThat only helps for building the actual UI, which IME is not where the spaghetti comes from. The spaghetti comes from "if this data disable this control" type of stuff.
- chuckdries 9y agoNext time, give Vue a shot. All it does is take an HTML template, fill in some data, and update the data when the original 'source of truth' updates. All you have to do is modify that 'source of truth.' Yeah you still have to work with HTML and CSS but it abstracts away DOM manipulation without introducing too much overhead. Use it with Bootstrap, or even materialize for a more opinionated but batteries-included CSS experience. Personally, I tried and hated Angular because it tried to control everything I did. Vue says "make your application however you like, let us handle the view layer and that's it."
- hellofunk 9y agoIf you like clojure, I think you'll find that the clojurescript tools like reagent are among the simplest ways to build interfaces you'll find in any language. I've been using swift, C++, JavaScript, Elm, clojurescript, and others the last few years to build really nice user interfaces, and clojure is by far was the best.
- bschwindHN 9y agoCheck out Re-Frame and Reagent, that's the only UI programming framework I've actually enjoyed. Both are in ClojureScript. Re-Frame: https://github.com/Day8/re-frame https://github.com/Day8/re-frame Reagent: https://reagent-project.github.io/ https://reagent-project.github.io/