News for hackers. Stuff that matters.
Re:Introducing Swift by IanDrake on Monday June 02, 2014 @05:02PM (#7836363)
My dislike is that it uses [] for method calls. It's like making Objective-English where we swap Z and A and j for o, just for the hell of it.

If thzt sjunds like fun tj yju, thzn gj fjr Jboective-C.

Re:Introducing Swift by emp on Monday June 02, 2014 @05:33PM (#7836578)
It's not for the hell of it.

[ ] does not mean method call, it is the syntax for a message send.

Objective-C is a super set of C, adding an Smalltalk like object system to C. The delimiters say "I am sending a message", which is different to a method call. Also, without them the language would be much more difficult to parse, and future changes to C could break the language. It's lasted well (first appeared in 1993). Not as long as Lisp, perhaps it needs more [ ] :)

Re:Introducing Swift by dragonwriter on Monday June 02, 2014 @05:39PM (#7836629)
> It's lasted well (first appeared in 1993).

1983, actually.

Re:Introducing Swift by emp on Monday June 02, 2014 @06:13PM (#7836836)
Thanks - I felt I should type 1983, but if felt wrong! I still had my Apple ][ back then.
Re:Introducing Swift by IanDrake on Tuesday June 03, 2014 @07:39AM (#7839445)
Thanks. Just read up on messaging and now I like it even less :(

In Smalltalk and Objective-C, the target of a message is resolved at runtime, with the receiving object itself interpreting the message. ... A consequence of this is that the message-passing system has no type checking.

http://en.wikipedia.org/wiki/Objective_c#Messages

Re:Introducing Swift by infinite8s on Wednesday June 04, 2014 @12:36PM (#7846571)
This is exactly what gives you the ability to easily wire up standard UI components and do tihngs like KVO. KVO is really difficult in something like C++ (for example, it's practically impossible to do in Qt to create without a lot of templating/boilerplace code).
Re:Introducing Swift by jfb on Monday June 02, 2014 @08:50PM (#7837535)
This is in my opinion the best thing about Objective-C; it clearly delineates the object/class and C dichotomy, making it easier for a C programmer (or a Smalltalk programmer!) to pick up. For years, the only changes from vanilla C were the brackets, "#import" and the @ literal syntax (IIRC).
Re:Introducing Swift by jfb on Tuesday June 03, 2014 @12:38AM (#7838182)
Actually, if you ask me today, after dealing with Scala's idea of how the Option type should work, I might say that nil propagation is the best thing about Objective-C.
Re:Introducing Swift by jonhendry on Wednesday June 04, 2014 @02:34AM (#7844284)
That's how I always felt. I liked the clear differentiation between C function calls and method calls on objects.
Re:Introducing Swift by trustfundbaby on Monday June 02, 2014 @05:08PM (#7836403)
very genius response!