Mobile // Mobile Business
News
6/10/2014
05:11 PM
50%
50%

Apple's Swift Language: Not All Positive

Apple's new language, Swift, will be welcomed by developers primarily as an antidote to working in Objective-C. But Apple's continued insistence on a closed ecosystem is a missed opportunity.

Last week, at its annual developer confab, Apple unveiled a new language for development on Mac and iOS platforms. Called Swift, the language is intended to replace Objective-C as the principal Apple-sanctioned language for development on its platforms. While I am a fan of new languages, especially those that bring new capabilities to the programming sphere, I'm finding it hard to be wildly enthusiastic about Swift, save for the fact that it replaces a cumbersome language that should have been dumped years ago. On the latter aspect alone, Swift is indeed welcome and surely will be quickly adopted by Apple developers.

Swift was designed and developed in secret. The latter aspect is rather remarkable: I can find no one who had any inkling that Swift or any new language was going to be presented by Apple at the conference. Such tight security is a curious choice for a language under development, even for notoriously secretive Apple: Why not get developer feedback before casting the syntax and semantics into stone? Conversation with the intended users is the preferred path for new languages: D, Go, and Rust are all built with feedback from a community of early adopters and testers. In fact, that feedback is frequently touted as the principal reason for creating a community. In the case of Swift, not only is it not in Apple's DNA to solicit this feedback, but in some sense, Apple didn't need it because the company took no risks with the new language.

Swift simply brings together features common in existing, popular languages, then creates binaries via the LLVM compiler infrastructure, whose design we explained last year. As Chris Lattner, one of the core developers of both Swift and LLVM wrote accurately, it borrow features from Objective-C, Rust, Python, Haskell, C#, and Ruby. In this sense, it is the salade niçoise of languages. The benefit of this choice is that adoption should be fairly easy; the down side is that (as we know so well from C++) features imported for purposes of compatibility and familiarity with existing idioms tend to become plagued with vexatious limitations as the language evolves to fit new needs.

Read the rest of this article on Dr. Dobb's.

Prior to joining Dr. Dobb's Journal, Andrew Binstock worked as a technology analyst, as well as a columnist for SD Times, a reviewer for InfoWorld, and the editor of UNIX Review. Before that, he was a senior manager at Price Waterhouse. He began his career in software ... View Full Bio

Comment  | 
Print  | 
More Insights
Comments
Newest First  |  Oldest First  |  Threaded View
codeslubber
50%
50%
codeslubber,
User Rank: Apprentice
6/11/2014 | 6:40:16 PM
Re: Missed Opportunity is this Post
Yeah I know Rails is not a language.... lol. I brought it up because it's supposedly open and what happened was the community voiced their opinions and the dictator ruled as he saw fit. That 'community' would fail the Cult Awareness Network test (if they were still around, but Scientology bought them out).

Java is open? Oracle is suing Android for using it. And they won.

I frankly don't care that much about whether the language is open. I think the record in the Java community has been a pretty good argument for open gets you one thing: a ton of fighting and super slow releases for results that are not that stunning. The new Date/Time stuff is much better, but after almost 2 decades?? Seriously??

One of the things I like about Swift is that it has extensions (like O-C categories). I kind of believe that the last layer of the language should be sculpted by the people who are using it, and categories allow you to do that. In the mobile world, both ios and android have location managers. They are huge, sprawling examples of how code that tries to satisfy every usecase turns into goo. Something as simple as 'I need a location with an altitude' is an amount of work that obviates the whole headstart the API is supposed to provide: you have to learn all the details, figure out how and where to say mother may I. Then you have to test it. In essence, you are taking a very generalized mass and adapting it to your own requirements. I think this is why DSLs became popular and I predict Swift will end up being a good DSL language. ANd since you are writing that yourself, the question of it being open is pretty much moot.

 

 
Andrew Binstock
0%
100%
Andrew Binstock,
User Rank: Author
6/11/2014 | 5:15:04 PM
Re: Missed Opportunity is this Post
"These metrics are tired silly ones. Open languages like which? Is Rails open? Did all the changes get voted on?"

Rails is not a language. Putting that aside, 'open' means that a community is consulted and has input, source code to the language is available, and the tools are free. Python, Perl, Ruby, Go, Rust, and recently Java all fit this model.

