Hacker News new | ask | show | jobs
by laszlokorte 1833 days ago
I agree that ideally the code could be organized a lot better, but think about it like this:

It is the fully working safari UI in only 1000 lines of code. Additionally the declarative approach of SwiftUI together with the type system makes it certainly correct in many ways: no rendering bugs, no invalid states, probably no memory leaks, no cyclic dependencies creeping in.

Try to build this in Java Swing, UIKit, Html/Css/Js or any other UI library. Flutter might come close, react/vue/svelte as well, if you assume sensible predefined components. But they work similar to SwiftUI and the resulting one-file might look pretty similar.

1 comments

Agreed, i hacked together something resembling a midi-sequencer UI in about 1000loc with JS+Vue.

I have an old editor written in Java/Swing that takes more and more willpower to work on every time because handling state update bugs is what i spend half my time on.