Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I lived and breathed Swift for the first five or six years of its existence. When people compliment it, I assume they haven't used it long enough to hate it.

Swift is a mix of great features, miserable features, and... every other feature that someone on Evolution dreamt up (with the exception of those that would fix the miserable features)

Swift is unique among high-level languages in that the mental effort required to do many simple things rivals that of a low-level language.



I think you have to give some examples.


It's been a while, but the one I remember with the most horror was dealing with Enums, and Enum payloads. Since Swift is statically-typed, many 'type union' situations end up becoming difficult problems. The question usually boils down to thinking about choosing one of (a) Enum with Payload (b) Generic (c) Type erasure. Nearly anything technically is do-able, but I wasted many hours (ie: repeatedly, not until I figured out the 'right way' for every situation) deliberating over how!


I am not sure that I understand you correctly, and I find the subject interesting.

Is it what the enum abstraction can model easily that is the issue?

If so, I believe the Rust community has similar issues regarding error handling. There are multiple libraries like thiserror and anyhow.

https://old.reddit.com/r/rust/comments/1mexsqr/the_way_rust_...

https://old.reddit.com/r/rust/comments/1q3wb3l/stop_forwardi...


Low level languages don’t even have those features.


I didn't mean to suggest they do!

When I used Swift, I frequently was surprised to find some simple part of a program actually required me to sit and plan for several hours.

The exhausting amount of mental energy is the only part that reminds me of coding in Assembly.


I guess my perspective is that I usually have to plan out my programs regardless of what language they’re in so I don’t really view it as being similar?


That is a different issue than this:

  I frequently was surprised to find some simple part of a program actually required me to sit and plan for several hours.
It's perfectly normal in programming to encounter domain problems that take longer than one predicted, or to plan ahead with pseudo code, proofs of concept, class diagrams, etc.

What is abnormal is, over and over again, to find oneself utterly stumped on how best to implement something very basic. At least, it's abnormal when using a high-level language.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: