5 ms·
I feel like I'm the only person in the world who would rather write ugly win32 jank for the rest of my days than ever having to touch an "elegant" or "well stru
by user____name 6mo ago
I feel like I'm the only person in the world who would rather write ugly win32 jank for the rest of my days than ever having to touch an "elegant" or "well structured" Cocoa codebase. In win32 if you want a button you call a function and pass a hande, in the Apple world you first subclass 7 interfaces in some unreadable Smalltalk-wannabe syntax and pray you don't need to access the documentation. And of course they constantly change things because breaking backwards compatibility is Apple's kink.
- cosmic_cheese 6mo agoThat feels like quite the exaggeration. If all you want is a button, all you need to do is initialize an NSButton and then tweak a few properties to customize it as desired. If you want something more custom, subclass NSControl and you’re off to the races. And if Obj-C isn’t your cup of tea, one can use Swift instead, even in a codebase that had been only Obj-C prior.
- 762236 6mo agoThis is such a wonderfully beneficial comment to the HN community. It should get an award.
- dgxyz 6mo agoAfter bouncing around GUI toolkits (from win32 to SwiftUI) and web for 30 years I have simply run out of fucks. They all suck. Each in their own unique way. Apple aren't worth singling out - they are just their own special isolated variant of it.
- lylejantzi3rd 6mo agoBut, why? It's been 30 years. You'd think somebody would have figured out how to make a decent GUI toolkit or framework.
- dgxyz 6mo agoWe just built layers of shit over the ones we have.
- lenkite 6mo agoThey generally get the design right after some mistakes and are stabilizing it, when the new UI designers take over and want to re-do it from scratch.
- NetMageSCW 6mo agoHave you tried WinForms? It isn’t the latest hotness so Microsoft has to be dragged kicking and screaming to support it in current VS, but they were forced to do so because corporate developers still have some clout.
- int_19h 6mo agoI still think that WPF was the peak desktop UI framework. Extremely powerful with lots of small composable primitives, can easily do declarative but drop into more traditional event-driven imperative style where it makes sense.
- Marsymars 6mo agoI live in a bizarro universe where I started my career working on an expansive WPF desktop app on .NET Framework 4.0, and am still working on it now on .NET 10. From my perspective it's been WPF the entire time, and it's been pretty okay.
- PlunderBunny 6mo agoI recall there used to be a problem if you edited a (win)form in Visual Studio on a computer that didn't have the DPI set to 100% - did they fix that? The work around was 'simply' to switch to 100% DPI scaling before opening Visual Studio. On my macBook Pro built-in monitor, this was not cool.
- exceptione 6mo agoAvaloniaUI + MVVM toolkit.
- ranger_danger 6mo agoI have no complaints using Qt for cross-platform development, it has been paying my bills for the last 15+ years.
- rwmj 6mo agoTcl/Tk is pretty good in terms of rapid development. Unfortunately it has stagnated quite a lot over the years. Gtk on the other hand is absolutely terrible and its developers don't help by completely rewriting things every few years and breaking all existing code in the process.
- bigfatkitten 6mo agoTcl/Tk was also popular in certain niche products, like in RF test equipment.
- rwmj 6mo agoIt's still quite big in EDA (electronic design software).
- steve1977 6mo agoSorry, but this is simply just misinformation. If you were doing "classic" Cocoa in the way it was intended, you wouldn't need to subclass anything for a simple button. You wouldn't even need to write a single line of code, you'd just instantiate said button in Interface Builder, hook it up to a delegate (e.g. a window controller) and off you go. You can create a hello world example with a handful lines of code. And even if you'd rather create the button programmatically, it's not much more involved. Sure, if you're coming from Win32 and expect to program Cocoa without learning Cocoa, you're out of luck. But I guess that applies to all frameworks.
- kageroumado 6mo agoYou can now use SwiftUI, which is, as of the latest version, quite stable. They used to change things a lot between releases a few years ago, but nowadays you don't need to refactor your code every year. Only issue with it is that it's iOS first, so you may need to fallback to AppKit (Cocoa) to implement more complex elements.
- eviks 6mo ago> as of the latest version, quite stable Until the next latest version?
- dcrazy 6mo agoThis is patently false. To add a button to your UI, you open your window’s nib file Xcode/Interface Builder, click the plus button on the toolbar, and add a button. Then you control-drag from the button to File’s Owner and choose the method that you want to invoke when the button is clicked. Done.
- steve1977 6mo agoAnd this already worked in OPENSTEP, like 30 years ago.
- paulddraper 6mo agoProgramming with GUIs?
- gzread 6mo agoWhy wouldn't you program a GUI with a GUI if one is available? Avoiding the use of WYSIWYG editors when making GUIs is like avoiding the use of musical instruments when writing songs.
- bigyabai 6mo agoVisual Studio and XCode are way, way overkill for most software and eventually constraining for bigger projects too.
- Marsymars 6mo agoI'm not saying you should never program with a GUI, but it comes at a cost of being able to read the code and tell what the result of the code will be, and all the associated benefits of version control and code reviews that you lose. And as a side-effect of that, merge conflicts become murder when your "Fix right-hand margins" commit with a 20 line readable +/- diff instead becomes a 1000 line +/- diff. The one time I built an iOS app using the xCode IB so that I could get up to speed more quickly, I really came to regret it several years into the project.
- 6mo ago
- mayoff 6mo agoHow to add a button in SwiftUI: Button(“Click Me”) { buttonWasClicked() }
- markus_zhang 6mo agoI'm probably another, but I have never done any professional Win32 work. You know, those kind of jobs are rare now and I doubt they want anyone without experience.
- StilesCrisis 6mo agoWhat are you talking about? In Cocoa if you want a button you drag one in via Interface Builder. You don't even need to write any code. If you want it to do something, you type the name of the function it should call.
- vor_ 6mo agoThis is total misinformation.