4 ms·
I will gather a lot of downvotes, but still: I find Swift a very haphazardly designed language with very little foresight and forethought. This is further compo
by dmitriid 6y ago
I will gather a lot of downvotes, but still: I find Swift a very haphazardly designed language with very little foresight and forethought. This is further compounded by its standard libraries which are directly lifted from MacOS with all of their idiosyncrasies and huge incompatible changes from version to version.
For what it's worth, [1] [2] [3] [4]
[1] A type system that can't cope with SwiftUI: https://tonsky.me/blog/swiftui/ https://tonsky.me/blog/swiftui/
[2] More syntax to shake a stick at https://twitter.com/dmitriid/status/1276482336486576133 https://twitter.com/dmitriid/status/1276482336486576133
[3] Even more syntax weirdness https://twitter.com/bradfitz/status/1285302091544576000 https://twitter.com/bradfitz/status/1285302091544576000
[4] Standard library between versions: https://twitter.com/dmitriid/status/1201441652507844608 https://twitter.com/dmitriid/status/1201441652507844608 File manipulation functions on String, great design.
- valuearb 6y agoSo you ding the language because of a suboptimal choice made by one tool for it? The good and bad of Swift is the regular breaking updates. Sure it’s a pain when things change, but it’s also healthy when they improve, and almost every change has been an improvement. A language as simple as C can slowly grow without breaking existing source code. But it’s also never been able to address its most significant flaws.
- dmitriid 6y ago> So you ding the language because of a suboptimal choice made by one tool for it? I provided 4 different links showing multiple different features in the language I find suboptimal. > Sure it’s a pain when things change, but it’s also healthy when they improve, and almost every change has been an improvement. It's a very dubious statement at the very least. > But it’s also never been able to address its most significant flaws. Can Swift address its flaws even with its breaking changes? So far its been piling on more and more syntax, and continuously breaking its standard library (whose design choices like writing to files from Strings are very dubious)?
- deleted 6y ago[deleted]
- saagarjha 6y agoSwift is an extremely well designed language, probably one of the best I have encountered. Dinging it for its syntax is something that I didn't think I would ever hear. To respond your links–SwiftUI is not part of Swift, so 1 and 2 are not relevant; 3 is clearly explained and is never an issue in practice, and 4 is you faulting the language for being able to interface with APIs designed in the last century–you might as well laugh at it open(2) taking a bitmask.
- dmitriid 6y ago> Dinging it for its syntax is something that I didn't think I would ever hear. Not just syntax, but the amount of it, and the amount of special cases in it. > SwiftUI is not part of Swift, so 1 and 2 are not relevant SwiftUI exposes deficiencies in the "one of the best designed languages" and shows how Swift fails to scale in complex scenarios. (1) Shows that its design cannot cope with anything complex. You have to write clunky wrappers for `if` and `foreach` (but not for while and for, apparently), because the design of the language didn't have place for expressions. The type system cannot handle complex requirements of the library and can't provide better facilities than Java. (2) Shows just how bad the design decisions are in the language that they all but force you to write code this way. There's syntax upon syntax with no internal consistency or actual design to figure out how they all operate with each other. And Swift UI forces more half-baked escape hatches (like the `some` "type", like the lambda changes described in (1)) etc. I'll just once again expose my favorite piece of code ever: guard let self = self { return } instead of if self == nil { return } This is not an "extremely well designed language". These are badly thrown together pieces of half-baked ideas. (3) Once again shows just how badly it's designed. Or, rather, how badly the parser is designed that it can't reliably figure out what is going on. In a language that has no significant whitespace you have to care about significant whitespace. Great design. (4) I'm faulting the design of the standard library that is only compounding the problems already present. Many languages managed to figure out standard libraries that don't make you read and write files from a string object, or need 15 lines (different every year) of code to figure out how to write/read a file. This only continues to show that very little thought is going into this project, as they are being pressured for time to deliver "something".
- wfbarks 6y agoThe versioning issues have improved significantly as the language has matured.