Re: Language options: Objective-C, Swift, C or C++?
Re: Language options: Objective-C, Swift, C or C++?
- Subject: Re: Language options: Objective-C, Swift, C or C++?
- From: Dave <email@hidden>
- Date: Tue, 16 Jun 2015 11:38:04 +0100
> There are old-school reasons and new-school reasons.
>
> One of the biggest old-school reason is source duplication. You have to write everything “twice”, once in @interface, once in @implementation. This has been mitigated somewhat over the years, but Obj-C is literally twice the number of files as Swift, and (in my experience so far) twice the number of source lines to do the same thing.
You don’t have to “write everything twice”, (you *might* do that, but you don’t have to). The only thing you have to define “twice” are public methods and you just copy and paste these anyway. There are more files, but the .h file is generated automatically when you create the Class, so it’s no big deal.
Dave
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden