6
LLAMS
8y

Swift can sometimes be just a bit too type safe, to the point where you have to put ! everywhere there is an optional variable to stop the compiler from complaining

Comments
  • 0
    There is so much wrong with this rant i'm afraid I need you to hand over your developer card immediately and leave the room.

    I LOVE the optionals feature in swift. It is a fantastic way to say

    "Hey intern, did you check for nulls here? ... I don't think you did, do it now bitch".

    You should also NEVER use !, theres always another better way. I have SwiftLint installed on all my interns laptops, set to catch force unwrapping, none are allowed into our codebase
  • 1
    @practiseSafeHex Ok bit of a harsh comment there. I am not condoning the use of the ! operator everywhere. what is annoying is thats the compilers suggested fix when you have a variable like that. I haven't been doing Swift for very long so maybe think twice before asking someone to "hand in their developer card" yeah? I wouldn't say that to a trainee who was relatively new to the language as it would just put them off.
Add Comment