Slow compiling.
Weak debugger.
Obj-c exceptions kill my app.
Slowness of adoption of simple, obvious, methods to std library (clamped(to:), sum(), sorting by keypath, and plenty more pitches that have died on the vine).
I often hate optionals.
young
(rtSwift)
23
this is initialized to nil
This is not
Actually, neither of those are initialized to nil. Only optional vars are implicitly initialized.
Self-conforming existentials would have allowed SwiftUI to accept any ShapeStyle, since AnyShapeStyle is probably what's stored under the hood anyway. Maybe that is still possible with overloading, if/when such a feature becomes available.
1 Like
I don't think I "hate" any Swift feature, and if I did in the past, it was usually because I didn't understand the reason behind that feature.
I think, though, that there are some clearly missing features, that I consider pretty natural and obvious, and whose lack requires several workarounds, but again, there are a lot of features that I personally don't use about which Iâd be naturally inclined to think "why did they work on this useless features instead of my more important request?", but I see many other people using and enjoying these features so I eventually realized that I simply don't have the full context to complain about this stuff in good conscience. As an example from the other side:
I'm instead glad that we have this in Swift, and I've been using for a long time a small bunch of custom operators that I find incredibly useful and that improved a lot my and my team's code, and I consider operator overloading (for things that are semantically unrelated) as a bad and confusing practice (even collection concatenation, in my opinion, should not use +).
But anyway, my top 2 missing features are:
- generic extensions (it can be done with a workaround, but only for functions), for example:
extension <T> Result where Success == Optional<T> {
static var success: Self {
.success(nil)
}
}
- the ability to define custom pattern-match mechanisms, in order to bind values on types that are not enums, for example:
let array: [Int] = ...
switch array {
case (_, let x, ...):
print("The second element of the array is", x)
default:
break
}
9 Likes
Karl
(đđŚ)
27
I'm not comfortable with the word "hate".
There are certainly parts of the language where reasonable minds may differ, and sometimes my own opinion differs from the decisions that have been made. We all have our own perspectives, and my priorities and preferences are obviously rooted in what I personally want out of the language. But I don't hate it when others win the argument by presenting a more compelling case for their priorities and preferences.
Similarly, there are gaps I wish would be filled. But of course, I only have my own needs to think about; I don't really have any idea what the overall Swift developer community would benefit the most from, only what I personally struggle with. I also don't work on the compiler, so I'm free of the pressure of having to ship feature X otherwise a bunch of my colleagues can't ship their work. It's a luxury to be able to point to something and say "I hate this", without needing to understand the context in which it was created or having to deliver an alternative by a deadline.
By all means, question the parts of the language you think could be better, and advocate for alternatives, but I think the word "hate" is too strong. I don't think it's the right spirit - it's not what we do here. We don't "hate".
24 Likes
if you don't hate (insert critical infrastructure you rely on), you haven't used (insert critical infrastructure you rely on) enough
7 Likes
toph42
(Topher Hickman)
29
Youâve just helped me make a whole bunch of my SwiftUI drawing code look a lot cleaner and more succinct with angle = 30° in lieu of angle = Angle(degrees: 30). Thank you!
18 Likes
idrougge
(Iggy Drougge)
30
I think there have been too many bespoke mechanisms added to the language since Swift 5.0 came out, which would have turned out better or even unnecessary had the technical underpinnings been grown better.
Result builders, @callAsFunction, @propertyWrapper, $propertyWrapper etc come to mind.
The features they represent could have been better if they werenât so rushed, and they serve to make Swift a harder language to learn and teach than just a few years ago.
12 Likes
dmk
(Dmitry)
31
Honestly, it seems for me that Swift has added too many specific features to handle them properly.
For instance, Self can be returned from a method:
func copy() -> Self
and canât be a part of a returned tuple:
func updated() -> (Int, Self)
The type checker often canât say the right reason why my code is invalid (especially in the latest versions). For simple expressions it works, yes, but for anything more complexâŚ
Generic are a problem too. Swift is claimed to support OOP, however, I canât create a variable/property to store anything conforming a protocol with an associated type. Which I think is one of the essentials of OOP, polymorphism.
It also makes me sad that Swift makes mocking (in testing, for instance) really difficult. Unlike Objective-C, there is no mocking library, no way to create anonymous objects, only code generation, which leads to increased project environment complexity, more problems for beginners, and more risks for CI/scripts.
3 Likes
young
(rtSwift)
32
it is possible:
struct Foo<S1: ShapeStyle, S2: ShapeStyle> {
let s1:S1
let s2: S2
init(s1: S1, s2: S2) {
self.s1 = s1
self.s2 = s1
}
}
ibex10
33
I like this poll - Thank you!
What I hate about Swift: It is a magical language.
PS: I am sorry to say this: Swift is harmful to those starting to learn coding. They should start with C first and learn what happens when you malloc and forget to free. 
Lantua
34
That's still too much magic and abstraction. You should start w/ assembly and Ralf Brown's interrupt list. What happens when you forgot to set EAX will surprise you!
21 Likes
dmk
(Dmitry)
35
Yes, youâre right, I can choose what type I want to use for the concrete instance . But I meant storing any implementation that conforms to my protocol, something like the following
protocol ShapeStyle {
associatedtype T
// âŚ
}
struct Foo {
var s1: ShapeStyle<CGFloat>
init(s1: ShapeStyle<CGFloat>) {
self.s1 = s1
}
}
var f = Foo(s1: A())
f.s1 = B()
Panajev
(Goffredo Marocchi)
37
Hate not being able to have argument labels on stored closures. Hate myself for not having the skills to help revert the damage caused by swift-evolution/0111-remove-arg-label-type-significance.md at master ¡ apple/swift-evolution ¡ GitHub that took them away :/.

19 Likes
hassila
(Joakim Hassila)
38
Well, just quickly proving this blanket statement wrong from my POV:
Electricity
Running water
Sewage
Internet access
Operating systems
Food distribution
...
I really rely on the above (and many more), used them intensely over several decades and have opinions on how they might be improved, but I hardly hate them...
I really agree with @Karl here - hate is a very strong word and there are a number of very significant considerations why things are like they are.
If anything, I feel that the uptake and success of Swift (that has many, many great features as outlined in the other thread - which is why most of us are here at this forum at the end of the day :-) ) might push the pace of the core team just slightly a bit too fast at times, but then, I'd rather have that and a great push forward of the platform than stagnation and no progress. It's a challenging balance for any product development team, presumably much more so for core tech like this.
5 Likes
+1. I for one am proud to live in a country where we can take reliable electricity and clean drinking water for granted. Cynicism has become so normalized these days.
1 Like
young
(rtSwift)
41
Big miss for me: the "." command: repeat the last edit action
3 Likes