6 ms·
I still love Objective-C. And to me—I'm so amazed that Apple added "Property Syntax" and "Properties". It's pretty easy to do much of this with Macros (which co
by mucholove 5y ago
I still love Objective-C. And to me—I'm so amazed that Apple added "Property Syntax" and "Properties". It's pretty easy to do much of this with Macros (which could have been baked into the system) and the language stays very simple.
You would have 2 lines of code per property but one fewer concept—and I think that is a much more important factor. To me—this was not the right way to add sugar.
- bobbylarrybobby 5y agoYeah, no macros in Swift is a bit of an odd choice. It means that every would-be macro has to go through the language evolution process and be blessed by the Swift team. You can't release macro-like functionality, such as Rust's serde, without support from Apple.
- lenkite 5y agoAs someone who started learning Objective-C only after Swift become firmly established, I have to say I strangely like the language. I picked it up fast and have had no issues with adding features to a legacy codebase. When I started, I thought it would be some complicated beast, but no - its a reasonably simple and elegant C superset with the only disadvantage of some extra verbosity. (but Apple API's suffer from verbosity as a principle) I have to wonder: why did Apple create Swift ? Objective-C is quite nice, especially for C/C++ programmers. With Objective-C++, interop with C++ libraries is also terrific. Swift offers nothing like this yet.
- mekster 5y agoIt seems you like some ancient language which can't even concatenate a string without writing this dull statement with bunch of symbols. NSString *string1 = @"Some"; NSString *string2 = @" string"; NSString \*string3 = [string1 stringByAppendingString:string2]; Not to mention it didn't have ARC back in the days. For sake it was built nearly 40 years ago. Not sure if there's any room to question why Apple and devs wanted a new language. I was amazed why anyone would want to use this language before Swift but people didn't have a choice. There were efforts like MacRuby.
- Apocryphon 5y agoTo be fair, while Swift includes nice convenience methods for strings, the new API comes with a considerable cost: https://www.mikeash.com/pyblog/friday-qa-2015-11-06-why-is-swifts-string-api-so-hard.html https://www.mikeash.com/pyblog/friday-qa-2015-11-06-why-is-s...
- Grustaf 5y agoThat article is from 2015. A lot has changed, though some people still complain.
- Apocryphon 5y agoDoubtful that the technical underpinnings of the API have changed all that much since 2015.
- saagarjha 5y agoThey very much have.
- lenkite 5y agoARC has been there for almost a decade now. Also if you wish to do heavy string concatenation, please use a NSMutableString and you can simply do: [string1 appendString:string2]; It is amazing that people forget to simply use the right tool for the right job and blame the PL instead.