[swift-users] "business applications market" flame

Don Wills don.wills at portablesoftware.com
Wed Jan 6 12:30:43 CST 2016

Points well taken.

> On Jan 6, 2016, at 11:02 AM, Jens Alfke <jens at mooseyard.com> wrote:
>> On Jan 6, 2016, at 9:34 AM, Don Wills via swift-users <swift-users at swift.org> wrote:
>> Coming from the perspective of business applications market (Java and C#), I see major problems in moving to Swift.
> Did you intend to hijack an unrelated thread instead of starting your own? If so, that’s bad netiquette. I’ve retitled the reply for you, to hopefully split off this thread.
>> The String class is a disaster.  
> Flaming: Again, bad netiquette. How about offering some concrete examples of what you dislike about strings? (Bonus points for showing that you understand Unicode and aren’t just pining for an outdated array-of-UTF16 model like Java's.)

I didn't want to post a tome about String, but here's a basic list of features/methods missing in String:

1. The lack a Character type that are the constituent elements of a String
2. Missing methods (Java names used):  valueOf, charAt, trim(), length(), getBytes(), toUpperCase(), toLowerCase()
3. The lack of the + operator for appending
4. The lack of a StringBuilder (Java again) class

>> Optionals present a giant spider web of interconnectedness and syntax idiosyncrasy that does not provide any real advantage compared with Java/C#.  
> How about “no more NullPointerExceptions?” And again, “no real advantage” is just opinion with nothing behind it. Optionals have a long history in functional languages and a lot of users of said languages who feel that they’re beneficial.

The cost of !, ? and ?? everywhere in the language is a huge coding and maintenance inconvenience for the programmer error condition referencing a variable that contains the value null.

>> The fact that Ints, etc. are not really primitives (unwrapping is required, sometimes explicit, sometimes implicit) is a major dislocation for those coming from all C-syntax-based languages.  
> Integers are primitives. More so than in Java, C# or other “managed” languages, since Swift compiles directly to machine code.

The fact that you claim Ints are primitives and Loïc Lecrenier in an email three minutes prior writes "Swift does not have primitives, but I consider that a plus..."  Which is it?

In addition, memory management (your reference to "language management") has nothing to do with whether or not integers are primitives.  In Java, "int" is a primitive and "Integer" is not.

>> The lack of non-checked exceptions (that is exceptions not declared with a throws clause on the func def) is problem.  
> Swift doesn’t have exceptions at all; its error handling is fundamentally different, despite reusing some common names like “throw”. I suspect you haven’t really understood how error handling in Swift works, since “non-checked” isn’t an attribute that has any meaning in Swift’s model.

Swift doesn't have exceptions?  What are the "throws" clause on funcs and the try and throw statements?

>> The lack of packages and/or namespaces is another giant gaping hole.
> I agree with this, but I think it’s something that’s going to be addressed in the future (see the current work on the package manager.)
> —Jens

I come from the perspective of 45 years of experience in dozens of programming languages.  Swift seems to be trying to be everything to everybody - a bridge from Obj-C, functional, imperative, procedural, object-oriented with a somewhat Java and C-like syntax.  I've seen this movie before - it was called PL/I and was the IBM answer to merging COBOL and FORTRAN.  Survivors:  COBOL and FORTRAN.  It appears to me that Swift is today's PL/I.


More information about the swift-users mailing list