4 ms·
have used swift since version 2.x to create several mobile apps so i consider myself proficient, for the record, i have also used php, nodejs, c/c++, java, ruby
by epynonymous 7y ago
have used swift since version 2.x to create several mobile apps so i consider myself proficient, for the record, i have also used php, nodejs, c/c++, java, ruby, python, and golang quite extensively. i consider myself a full stack developer.
regarding swift, i am not a fan of the language at all, i use it more out of necessity, when i started to write ios apps, swift was available and i had already gotten used to not having to deal with memory management and such so chose the language, i also thought objc as a language for ios apps was a bit too verbose after looking at some tutorials, i had been used to using interpreted languages and syntactically concise languages like golang so thought i'd give swift a try.
somehow, over the years, i've managed to write a few apps with swift, so it does the job, the 2 things i dislike the most is the "as/as?/as!" statement, e.g. when i have a dictionary like object [String: Any] and having to "as" that is annoying to me, and you can't cast which to me is more direct, you have to first "as? Int" and then de-convert the optional with an !
The second thing i really hate about the syntax is the whole thing with "let" constants, i'm fine having to check for NULL first, but to do if let apples = fruits["apples"] as? String {...}, i guess this is kind of related to the first issue.
my swift code is such a spaghetti mess of these statements, i imagine a lot of it has to do with me, but this doesn't seem to be a problem with other languages. it could also be that i'm just trying to plow through the code so that i can get functionality working asap.
- infinisil 7y agoIf you're doing so much casting you're doing something wrong. Swift's power comes from the type system, which alleviates the need for all casting in general. Instead of using a [String: Any] dictionary which bears no meaning at all, consider converting it to a struct with accessors of the right types. If you work with the type system, Swift will be a joy to use, because that's where it shines.
- pixelrevision 7y agoI’d agree with this completely. A lot of the people I see having issues with it are trying to write it like python or something. For this style of coding objective-c is a much better choice.
- epynonymous 7y agoalso not sure why you were downvoted, i voted you back up.
- epynonymous 7y agonot sure why you were downvoted, i voted for your comment, makes perfect sense. i was using a generic [String: Any?] to hold a mix of variables, you are absolutely correct, should use a struct or maybe even a class.