Slashdot Mirror


Objective-C Use Falls Hard, Apple's Swift On the Rise (dice.com)

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?

97 of 161 comments (clear)

  1. Pretty quickly by SuperKendall · · 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.

    --
    "There is more worth loving than we have strength to love." - Brian Jay Stanley
    1. Re:Pretty quickly by Darinbob · · 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.

    2. Re:Pretty quickly by SuperKendall · · 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.

      --
      "There is more worth loving than we have strength to love." - Brian Jay Stanley
    3. Re:Pretty quickly by phantomfive · · Score: 1

      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.

      --
      "First they came for the slanderers and i said nothing."
    4. Re:Pretty quickly by MightyMartian · · Score: 2, Insightful

      Except Mono sucks.

      --
      The world's burning. Moped Jesus spotted on I50. Details at 11.
    5. Re:Pretty quickly by Darinbob · · Score: 3, 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.

    6. Re:Pretty quickly by ottothecow · · Score: 1
      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).

      --
      Bottles.
    7. Re:Pretty quickly by phantomfive · · Score: 2

      Objective-C comes free with GCC, so it basically runs on everything.

      Availability doesn't seem to matter....they're both mainly used on a small subset of devices, for a small subset of projects.

      --
      "First they came for the slanderers and i said nothing."
    8. Re:Pretty quickly by jcr · · Score: 4, Funny

      Yeah, can't really avoid that when you set out to emulate a Microsoft product...

      -jcr

      --
      The only title of honor that a tyrant can grant is "Enemy of the State."
    9. Re:Pretty quickly by mattack2 · · Score: 1

      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

      Since a Mac != a phone, you are BY DEFINITION already writing Swift cross-system.

    10. Re:Pretty quickly by shoor · · Score: 1

      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.

      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.

      --
      In theory, theory and practice are the same; in practice they're different. (Yogi Berra & A. Einstein)
    11. Re:Pretty quickly by SuperKendall · · Score: 1

      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...

      --
      "There is more worth loving than we have strength to love." - Brian Jay Stanley
    12. Re:Pretty quickly by phantomfive · · Score: 1

      Cool thx

      --
      "First they came for the slanderers and i said nothing."
    13. Re:Pretty quickly by Pieroxy · · Score: 1

      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.

    14. Re: Pretty quickly by jhoger · · Score: 1

      Why would you run IIS on Mono?

    15. Re:Pretty quickly by DrXym · · Score: 2

      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 to that. And of course Microsoft can lead the platform wherever they like and have demonstrated that all too often.

      That said, Mono has proven itself useful in one niche - the Unity toolkit uses the mono runtime as its scripting framework. It succeeds here because Unity is its own closed little world with its own APIs so it doesn't have to care about supporting some random assembly or esoteric feature.

    16. Re:Pretty quickly by angel'o'sphere · · Score: 1

      There are third parties offering cross platt form Swift compilers: http://www.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.

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    17. Re:Pretty quickly by AmiMoJo · · Score: 1

      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 extremely slow for many years. GUI frameworks have got better now, just in time for mobile to come along and cause another rift between native desktop/mouse/keyboard and mobile/touch.

      --
      const int one = 65536; (Silvermoon, Texture.cs)
      SJW, n: "Someone I don't like, and by the way I'm a fuckwit" - AC
    18. Re:Pretty quickly by jittles · · Score: 1

      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.

    19. Re:Pretty quickly by mrchaotica · · Score: 1

      It's too bad, really; I like C# as a language but I wish the APIs weren't so Microsoft-centric.

      --

      "[Regarding the 'cloud,'] ownership was what made America different than Russia." -- Woz

    20. Re:Pretty quickly by Wovel · · Score: 1

      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...

    21. Re:Pretty quickly by Wovel · · Score: 1

      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..

    22. Re:Pretty quickly by Xabraxas · · Score: 1

      Mono's intention was never to be a conduit for running Microsoft apps. People trash Mono all the time because they don't understand that it is simply an open source implementation of the C# language with it's own hooks into GNOME, etc. There are some compatibility layers present but the project isn't centered around making MS apps work. It's about using the C# language in a Linux environment.

      --
      Time makes more converts than reason
    23. Re:Pretty quickly by luis_a_espinal · · Score: 1

      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).

      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.

    24. Re:Pretty quickly by maccodemonkey · · Score: 1

      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.

  2. Huh? by grub · · Score: 5, Funny


    I just finished a Flash animation course at ITT. Am I too late to the game?

    --
    Trolling is a art,
    1. Re:Huh? by Austerity+Empowers · · Score: 2

      ITT Slashdot.

      He literally finished his course In This Thread.

    2. Re:Huh? by Kjella · · Score: 1

      Yeah that is so last decade, you should look into Silverlight.

      --
      Live today, because you never know what tomorrow brings
    3. Re:Huh? by 140Mandak262Jamuna · · Score: 1

      Come on guys, For computer science, it is Kanpur and it has always been Kanpur.

      --
      sed -e 's/Chuck Norris/Rajnikant/g' joke > fact
    4. Re:Huh? by fyngyrz · · Score: 1

      African, or European?

      --
      I've fallen off your lawn, and I can't get up.
    5. Re:Huh? by darkain · · Score: 1

      "Animation" ...

      A couple hours later, a new flash exploit is publicized (see ./ homepage)

    6. Re:Huh? by Lisias · · Score: 1

      I just finished a Flash animation course at ITT. Am I too late to the game?

      Barrichello? It's you?

      --
      Lisias@Earth.SolarSystem.OrionArm.MilkyWay.Local.Virgo.Universe.org
  3. Which is better? by Locke2005 · · Score: 3, Interesting

    I'm not an iOS programmer, which generates more efficient executables?

    --
    I've abandoned my search for truth; now I'm just looking for some useful delusions.
    1. Re:Which is better? by HiThere · · Score: 1

      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.)

      --

      I think we've pushed this "anyone can grow up to be president" thing too far.
    2. Re:Which is better? by Dog-Cow · · 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.

    3. Re:Which is better? by Dog-Cow · · 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.

    4. Re:Which is better? by Dog-Cow · · Score: 1

      Debugging null pointer dereferences are ridiculously easy in Objective-C. Have you ever written any code that wasn't in BASIC?

    5. Re:Which is better? by jeremyp · · Score: 1

      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.

      --
      All I want is a secure system where it's easy to do anything I want. Is that too much to ask ~~ Randall Munroe
    6. Re:Which is better? by jeremyp · · Score: 2

      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 which is pretty good I think considering all the safety checking that Swift does that C does not do. A pure Objective-C version would not get close.

      --
      All I want is a secure system where it's easy to do anything I want. Is that too much to ask ~~ Randall Munroe
    7. Re:Which is better? by Dog-Cow · · Score: 1

      How could you possibly have any performance-critical code running a 6502 emulator on modern hardware?

    8. Re:Which is better? by flargleblarg · · Score: 1

      On mobile, everything is performance-critical these days.
      Think wattage, energy, battery, etc.

  4. How soon? by SensitiveMale · · Score: 4, Funny

    "How soon until Swift eclipses Objective-C entirely?"

    I'm guessing swiftly.

    1. Re:How soon? by __aaclcg7560 · · Score: 1

      I see what you did there.

      FTFY

    2. Re:How soon? by fyngyrz · · Score: 4, Funny

      I'm guessing swiftly.

      I don't think you're being objective about this.

      --
      I've fallen off your lawn, and I can't get up.
  5. Dice spam by grimmjeeper · · Score: 5, Insightful

    Ah, yes. Dice "insights" stating the obvious long after everyone else figured it out.

    1. Re:Dice spam by Virtucon · · Score: 1

      gotta shift them resumes. "We have Swift openings now!"

      --
      Harrison's Postulate - "For every action there is an equal and opposite criticism"
    2. Re:Dice spam by Anonymous Coward · · Score: 1

      But you've got to have at least five years experience of using it.

    3. Re:Dice spam by fyngyrz · · Score: 2

      Sorry, five years experience required.

      --
      I've fallen off your lawn, and I can't get up.
    4. Re: Dice spam by fyngyrz · · Score: 1

      Doesn't apply if you have a green card anyway. Or if you just graduated college or are looking for an internship.

      --
      I've fallen off your lawn, and I can't get up.
  6. Objective - Steve is passe by Anonymous Coward · · Score: 1

    sad

  7. That was Swift... by __aaclcg7560 · · Score: 1

    But you sill need five years of experience to get called in for a job interview.

  8. Consider all efficiencies by SuperKendall · · 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.

    --
    "There is more worth loving than we have strength to love." - Brian Jay Stanley
  9. eating Crow by Anonymous Coward · · Score: 1

    as much as I hate to admit it,

    Congrats Apple, Good job..

  10. Apple wins by sanf780 · · Score: 1

    Whichever is more popular, they are mostly to write software for iOS. Apple is the clear winner.

  11. More of an issue about how bad Objective-C is by BenJeremy · · 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 languages that add little, if anything, to their corner of the programming world.

    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.

    1. Re:More of an issue about how bad Objective-C is by Anonymous Coward · · 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?

    2. Re:More of an issue about how bad Objective-C is by Kjella · · Score: 4, 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.

      --
      Live today, because you never know what tomorrow brings
    3. Re:More of an issue about how bad Objective-C is by metamatic · · Score: 3, 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?)

      --
      GCHQ Quantum Insert installed. If only our tongues were made of glass, how much more careful we would be when we speak
    4. Re:More of an issue about how bad Objective-C is by Chalnoth · · Score: 1

      Pretty much. Swift seems to be a good language, but largely unremarkable. I doubt it would have much of a chance of significant adoption if Objective-C wasn't so terrible.

  12. what a sec by iggymanz · · Score: 4, 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

    1. Re:what a sec by phantomfive · · Score: 3, Insightful

      Keep that in mind when you consider how accurate the Tiobe index is.

      --
      "First they came for the slanderers and i said nothing."
    2. Re:what a sec by Nahor · · Score: 3, 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.

  13. Sift is nice, but not great by Anonymous Coward · · 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 handling is still Janky as shit! You can't catch exceptions on functionality that isn't marked to throw exceptions (compiler error), so if one does come about you are 'effed and app crashes.
    * Generics are not really implemented. At least not in a way that you would expect if you came from...I don't know, any other language on earth.

  14. Not proprietary by SuperKendall · · Score: 1

    Swift is shortly to be released as open source, including the standard library (fixing something that kept GnuStep behind).

    --
    "There is more worth loving than we have strength to love." - Brian Jay Stanley
    1. Re:Not proprietary by Anonymous Coward · · 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.

    2. Re:Not proprietary by phantomfive · · Score: 4, Funny

      Sun controls Java.

      Hi there, Mr van Winkle!

      --
      "First they came for the slanderers and i said nothing."
    3. Re:Not proprietary by aaaaaaargh! · · Score: 1

      Cool, so it's gonna be like Dylan!!

  15. Netcraft confirms Objective-C is dying by JustAnotherOldGuy · · Score: 1

    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 in complete disarray, as fittingly exemplified by failing dead last in the recent Trendy Code Languages comprehensive networking test.

            You don't need to be the Amazing Kreskin to predict Objective-C's future. The hand writing is on the wall: Objective-C faces a bleak future. In fact there won't be any future at all for Objective-C because Objective-C is dying. Things are looking very bad for Objective-C. As many of us are already aware, Objective-C continues to lose market share. Red ink flows like a river of blood.

            Objective-C++++ is the most endangered of them all, having lost 93% of its core developers. The sudden and unpleasant departures of long time Objective-C developers Joe Whathisname Hubbard and Mike Theotherguy only serve to underscore the point more clearly. There can no longer be any doubt: Objective-C is dying.

            Let's keep to the facts and look at the numbers.

            Due to the troubles of Cupertino, abysmal sales and so on, Objective-C went out of business and was taken over by Apple who sell another troubled OS. Now Objective-C is dead, its corpse turned over to yet another charnel house.

            All major surveys show that Objective-C has steadily declined in market share. Objective-C is very sick and its long term survival prospects are very dim. If Objective-C is to survive at all it will be among dilettante code dabblers. Objective-C continues to decay. Nothing short of a miracle could save it at this point in time. For all practical purposes, Objective-C is dead.

    --
    Just cruising through this digital world at 33 1/3 rpm...
  16. No, it really is about Swift being a good language by SuperKendall · · Score: 4, 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.

    --
    "There is more worth loving than we have strength to love." - Brian Jay Stanley
  17. Not surprising by danbob999 · · Score: 1

    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

  18. Re:but does it compile linux? by frnic · · Score: 1

    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.

  19. consider garbage collection is garbage by Anonymous Coward · · 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.

    1. Re:consider garbage collection is garbage by jcr · · Score: 2

      When you don't know what you're talking about, it's best to stay anonymous.

      Apple's ARC memory management doesn't stop and run collection sweeps. This isn't an early 1980s LISP we're talking about.

      -jcr

      --
      The only title of honor that a tyrant can grant is "Enemy of the State."
    2. Re:consider garbage collection is garbage by Anonymous Coward · · 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 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. If using many third party libraries sounds like a good deal, then C and probably C++ are probably the wrong languages for the particular task.)

      But generally I would agree it's not really that big of a deal. As a general matter ARC provides much better latency. Heck, anybody who has used both an iPhone and an Android phone knows that. ARC is a good balance between automated GC and manual GC. The marginal benefit of automated GC with cycle detection is small, but the marginal cost is _huge_.

    3. Re:consider garbage collection is garbage by abies · · Score: 2

      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?

    4. Re:consider garbage collection is garbage by angel'o'sphere · · Score: 1

      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.

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    5. Re:consider garbage collection is garbage by jeremyp · · Score: 1

      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?

      --
      All I want is a secure system where it's easy to do anything I want. Is that too much to ask ~~ Randall Munroe
    6. Re:consider garbage collection is garbage by jeremyp · · Score: 1

      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.

      --
      All I want is a secure system where it's easy to do anything I want. Is that too much to ask ~~ Randall Munroe
    7. Re:consider garbage collection is garbage by aaaaaaargh! · · Score: 1

      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. :(

  20. Re:but does it compile linux? by fyngyrz · · Score: 1

    LLVM :)

    --
    I've fallen off your lawn, and I can't get up.
  21. Re:No, it really is about Swift being a good langu by fox1324 · · Score: 1

    This is the correct response. Swift is good because it makes it easy for the programmer to provide lots of type information to the compiler. Obj-C was/is also good, and has picked up all of these recent improvements, just with more verbosity.

  22. Re:cross-system languages by hackwrench · · Score: 1

    http://www.qb64.net/ can write programs for Windows, Linux, Mac, and to some extent Android, but that got added last.

  23. Re:No, it really is about Swift being a good langu by Chalnoth · · Score: 1

    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.

  24. MOV'n on up! by SouLShadow · · 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
       

    1. Re:MOV'n on up! by phantomfive · · Score: 1

      That's.....kind of weird. I'm not sure what to think of that.

      --
      "First they came for the slanderers and i said nothing."
    2. Re:MOV'n on up! by thoromyr · · Score: 1

      which just demonstrates how useful this "popularity" index is. Or is not...

  25. Re:null pointers, lol. Script kiddie detected! by Anonymous Coward · · 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() accepts a NULL pointer? I can't say for sure, but it sure makes bailing out of a constructor function because of an OOM or other intermediate error infinitely easier to code. All of my destructor functions always accept a NULL pointer, and it's pretty much the only place I need to check for a NULL pointer.

    Another trick to avoid NULL pointers that is occasionally useful is to use a singleton in-place of NULL. That way it can be accessed freely.

    Plus, conditionals are pipeline killers. The fewer conditionals in your code, the better. It's perhaps not a coincidence that well-designed code will tend to minimize conditionals by minimizing the number of possible program states.

    Using unsigned integers where possible is another example. You don't need to check for underflow, just overflow.

    And well-thought-out algorithms might not even need to check for overflow at all. Garbage-in is garbage-out. As long as use of the value doesn't cause trouble elsewhere in the program (like an out-of-bounds array index), I don't see why a program should report an error rather than return the garbage value to the caller.

    Along the same lines, I rarely if ever do input sanitizing. It's usually stupid. A bad PHP programmer, for example, will use htmlentities to escape a string, then pass it to system or popen. A smart programmer will use fork+exec directly, bypassing the shell completely, making htmlentities or other sanity checking completely unnecessary. Sanity checking is usually just a form of blacklisting, anyhow, which is not exactly the best way to write correct and secure software.

  26. Cannnibalizing Objective-C by CanadianMacFan · · Score: 1

    Of course Swift is cannibalizing Objective-C. Apple intended it to.

    1. Re:Cannnibalizing Objective-C by Barlo_Mung_42 · · Score: 1

      Obi-c fell 11, swift went up 4.
      There's more than cannibalization going on here.

    2. Re:Cannnibalizing Objective-C by LifesABeach · · Score: 1

      Objective-C loosely followed C, OK, I could work with it. Swift is still obviously maturing. Is Apple menopausal?

    3. Re:Cannnibalizing Objective-C by flargleblarg · · Score: 1

      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.

  27. Re:No, it really is about Swift being a good langu by clickety6 · · Score: 1

    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? ;)

    --
    ----------------------------------- My Other Sig Is Hilarious -----------------------------------
  28. Bottom Line by LifesABeach · · Score: 1

    ignoring try/catch/finally? So Apple thinks there are no unknowns during development? How simplistic.

  29. TIOBE Index? Honestly? by kafka0 · · Score: 1

    Even though it's pretty clear that Swift is indeed replacing Objective-C which was its, err, objective), who still gives any credit to the infamous TIOBE index?

  30. That's a big drop. Is the app-dev gold rush over? by fatalbert1 · · 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 Stackoverflow, it is very clearly wrong. As a former Perl/CPAN contributor it is sad to browse CPAN. It is akin to walking through the once mighty mines of moria. Astonishingly detailed and yet for the most part abandoned.

  31. Compiler needs a lot of work by cerberusss · · Score: 1

    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 mogenerator and Core Data (for those not in the know, it's a object layer on top of an SQLite database, and mogenerator generates two class files for every table), our last project ran into about 200 class files. Compiling took minutes.

    Things have gotten better. Especially if you're able to put parts of your projects in modules, it's really much better. But still I feel the Swift compiler requires a speedy quad core CPU. If you can afford it, get whatever top of the line quad core Apple offers.

    --
    8 of 13 people found this answer helpful. Did you?
  32. Re:No, it really is about Swift being a good langu by flargleblarg · · Score: 1

    Objective-C is actually a very good language.

    FTFY