On Friday, October 31, 2014 at 13:22, Fritz Anderson wrote:
> On 31 Oct 2014, at 6:40 AM, Charles Jenkins <cejw...@gmail.com 
> (mailto:cejw...@gmail.com)> wrote:
> >  
> > My day job is programming in C# for Windows computers. I was really excited 
> > when Swift came out because it’s so similar to other languages I know well 
> > and use and admire.
>  
> I’ll take this as the root theme of your message.
>  
> Many of your objections amount to being unhappy that Cocoa, OS X, and their 
> tools are not C# on Windows. C# and Windows are worth knowing, but most 
> things that are worth knowing are neither C# nor Windows. They are that way 
> for thoughtful reasons, and not as duct tape over their falling short of 
> being C#.

This is not my position at all, and what follows in your message are straw-man 
arguments in response to assertions I never made. I get paid well to screw 
around with Windows, but I switched to the Mac back in 2000 and I prefer it 
over Windows in every way. I don’t want you to lead anyone to think I’m a 
Windows apologist come to cast aspersions on the Mac platform.  

If I were complaining that Swift isn’t C#, why would I feel that Obj-C offers 
less friction to me as a Cocoa newbie even though it is far more different from 
C# than Swift?

For one thing, I love out-of-band values. Receiving a clear null-reference 
exception at the point in your code where something should have a value but 
doesn’t is a very, very good thing. Swift encourages using the ? operator to 
hide bugs and make the eventual failure harder to correct; or cluttering your 
code with nested “if let” statements which probably have the same effect unless 
you go to the trouble of adding even more code to create an exception in the 
“else”; or adding the noise of ! operators.

Let’s say I have a variable called “phoneNumber” which may have a value or be 
nil. I’d like to be able to write code like phoneNumber?.dial() or if let pn = 
phoneNumber { pn.dial() } in areas where I don’t care whether phoneNumber is 
nil, where the rest of the code can continue working. But where it matters and 
phoneNumber must not be nil, I want to write code like phoneNumber.dial() and 
receive an exception. Adding ! is just noise, and in cases where execution 
shouldn’t continue, ? or if let are noise that can make things worse. But the 
choice which in my personal opinion is best is not allowed by the compiler.

And as for the table view, isn’t it notoriously difficult for noobs to learn 
and work with? I’m merely stating what I think is a known fact. That’s not the 
same as complaining about delegation or any other Cocoa pattern.

_______________________________________________

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