5 ms·
As someone with a significant amount of experience in both ObjC and Swift (4+ full-time years in each), I don't agree with this article. Yes, Swift isn't perfec
by jordansmithnz 8y ago
As someone with a significant amount of experience in both ObjC and Swift (4+ full-time years in each), I don't agree with this article. Yes, Swift isn't perfect, it has its flaws. Totally agree there. It's not perfectly integrated with Cocoa either, as the author mentions.
However, to say that Swift is a regression over Objective C seems very short sighted to me. Can you imagine if Apple continued with Objective-C? There would be no way to reverse decade old decisions that simply aren't the right decision anymore. Every new feature would need to be built on top of code from 1984. Swift was very future focused from the get go, and is a bid to ensure that developing for Apple devices in 2025 is not an archaic mess.
Like anything new, it's not perfect at first. That is the world we live in now. However, Swift is getting incrementally better at a very good pace. There are some reasons left to prefer Objective-C right now, but I'm sure that in a few years these reasons will be far fewer.
My own opinion is that I'm much more productive writing Swift, after spending a similar amount of time with each language. If you think the same is true of Objective-C, then that's great - there are certainly still some upsides to developing with Objective-C. However, to say that Swift is a mistake is something that I can't reason with, since it's one of Apple's most forward thinking decisions to date.
- dreamcompiler 8y ago> Every new feature would need to be built on top of code from 1984. Um, no. Macs were programmed in Pascal in 1984.
- dwaite 8y agoSo then 1985 (founding of NeXT) rather than 1984 (creation of Objective-C?)
- AnthonyMouse 8y ago> There would be no way to reverse decade old decisions that simply aren't the right decision anymore. Every new feature would need to be built on top of code from 1984. Of all the reasons to prefer a new language, this is the worst one from a platform perspective. C and POSIX allowed Unix to conquer the world. They allow code written since the 1980s to run with minimal modifications even on modern systems. The other major operating system family -- Windows -- is also strongly associated with backward compatibility. Everybody always wants to throw away the legacy code, because maintaining it is expensive. But throwing it all away and starting over from scratch can be more expensive. Especially when you're dealing with millions of lines of third party code. Which is why the only platforms that are still popular after 30+ years are the ones that didn't force everybody to do that.
- erik_seaberg 8y agoWe have 40 years of legacy code in C but essentially all of it fails catastrophically at random. If we ever want a platform that actually works we have to start from zero undefined behavior.
- pjmlp 8y agoYou mean allowed security firms and black hat hackers to prosper, turning Internet on a Swiss cheese of security with an endless number of attempts of compiler saniters, process sandboxing, CPU extensions, CS research to get out of the mess.
- touristtam 8y agoThat wasn't what the comment was about, thought, was it? Newer code base on newer language doesn't equate better security. That's a completely different discussion.
- sebbean 8y agoI'd say a goal of swift is to be more secure - so maybe not so far from this discussion
- AnthonyMouse 8y ago> You mean allowed security firms and black hat hackers to prosper, turning Internet on a Swiss cheese of security with an endless number of attempts of compiler saniters, process sandboxing, CPU extensions, CS research to get out of the mess. I mean take over the world. I know it's popular to hate C these days, but remember the context. The competition in the 80s and 90s were operating systems that didn't even have memory protection or the concept of user accounts. Unix was never going to lose over security. And we're not talking about the language to write daemons or kernels in, just the system API. A system should make it easy to write your code in any language you want regardless of whether any other part of the system uses it. There isn't supposed to be a One True Language. System APIs that advantage any specific language are problematic -- which is why the C family is popular for APIs. It's simple enough that it's easy to wrap using nearly any other language. For example, Java was the Next Big Thing around the time when IPv6 was new, and Java is "safer" than C. That would have been an opportunity for an operating system to deprecate the BSD sockets API, never extend it to support IPv6, and require internet-facing code to use a Java API in order to use IPv6. The problem is that's just making trouble for everyone. People who want to keep using their C programs, or use any other language (like Rust) that isn't Java, will either get saddled with some awkward and slow kludge to use the Java API from another language, or will just not bother to support IPv6, making IPv6 less popular than it is already. People who do want to use IPv6 but not Java will prefer other operating systems, making a system that does that less popular in general. It's no use to make something nominally more secure in a way that just causes people to not use it.
- _8ljf 8y agoIf you can’t think of any way that Apple could have created a modern Cocoa App development language with type safety, type inference, and a syntax that doesn’t stink then that’s your failing, not theirs. No, wait… that was their failing as well. They took a compiler engineer’s vanity project to invent Rubberized C++, and made it their App development “platform of the future”. And in so doing, trashed three decades’ investment in their Cocoa Applications development platform, which is the actual valuable part, simply to reinvent the same old wheel they had before. While not actually adding any fresh value. To what end; stroking nerd ego? Languages are ten-a-penny; you create a language to fit the problem space, not vice-versa. If you can’t get a 10x efficiency on developer time/LOC, don’t even bother. You’re just wasting everyone’s time. Tony Hoare called NULL his billion-dollar mistake. Swift is easily a million man-hour mistake, and still counting. Google must be laughing right now.