discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: The Swift Programming Language: what is our position towards this?


From: Dr . H . Nikolaus Schaller
Subject: Re: The Swift Programming Language: what is our position towards this?
Date: Mon, 9 Jun 2014 12:00:20 +0200


Am 09.06.2014 um 09:55 schrieb "Lundberg, Johannes" <johannes@brilliantservice.co.jp>:

They seem to experience huge difference in speed comparing Obj-C / C to Swift.

Well, that was to be expected (somehow). C-types can be compiled straight ahead into machine instructions.
So the only area where optimization could be better than for ObjC is for handling objects.

My opinion so far after reading the docs from Apple is that they have done some improvements but other
things became worse than with ObjC. Examples:

+ get rid of @ for strings
+ use + operator for string concatenation
+ homogenous handling of types, type-arrays
+ generics
+ overflow checks
+ get rid of nil
+ better syntax for blocks
+ get rid of the concept of pointers

but some apects will just move beginner's problems to other areas:
- strings are always copied on assignment (making some code less efficient)
- operator overloading makes code more difficult to read
- people will stumble over the whitespace rules for prefix vs. postfix operators
- confusion when to apply the ! and ? postfix operators
- case statements do not fall through by default (although the idea to explicilty specify a "fallthrough" is good, it is a new conecpt)

Maybe more I have not yet though of.

So IMHO they have introduced some concepts that are good from a modern language
design - but only understandable if someone has studied these concepts before. So a beginner
will not be able to utilise them better than any advanced feature of Obj-C.

It is more or less the question if a monumental cathedral looks better if built with modern tools.

Someone has mentioned that it is easier to switch to SWIFT if someone has _javascript_ experience.
But I don't think so. In my view SWIFT compared with any other language will show commonalities,
but has difference which can lead to big trouble - if not properly understood. So to me it looks
like a mix of Java, _javascript_, C, Obj-C with some spices from Pascal, BASIC and other concepts.

But like any opinion this is based on the current knowledge I have. And no practical experience…

-- hns

reply via email to

[Prev in Thread] Current Thread [Next in Thread]