I tried to like Swift but with Perl as my first language Swift's regex implementation made me want to throw up. That and having to escape opening brackets and double parameter definitions. I just don't get the love for Swift other than it being an improvement over Objective C.
I never got the "write-only" criticism. If you understand a language thoroughly code is always readable. What's with the insane double param naming? And why do I have to escape and opening paren? No other language requires this.
It’s an enormously flexible language, and can be used to write almost inscrutable code, if we choose.
However, it can also be used to write extremely readable code.
I think it’s a sisyphean exercise, trying to get programmers to write readable code, but we keep trying.
Like I said, Swift is a bit like C, where it can be used to write obfuscated junk, if the programmers want.
My experience is that “idiomatic Swift,” as prescribed by many authorities, is starting to look like that.
I’m not exactly sure what you mean by “escape an opening paren.”
Do you mean inside of strings? That’s a direct inline shorthand that is similar to `...` in other languages. Totally optional.
For example: print(“There are \(numberOfSheep) sheep.”) is direct, as opposed to print(“There are “ + numberOfSheep + “ sheep.”), or print(“There are “, numberOfSheep, “ sheep”).
The fact that most devs use _ to work around it surely suggests that it was a pointless idea in the first place. Of all the barmy ideas to make a programming language unique this surely tops the list. As for escaped opening brackets you have to ask why no other language found this necessary. Is the Swift parser really so dumb? These 2 language features prove that however clever a language creator may be he/she can end-up producing features which are frankly absurd.
Not “most.” Just “many.” I do feel that "most" Swift programmers try to stay within the philosophy; even if only by rote.
I tend to eschew argument labels for the first argument; relying on the function name to provide context. That's a pattern that Apple also uses, and comes from ObjC, which came from Smalltalk, so Swift is actually informed by Smalltalk; a venerable OO language.
I’m sure that you can do amazing stuff in Perl, and I apologize for my "write-only" crack. It was not conducive to the conversation (which was about PHP). One of the reasons that I don’t use it, is that I guess I never got good enough with it to really sing.
The best tools can be misused.
Ever see a great musician play a beat-up old Univox, and sound like a chorus of angels, then someone buys a PRS, and sounds like a cat being tortured?
We can get hung up on the tools, and forget that the tool is secondary to skill and experience.
Well, toe-MAY-toe/toe-MAH-toe. No matter. I’ll keep programming in Swift, and limp along.