3 ms·
Yeah SwiftUI has a very good happy path, flanked on either side by a 1000 foot cliff spike pit. My least favorite thing is when the compiler takes a look at my
by jitl 3y ago
Yeah SwiftUI has a very good happy path, flanked on either side by a 1000 foot cliff spike pit.
My least favorite thing is when the compiler takes a look at my view body and times out trying to infer some kind of generic, and the tells me “hey this 100 line code block has an error, but we don’t know where or what exactly” so I have to comment out code until I find the specific call expression.
- interactivecode 3y agoor actually split it out into reasonable chunks of code. It's the compiler encouraging you to create smaller views. This is better for rerendering performance and code quality
- jitl 3y agoA compiler in 2024 should be able to handle a function of 100 lines. That's like 1.5 screen heights of code for me, pretty normal! I'd have some sympathy if the function was 10,000 lines, but it'll happen with a 15 line block or a 30 line block or a 60 line block. I've written code in a bunch of languages and it's the first time that a compiler refuses to compile something, but can't tell me why or which expression is incorrect. "There's something wrong with your function" then I have to go play type checker and hover over every expression wondering what the issue is? I'm just shocked about it every time it happens.