> On Oct 14, 2019, at 2:30 PM, Jens Alfke <j...@mooseyard.com> wrote:
> 
>> On Oct 14, 2019, at 11:25 AM, Carl Hoefs via Cocoa-dev 
>> <cocoa-dev@lists.apple.com <mailto:cocoa-dev@lists.apple.com>> wrote:
>> 
>> I see Computer Science students here falling into two groups. The group that 
>> likes Swift generally likes scripting languages, Python, and the like.
> 
> Whoa, I completely disagree. Objective-C is much, much closer to scripting 
> languages than Swift, with all of its dynamic features:
> 
> * It has the 'id' type that represents any type of object
> * you can send a message to an arbitrary object whether or not its class 
> declares it
> * you can intercept unhandled messages and do arbitrary things to handle them
> * you can add, remove or override methods at runtime
> * you can even create classes at runtime
> 
> Swift is very strongly-typed and less dynamic: it's very strict and nit-picky 
> about types, protocol conformance, etc. Much more like C++.
> 
> Are you lumping Swift in with scripting languages simply because its 
> method-call syntax is more normal looking? Or because compiler type inference 
> sometimes allows you to omit variable types?

It’s kind of a funny dichotomy; Swift is a strictly typed language under the 
hood, but it *looks* like a scripting language on the surface, what with its 
type inference, JavaScript-looking-like “let” and “var” declarations, implicit 
closure parameters, and whatnot. Objective-C, on the other hand, is like one 
step down from Ruby on the dynamism scale under the hood, but on the surface it 
looks like a statically-typed language, thanks to the mandatory types on every 
variable declaration, even if the type is just ‘id’—although it usually isn’t, 
since in common practice we specify object types even though it’s not strictly 
necessary, and some of them can be kind of obnoxious (hello, block syntax).

Swift, on the other hand, can actually *be* a scripting language if you want it 
to; put #!/usr/bin/env swift at the top of a source file, give it execute 
permissions, and voilà, it’ll run just like a script.

>> (There is a third group that likes both languages, but it is very small.)
> 
> Most experienced iOS/Mac developers I know like both.


I’d agree with that.

Charles

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to