In order to be fair, wouldn't you have to compare the cost of learning a new language, converting old code, etc. Vs the benefit of 'easier' code better memory mgmt, etc...
Also, could they have addressed memory management and other issues without having to move to a new language.
Is there something about one language that makesit so that it can't evolve into something that Swift can evolve into?
It wasn't all that long ago that ObjC didn't have ARC, now it does.
I see any language as just a set of instructions that the compiler converts into something else and is linked into something else.
How can one language do something that another can't? So it comes down to how easy and errors, etc... Can that not be done with changes to the current language, just like what was done with ARC?
I agree here. There is/was a lot they could have done to Objective-C to make it great and modern without throwing it out and starting over with a weird language that can't decide if it wants to be functional or object oriented.
Look at what Microsoft has been doing. They started with two languages, C# (object oriented) and F# (functional), and are Now sanely modernizing C# and adopting ideas from the functional world. The language is growing organically.
I think that Apple very well could have done the same thing with Objective-C.
Being able to get rid of pointers and even just initialize variables like this would have done great things for ObjC:
var object = [NSObject init];
[doublepost=1455958442][/doublepost]
I think it is not really Tim's job to explain programming to people, but what is the issue with those three lines? They are very simple if you know the Swift syntax. Also do not forget that for the same thing in Obj-C you would need to go look at
http://****ingblocksyntax.com
I'm not asking him to explain programming to people, I want him to stand by the claims he is making. That's my problem.
Operators have precedence and associativity. Also overloading operators was never recommended, it exists in Swift because most of the language is defined in the standard library.
Then why does it exist? Strip it away like pointers and for loops. Just more overhead and mental burden, in my own experience.
They are safer and simpler to understand than imperative languages (for beginners).
Says who?
The For-Next removal was quite straightforward. It has little use in a high level/functional language and the compiler can optimise for-each loops and high order functions better.
It may have little use in practicality, but we are talking about academic environments. I don't know about you, but for me the for loop was introduced, and later we had a discussion about why arrays are zero-based indexed and about pointer arithmetic and memory. Are we just going to stop caring and let future developers not have an understanding of the heritage of the tools and constructs they are using?
Trying to shoehorn Objective-C (or C) code in Swift is the wrong approach.
Well, that's exactly what using the system frameworks (Cocoa, Cocoa Touch) is doing.
[doublepost=1455958781][/doublepost]
I have been programming for decades, from COBOL, MASM, basic, C, C++, MSC, Objective C, some HTML, CSS, Java and tried Swift.
Personally I see no really good (programming wise) reason for Apple to jump on Swift other than to get a bunch of new coders for the their hardware. I don't find Swift syntax any easier or more "elegant" than Objective C, but the new young coders want to be different and innovative and this is what Swift offers. Swift actually adds some pain to the Apple process because now they have to support two languages to do the same things. Why would they want to do such a thing? Objective C is now old school and when a person is young, old school is just old school.
Basically what I am saying this, Swift is a marketing move designed to draw new blood into the Apple world.
BTW MASM was used to build tight and fast code for those old 8086 machines. It was used to write small functions which accessed hardware and memory locations directly and was not used to write a whole program.
This was kind of my thoughts.
I suspect that Swift was actually started as a skunkworks project at Apple by the compiler team, never to be revealed to the public and only for their own use. I mean, between the masterbatory syntax and the incoherent feature-set, it's a reasonable suspicion. But then something happened and everyone decided that Swift was the future, possibly for marketing reasons as you mentioned.
[doublepost=1455959103][/doublepost]
Also do not forget that for the same thing in Obj-C you would need to go look at
http://****ingblocksyntax.com
Also, I don't see the difference between learning blocks in Objective-C and learning closures in Swift.
Yeah, blocks are ugly compared with the rest of the Objective-C syntax, but they could have probably found a better way to do them in the first place, and the end result is that you need to learn something either way.