Objective-C Use Falls Hard, Apple's Swift On the Rise (dice.com) 161
Nerval's Lobster writes: When Apple rolled out Swift last summer, it expected its new programming language to eventually replace Objective-C, which developers have used for years to build iOS and Mac OS X apps. Thanks to Apple's huge developer ecosystem (and equally massive footprint in the world of consumer devices), Swift quickly became one of the most buzzed-about programming languages, as cited by sites such as Stack Overflow. And now, according to new data from TIOBE Software, which keeps a regularly updated index of popular programming languages, Swift might be seriously cannibalizing Objective-C. On TIOBE's latest index, Objective-C is ranked fourteenth among programming languages, a considerable drop from its third-place spot in October 2014. Swift managed to climb from nineteenth to fifteenth during the same period. "Soon after Apple announced to switch from Objective-C to Swift, Objective-C went into free fall," read TIOBE's text accompanying the data. "This month Objective-C dropped out of the TIOBE index top 10." How soon until Swift eclipses Objective-C entirely?
Pretty quickly (Score:5, Interesting)
Apple has done great job of interoperability with Objective-C, making it pretty easy to write new code or port small portions of an existing program...
They've even gone so far as to add improvements to Objective-C which are nice, but whose primary reason for existing is that Objective-C code is even easier (and better typed) when accessed from Swift.
At this point there's no reason not to do anything new in Objective-C, and port what you can when it makes sense.
Re:Pretty quickly (Score:5, Interesting)
Objective-C though seemed relegated to a very tiny number of systems. Not as tiny as C# of course. Overall a lot of things start feeling like the 1970s all over again, with each major player having their own language, so choice of favorite language coincides with choice of favorite system. I much prefer cross-system languages.
Re:Pretty quickly (Score:5, Informative)
Well, Swift should be cross-platform pretty shortly since they are releasing it as open source (including standard libraries) in a month or two.
Objective-C was more cross-platform than you might think, people have used it for server development in the past. Even now it's used for both really popular desktop and mobile apps, which a decent range.
Re:Pretty quickly (Score:4, Insightful)
These are open source of course (Objective-C is a part of GCC too). But practically speaking it will stick to being an Apple specific tool.
Re: (Score:2)
There are third parties offering cross platt form Swift compilers: http://www.remobjects.com/ [remobjects.com] (no idea why their name is so wiered and why they are so hard t googl, oops might ebcause I used bing by accident)
The stuff they offer is quite interesting.
Re: (Score:2)
You can't even write Swift cross-system. Even though you may be writing an app for a phone, you are forced to do your dev work on a Mac (unless you want to resort to stupid solutions like renting a machine that you can remote desktop in just to write code [macincloud.com]).
Re: (Score:2)
Since a Mac != a phone, you are BY DEFINITION already writing Swift cross-system.
Re: (Score:2)
I much prefer cross-system languages.
You can't even write Swift cross-system. Even though you may be writing an app for a phone, you are forced to do your dev work on a Mac (unless you want to resort to stupid solutions like renting a machine that you can remote desktop in just to write code [macincloud.com]).
What you call a "stupid" solution is actually a pretty good alternative to buying a Mac when you want to do part-time iOS development.
Re:cross-system languages (Score:1)
Re: (Score:2)
C# is available on the vast majority of "desktop" operating systems, i.e. Windows. Okay, there is Mono, but C#'s real strength is in the vast number of .NET libraries and frameworks available, many of which are Windows only or not supported on Linux.
While programmers like cross-platform languages, users hate them. They want native apps that look and act the same as other native apps on their platform of choice. Java was one of the worst examples of this, with Java apps using their own custom GUIs and being
Re: (Score:3, Insightful)
Except Mono sucks.
Comment removed (Score:5, Funny)
Re: (Score:3)
Except Mono sucks.
The main reason Mono sucks is not the effort put into it, but the thought it was a good idea in the first place. While .NET is theoretically portable most real world .NET applications make assumptions about the platform they're running on, e.g. using MS SQL server adapters, or calling some native DLL or another, or Windows.Forms, or ASP.NET. So lots of .NET software simply will never run on Mono and even that which can might require significant changes - it's not write once, run anywhere or anywhere close
Re: (Score:2)
It's too bad, really; I like C# as a language but I wish the APIs weren't so Microsoft-centric.
Re: (Score:2)
Re: (Score:2)
There is still a swarm of NotImplementedException going around. Most of C# is running, at a much slower speed than .Net4.5, but there are still APIs that are just not there or terribly buggy.
Try running IIS in Mono, and we'll talk again.
Re: Pretty quickly (Score:2)
Why would you run IIS on Mono?
Re: (Score:3)
Availability doesn't seem to matter....they're both mainly used on a small subset of devices, for a small subset of projects.
Re: (Score:2)
I don't think you can name a desktop or server system objective-c is not available for, so your point is what exactly? You seem to think Xcode is the only OBJ-C compiler. You would be wrong...
Re: (Score:2)
At this point there's no reason not to do anything new in Objective-C, and port what you can when it makes sense.
I really am not sure what you meant by that sentence.
Re: (Score:1)
Me neither. If you removed the word 'not', it would make sense, and maybe it's what the OP meant to write, but he or she got a little careless with the editing (can happen to anybody). But that's just a guess on my part.
Re: (Score:2)
After some thought I realized should have put "Swift" in where I put "Objective-C", hopefully that clarifies things. When I read it I just read it as Swift since that is what I meant...
Re: (Score:2)
Re: (Score:2)
That makes more sense, but is still wrong since there are already Swift implementations on other platforms. It is not as ubiquitous as Objective C, but it has not been around too long..
Re: (Score:2)
Apple has done great job of interoperability with Objective-C, making it pretty easy to write new code or port small portions of an existing program...
They've even gone so far as to add improvements to Objective-C which are nice, but whose primary reason for existing is that Objective-C code is even easier (and better typed) when accessed from Swift.
At this point there's no reason not to do anything new in Objective-C, and port what you can when it makes sense.
My company does a lot of contracting work for other companies. So far the only client that has even asked us about Swift is Apple. It seems that Apple wants us to do everything in Swift now and everyone else prefers we stick to Objective-C. I can tell you the reason that I don't want to switch to Swift is that I think the syntax is horrific. My eyes want to bleed every time I look at something in Swift. I'll be honest, though, I don't really like Objective-C syntax either.
Re: (Score:2)
At this point there's no reason not to do anything new in Objective-C, and port what you can when it makes sense.
Swift doesn't support interop with C++ code. Swift should not be used in third party closed source libraries due to linker conflicts (even according to Apple.)
We're not at the point where everything should be Swift yet.
Not proprietary (Score:2)
Swift is shortly to be released as open source, including the standard library (fixing something that kept GnuStep behind).
Re: (Score:2, Insightful)
Anything that is produced solely by a corporation is proprietary, no matter if it is open source or not. Apple controls swift, just like Google controls Android and Microsoft controls C# and Sun controls Java.
Re:Not proprietary (Score:5, Funny)
Sun controls Java.
Hi there, Mr van Winkle!
Re: (Score:2)
Cool, so it's gonna be like Dylan!!
Huh? (Score:5, Funny)
I just finished a Flash animation course at ITT. Am I too late to the game?
Re: (Score:2)
Yeah that is so last decade, you should look into Silverlight.
Re: (Score:2)
"Animation" ...
A couple hours later, a new flash exploit is publicized (see ./ homepage)
Re: (Score:2)
I just finished a Flash animation course at ITT. Am I too late to the game?
Barrichello? It's you?
Re: (Score:3)
ITT Slashdot.
He literally finished his course In This Thread.
Re: (Score:2)
African, or European?
Re: (Score:2)
Which is better? (Score:4, Interesting)
Re: (Score:2)
But does their reference counting break circular lists? I know it can be done, but doing so increases the cost. (And circular lists can maintain multiple pointers to each element, so you really need to check that there are no external references to the clump. And if you do that you're already almost doing a garbage collector.)
Re: (Score:2)
There are zero Objective-C apps written today that use the garbage collector. ARC has been part of ObjC for years, and on iOS, the GC was never available. You've been trolled. Or the Anon Shitface is an ignorant asshole. Either way, your question is meaningless.
Re: (Score:1)
The GC has been deprecated for Objective-C for years, and it will be removed in the next version of OS X. The iOS runtime never had it.
Basically, you are completely ignorant.
Re: (Score:2)
Objective-C's garbage collection is the same as that in Swift.
There is also a properly garbage collected memory model, but that is deprecated and will not be supported at all on the next version of OS X.
Consider all efficiencies (Score:5, Interesting)
At this point the executables are about the same speed between Objective-C and Swift. In reality since anything even remotely heavy you'd be doing will probably use some library or frameworks like Accelerate it hardly matters.
What does matter though is programmer efficiency, and Swift is pretty useful there. It eliminates a lot of boilerplate or repetitive code, which makes for cleaner looking code all around that is easier to maintain and understand what you were trying to do later.
Lots of Swift educational materials have done a good job of keeping up with Swift but be aware it's still changing - make sure anything you look into covers at least Swift2.
consider garbage collection is garbage (Score:4, Funny)
Let me know when they catch up with c.
Oh, wait. They never will. Because garbage collection. There's nothing so ultimately fabulous as the executable deciding to take a nice vacation in the middle of something you didn't want it to.
So never mind.
Re: (Score:3)
Re: (Score:1)
True. But there are still cases where you can get high latency. The worst case latency for ARC is still as bad a mark&sweep GC. For example, add a few thousand objects to a table and then release the table; the program will iterate over all those thousands of objects, decrementing the reference counts and possibly releasing those resources.
Ironically this is one area where modern mark&sweep algorithms can be better, especially if the table was temporary or short-lived. And in C you can often use obj
Re: (Score:3)
For example, add a few thousand objects to a table and then release the table; the program will iterate over all those thousands of objects, decrementing the reference counts and possibly releasing those resources.
And how this differs from C++? Not talking about reference counting, as it depends on what kind of pointers you are using, but about having cascading destruction happening if you get rid of high level container?
Re: (Score:2)
And in C you can often use object stacks/bump allocators for this stuff. (Which is one reason to roll-your-own data structures in C rather than use libraries--you can optimize all the properties of the data structure for _your_ particular case.
Yes, how did that work out for the openssl guys?
Re: (Score:2)
This isn't an early 1980s LISP we're talking about.
Unfortunately, because early 1980s LISP systems were much more evolved than what Apple has ever come up with. :(
Re: (Score:2)
Like being interrupted by an other process? Probably swapped out to disk?
And most important: Swift is not a GC language/platform, a mistake imho.
Re: (Score:2)
The Apple implementation of Swift isn't garbage collected. Once it's made open source, there is no reason why somebody else can't create a GC version.
Re: (Score:3)
Swift.
By default Swift objects do not have dynamic dispatch, so method invocations do not have to do the lookup that Objective-C does. However, if you are interacting heavily with Cocoa or Foundation which any UI application has to do, you lose that advantage. There's still some advantage because Swift's optimisation is better than with Clang.
I wrote a 6502 emulation in C and Objective-C once in which all the performance critical stuff was done in pure C. My port into Swift ran at about a third of the speed
Re: (Score:1)
How could you possibly have any performance-critical code running a 6502 emulator on modern hardware?
Re: (Score:2)
Think wattage, energy, battery, etc.
Re: (Score:1)
Debugging null pointer dereferences are ridiculously easy in Objective-C. Have you ever written any code that wasn't in BASIC?
Re: (Score:1)
Good code shouldn't be checking for NULL pointers much at all, especially if your code follows good hygiene. I code mostly in C, but try to religiously follow RAII pattern by C++ religiously. If you follow an RAII pattern, there should be few if any execution paths where a NULL pointer could be dereferenced. (Note to C++ people: RAII is so much more than automated destructors on function exit. That's like the least interesting aspect of the pattern. It's just as powerful in C as in C++.)
Ever wonder why free
How soon? (Score:5, Funny)
"How soon until Swift eclipses Objective-C entirely?"
I'm guessing swiftly.
Re:How soon? (Score:5, Funny)
I don't think you're being objective about this.
Re: (Score:2)
I see what you did there.
FTFY
Dice spam (Score:5, Insightful)
Re: (Score:2)
gotta shift them resumes. "We have Swift openings now!"
Re: (Score:1)
But you've got to have at least five years experience of using it.
Re: (Score:3)
Sorry, five years experience required.
Re: (Score:2)
Doesn't apply if you have a green card anyway. Or if you just graduated college or are looking for an internship.
Objective - Steve is passe (Score:1)
sad
Re: (Score:2)
Apple is releasing Swift to open source, and is going to provide the language to Linux, so only windows will need to be ported off the open source code.
Re: (Score:2)
LLVM :)
That was Swift... (Score:2)
eating Crow (Score:1)
as much as I hate to admit it,
Congrats Apple, Good job..
Apple wins (Score:1)
More of an issue about how bad Objective-C is (Score:1, Interesting)
...than about how good Swift is. Swift is an improvement over Objective-C, but that isn't saying much, and quick adoption also says more about developers fears that Apple will deprecate Objective-C from new iterations of its X-Code and force everybody to use Swift moving forward to new Apple Operating Systems.
The world didn't need more languages. Developers write millions of lines of code for open-source libraries in multi-platform languages, and Apple and Google get into a dick-waving contest with these la
Re:More of an issue about how bad Objective-C is (Score:5, Informative)
You realise that Apple already announced that the Swift compiler is going to be ported to linux and made open source, right?
Re:More of an issue about how bad Objective-C is (Score:4, Funny)
Let me know when I can actually download and build a Swift compiler on something other than OS X, and I'll take a look at the language. Until then I'm not interested. And I'm a Mac user.
(On an unrelated note, who the fuck thought it was a good idea to use the Exit icon to indicate logging in to Slashdot?)
No, it really is about Swift being a good language (Score:5, Informative)
Objective-C was actually a very good language. Having used a lot of other languages heavily, including Java and C++ and C and Scheme and Lisp, Objective-C had a lot of great things going for it - it was verbose but once you got used to it that was nice, and the standard libraries for it were very powerful.
Swift itself is I think a really great overall language. It's pragmatic in all kinds of ways that tries to help the programmer, letting you forgo a lot of syntactical cruft. It also offers a nice array of modern programing concepts including functional programming - but does not force you to use them, so you can decide what level of functional and object oriented programing is the right mix for you - or heck, just write only functions and use it like a much nicer C variant.
The great thing is also, that with Apple heavily backing it you don't have to worry if it's worth picking up unlike lots of other nice, but small and not widely used languages.
Re: (Score:1)
Re: (Score:2)
The great thing is also, that with Apple heavily backing it you don't have to worry if it's worth picking up unlike lots of other nice, but small and not widely used languages.
Unless you end up working for a project whose target platform is anything but Apple. Your chances of encountering Swift on a program targeting any other platform is close to nil.
Re: (Score:2)
The great thing is also, that with Apple heavily backing it you don't have to worry if it's worth picking up
Didn't you say the same about Objective-C a few years ago? ;)
Re: (Score:2)
Objective-C is actually a very good language.
FTFY
Re:More of an issue about how bad Objective-C is (Score:5, Insightful)
I'm not sure what the right answer is, but it won't be found in a niche language whose sole purpose is to support one company's ecosystem and lock in developers to their platforms.
It's less niche than at least two dozen programming languages /. has hyped as the best thing since sliced bread. Sometimes I feel this place has become a bunch of grumpy old farts who think C and POSIX was the pinnacle of computer science and everything since has just been poorly reinventing the wheel. Or that programming should be for real men who could hand code it in assembly and that high level languages is just another attempt to recreate COBOL or Visual Basic. There's not a whole lot of money in creating programming languages, just ask Sun. And if you don't have widespread adoption, you're never getting off the ground. That's why the OSS community is still trying to create UI apps using 1980s tech, sure Qt is a decent band aid and GTK.... well it's a band aid, but the base language is way behind Java, C# and Swift. Not in what you can theoretically do, but in terms of how easy it is to do it.
Besides, Microsoft is open sourcing .NET Core, Apple has promised to open source Swift within the end of the year, Java has of course been open a while with the OpenJDK so it seems like the days of the base language being closed source is coming to an end. Of course they all do it with their own platform in mind, but desktop Linux could use a few allies. Yes, GNOME and KDE has been at it for a very long time but have they managed to get any market share? Once a percent of nerds, nobody else.
Re: (Score:2)
what a sec (Score:5, Interesting)
objective c plummets but swift only crawls up a couple notches but is still way down the list. sounds more like a lot of Apple device developers fled to something else for a living
Re:what a sec (Score:4, Insightful)
Re:what a sec (Score:4, Funny)
More than that, looking at the graph, the trend for most of languages is down. So it looks like developers are fleeing to something else than programming.
Sift is nice, but not great (Score:1, Informative)
I've been using swift for a while now, overall the language is nice and is easier than objective-c.
But, there are issues.
* You still have to know ObjectiveC. Similar to other systems, like JavaScript. You can learn other languages that compile to Javascript all you want, but you should still learn JavaScript.
* Swift gets lost. You ask Swift to call func1, it calls func2. The fix is to do a Clean and recompile.
* Debugger gets lost and reverts to assembly -- as if ObjectiveC wasn't bad enough
* Error handl
Netcraft confirms Objective-C is dying (Score:2)
It is now official. Netcraft has confirmed: Objective-C is dying
One more crippling bombshell hit the already beleaguered Objective-C community when IDC confirmed that Objective-C market share has dropped yet again, now down to less than a fraction of 1 percent of all developers. Coming on the heels of a recent Netcraft survey which plainly states that Objective-C has lost more market share, this news serves to reinforce what we've known all along. Objective-C is collapsing i
Not surprising (Score:2)
Objective-C was a single-platform language, with a single vendor and a single compiler*. Now that the only vendor switch to something else, developers move along. Nobody ever wanted to develop in Objective-C. People developed in Objective-C because it was the language of iOS.
*Yes, I know, GCC also supports Objective-C and 2 Linux users used it in their basement
MOV'n on up! (Score:1)
I think we're all missing the most important revelation from the index: ASSEMBLY language is currently more popular than Objective-C, Swift, and Visual Basic. Currently ranked 12th over-all, up from 31st this time last year
Re: (Score:2)
Re: (Score:2)
which just demonstrates how useful this "popularity" index is. Or is not...
Cannnibalizing Objective-C (Score:2)
Of course Swift is cannibalizing Objective-C. Apple intended it to.
Re: (Score:2)
Obi-c fell 11, swift went up 4.
There's more than cannibalization going on here.
Re: (Score:2)
Re: (Score:2)
Obj-C fell 11, swift went up 4.
It's not actually relevant how many ranking indexes it fell by. You can't go by that. What's relevant is the percentages.
Objective-C went from 10.294% to 1.419%.
Swift went from 1.054% to 1.277%.
Combined, they went from 11.349% to 2.696%.
Clearly, the method of calculating percentages is highly flawed, as iOS and OS X development has not dropped as much as we are (mis)led to believe here.
Bottom Line (Score:2)
TIOBE Index? Honestly? (Score:1)
That's a big drop. Is the app-dev gold rush over? (Score:1)
It is possible that app development is slowing down. The gold rush is over. Objective-C has dropped 8.6% and Swift climbs a meagre 0.5%. Additionally there is a resurgence of hybrid app development solutions like Xamarin (which uses C#) and PhoneGap/Ionic (javascript). These two factors combined account for some of the 8% overall drop.
Overall though, I have never trusted the Tiobe index. Perl is still in the top 10? Ok. No. On any measure. Compared to the clear activity of Python vs Perl (10x) on Stackove
Compiler needs a lot of work (Score:2)
For the last four projects, we've been using Swift exclusively. I really like it. The syntax feels modern to me (subjective, I agree).
The compiler however still needs a lot of work. I feel it's quite slow. It's somewhat better where it won't recompile related files when you make one change. But I was used to the Objective-C compiler. That thing _flies_. On a MacBook Air, three years old, I am able to work on pretty big Objective-C projects.
For Swift, that's simply not an option. Especially if you use mogene