Now look at Swift: no developer community involvement, no source code, and not free. That's what most people mean by "not open."
codeslubber
50%
50%
codeslubber,
User Rank: Apprentice
6/11/2014 | 11:19:23 AM
Re: Missed Opportunity is this Post
Depends on when you want to evaluate their performance. The first 15 years I would heartily agree, in the last 5, it was the fastest moving language out there. Go watch the WWDC session Modern Objective C from two years ago. Amazing. While Oracle sputtered on a 3 year release cycle on Java that included 2 features of any import: lambdas (which toy languages have now) and a rewrite for the desperately horrible time/date classes (which they didn't even really do, it was a committee intervention).

I think we all think that open means things will move faster. Why? 

Frankly language evolution is not really going to be necessary as I see it: Swift kind of has the language kitchen sink in it. Watch the playground session from WWDC. That's going to make a huge difference. The Java and Ruby worlds have been working with pathetic tools. While IntelliJ (the standard now in Java) is an awesome IDE, the builds are still glacial and it kills any rhythm or momentum to keep having to wait for the same stupid stuff. Ever wonder why you don't see more animation and sophisticated painting in applications? Writing that code is horribly painful having to rerun for each little thing you try. They specifically show that in the Playground session. 

My advice to google would be to look at the Playgrounds stuff and stop thinking that shortening a few symbols programmers need to type is the road to productivity. It's not. It's a way to coddle babies who either a. don't know how to type or b. can't be bothered to learn how their IDE works (most likely both).
ChrisMurphy
100%
0%
ChrisMurphy,
User Rank: Author
6/11/2014 | 9:25:42 AM
Re: Missed Opportunity is this Post
I hear a pressure for speed in nearly every IT shop I visit, and so it makes sense that developers are embracing these tools that remove what you so perfectly describe as timesucks from their work. Turning that speed element back on Apple, will it be able to adopt and refine new elements into Swift quickly enough to satisfy the market, if it keeps its proprietary approach? This piece argues it didnt' do that well with Objective-C.     
codeslubber
0%
100%
codeslubber,
User Rank: Apprentice
6/10/2014 | 7:01:13 PM
Missed Opportunity is this Post
These metrics are tired silly ones. Open languages like which? Is Rails open? Did all the changes get voted on? No, it's the product of a dictatorship and the hall has pretty much emptied out. Is Go open? Is Dart? Was Java? Sun made the world's most popular programming language and their reward was to be predated by a brontosaurus still living off of data center FUD. As to 'has features from this language and that,' I laugh when I see such things. Those features did not originate in those languages.. ?? For instance, lambdas? been around forever. Generics? lots of languages have had them.

I was skeptical but after some looking at it the combo of Swift and the playgrounds is a brilliant move on Apple's part. It's not about making it so that idiots and children can program either. It's about making it so that programming has fewer timesucks in it that contribute nothing to the feature set, like running down alloc/release issues (pre ARC), or NPEs/errant pointers. The designers of this language looked at metrics and made some smart choices. Let's see if they pay off. Java made programming less hazardous than with its predecessor (C++), but the defect density is roughly the same with NPEs equaling the number of pointer bugs. The reality is, pointers are not that dangerous in C++ if you use a decent tool. The use of optionals in Swift is an attempt to just get past this layer of wasted effort. You could argue that in the latest incarnations of Java, with IntelliJ, you are almost already there because there are nullable annotations and lint warns of places where you could dereference something null, but tihs makes it part of the language.

Language has become fashion and nothing is worse news to the programming hipsterdom than to hear that their little hobby horses have been adopted by a competing show. Sorry guys, they were never yours to begin with.
InformationWeek Elite 100
InformationWeek Elite 100
Our data shows these innovators using digital technology in two key areas: providing better products and cutting costs. Almost half of them expect to introduce a new IT-led product this year, and 46% are using technology to make business processes more efficient.
Register for InformationWeek Newsletters
White Papers
Current Issue
InformationWeek Tech Digest, Nov. 10, 2014
Just 30% of respondents to our new survey say their companies are very or extremely effective at identifying critical data and analyzing it to make decisions, down from 42% in 2013. What gives?
Video
Slideshows
Twitter Feed
InformationWeek Radio
Archived InformationWeek Radio
Join us for a roundup of the top stories on InformationWeek.com for the week of November 16, 2014.
Sponsored Live Streaming Video
Everything You've Been Told About Mobility Is Wrong
Attend this video symposium with Sean Wisdom, Global Director of Mobility Solutions, and learn about how you can harness powerful new products to mobilize your business potential.