Remix.run Logo
user____name 8 hours 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.

dgxyz 7 hours ago | parent | next [-]

After 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.

rwmj 5 hours ago | parent | next [-]

Tcl/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 2 hours ago | parent [-]

Tcl/Tk was also popular in certain niche products, like in RF test equipment.

lylejantzi3rd 7 hours ago | parent | prev [-]

But, why? It's been 30 years. You'd think somebody would have figured out how to make a decent GUI toolkit or framework.

NetMageSCW 3 hours ago | parent | next [-]

Have 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.

lenkite 4 hours ago | parent | prev | next [-]

They 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.

exceptione an hour ago | parent | prev | next [-]

AvaloniaUI + MVVM toolkit.

dgxyz 6 hours ago | parent | prev [-]

We just built layers of shit over the ones we have.

dcrazy 5 hours ago | parent | prev | next [-]

This 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 3 hours ago | parent | next [-]

And this already worked in OPENSTEP, like 30 years ago.

paulddraper 2 hours ago | parent | prev [-]

Programming with GUIs?

dcrazy 2 hours ago | parent | next [-]

Yes, generations of Mac and Windows programmers have used GUIs to create their GUIs. Visual Basic, MFC + App Studio, .NET + WinForms, Interface Builder…

gzread 2 hours ago | parent | prev [-]

Why 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.

cosmic_cheese 8 hours ago | parent | prev | next [-]

That 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.

mayoff 2 hours ago | parent | prev | next [-]

How to add a button in SwiftUI:

    Button(“Click Me”) { buttonWasClicked() }
kageroumado 7 hours ago | parent | prev | next [-]

You 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.

steve1977 7 hours ago | parent | prev | next [-]

Sorry, 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.

markus_zhang 3 hours ago | parent | prev | next [-]

I'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.

762236 7 hours ago | parent | prev [-]

This is such a wonderfully beneficial comment to the HN community. It should get an award.