Slashdot Mirror


Swift Vs. Objective-C: Why the Future Favors Swift

snydeq writes: InfoWorld's Paul Solt argues that It's high time to make the switch to the more approachable, full-featured Swift for iOS and OS X app dev. He writes in Infoworld: "Programming languages don't die easily, but development shops that cling to fading paradigms do. If you're developing apps for mobile devices and you haven't investigated Swift, take note: Swift will not only supplant Objective-C when it comes to developing apps for the Mac, iPhone, iPad, Apple Watch, and devices to come, but it will also replace C for embedded programming on Apple platforms. Thanks to several key features, Swift has the potential to become the de-facto programming language for creating immersive, responsive, consumer-facing applications for years to come."

270 comments

  1. Uh... by EmeraldBot · · Score: 5, Insightful

    Since when is embedded programming associated with "immersive, responsive, consumer-facing applications"? I don't think Swift is going to replace C anytime soon in that department.

    --
    "Set a man a fire, he'll be warm for the rest of the night. Set a man afire, he'll be warm for the rest of his life."
    1. Re:Uh... by Entrope · · Score: 4, Insightful

      More to the point, who outside Apple develops embedded software for an Apple platform?

    2. Re:Uh... by ColdWetDog · · Score: 5, Funny

      The NSA.

      --
      Faster! Faster! Faster would be better!
    3. Re:Uh... by Guy+Harris · · Score: 2

      Since when is embedded programming associated with "immersive, responsive, consumer-facing applications"? I don't think Swift is going to replace C anytime soon in that department.

      It was not obvious from the summary what the heck was meant by "embedded programming". In TFA, in addition to the quoted paragraph, the word "embedded" is also used in "The ability to defer loading in a mobile app or an embedded app on Apple Watch will improve the perceived performance to the user.", "Swift provides the development community a direct way to influence a language that will be used to create apps, embedded systems (if Apple ever licenses an embedded framework and chip for third parties), and devices like the Apple Watch.", and "Ultimately, Swift is a more approachable full-featured programming language that will allow developers to not only build apps but also target embedded systems like the new lower-power Apple Watch for many years to come."

      So if he's referring to the Apple Watch, maybe. If he's not, I'm not sure what the heck he's referring to; "embedded systems (if Apple ever licenses an embedded framework and chip for third parties)" sounds like hand-waving. Is he expecting Apple to be pushing Darwin into the *ahem* Internet of Things or some such?

    4. Re:Uh... by grimmjeeper · · Score: 1

      Since when is embedded programming associated with "immersive, responsive, consumer-facing applications"? I don't think Swift is going to replace C anytime soon in that department.

      I think their idea of an "embedded system" is one where you "embed" an Apple product into it. And sure, by the strict definition you are embedding a computer in something. I'm sure there will be a market for such devices going forward. But that's really a very small corner of the embedded systems world.

      I doubt very much the author of the article has any real idea what a true embedded system really is.

    5. Re:Uh... by drewm19801927 · · Score: 1

      Yeah. I think the author considers smartphone apps to be "embedded". He also talked about making an entire iphone app as a way to teach someone about float vs. int...

    6. Re:Uh... by Anonymous Coward · · Score: 0

      Could be a subcontractor, but depending on how much apple wants to control them, they might (haaa haahaahahaahaaaa) have to use swift for programming. But yeah, for example i doubt AMD or Nvidia will start using swift just for apple.

    7. Re:Uh... by XxtraLarGe · · Score: 1

      The NSA.

      Literally laughed out loud. Good way to start the day! :-D

      --
      Taking guns away from the 99% gives the 1% 100% of the power.
    8. Re:Uh... by Anonymous Coward · · Score: 0

      The NSA is outside of Apple now?

    9. Re:Uh... by jythie · · Score: 1

      Given the author's proclamations and supporting facts, I doubt the author has much of a real idea of anything in computing outside their narrow niche.

    10. Re:Uh... by grimmjeeper · · Score: 1

      That's true of pretty much every computer professional I've ever worked with.

    11. Re:Uh... by Anonymous Coward · · Score: 0

      Anyone making a hardware add-on that requires a driver.

    12. Re:Uh... by jythie · · Score: 1

      Yeah, but self awareness varies ^_^

    13. Re:Uh... by grimmjeeper · · Score: 1

      I do count myself in with that "pretty much every computer professional" group. I know a lot within the niche I work in and a few things outside of that. And I do try to keep up with some things I find interesting. But there are huge swaths of the industry I have no real idea about. I think the only difference is that I don't try to pass myself off as an expert in parts of the field I don't know.

    14. Re:Uh... by Anonymous Coward · · Score: 0

      Spilt me single origin coffee when I red this.

  2. Unlikely by msobkow · · Score: 4, Insightful

    It is highly unlikely that Apple is going to rewrite all that GPL and BSD code at the heart of iOS with Swift. As long as those core projects are based on 'C', they'll stay in 'C'.

    --
    I do not fail; I succeed at finding out what does not work.
    1. Re:Unlikely by Anonymous Coward · · Score: 0, Interesting

      Back in the day, logic design done at the big companies was done using the big companies' proprietary HDL and proprietary tools so that it would be harder for the design to be stolen, tweaked slightly, and be reproduced by a competitor.

      If Apple does their system software in a proprietary language, one could apply the same thinking to argue that it would be harder to steal, tweaked slightly, and be reproduced by a competitor.

    2. Re:Unlikely by msobkow · · Score: 2

      You don't get it, do you? Apple lives on open source code that they didn't write.

      --
      I do not fail; I succeed at finding out what does not work.
    3. Re:Unlikely by msobkow · · Score: 1

      Why would you worry about someone "stealing" something you didn't create or pay for in the first place?

      --
      I do not fail; I succeed at finding out what does not work.
    4. Re:Unlikely by Trepidity · · Score: 5, Interesting

      I think a wholesale rewrite is unlikely, but I would guess that they are going to eventually do something about the GNU code they use. Apple doesn't like the GPLv3's patent clauses, so they have frozen all their imported GNU utilities at the latest GPLv2 version. Some of these are now getting quite old and not maintained upstream, so Apple has to handle even routine maintenance. They managed to transition off one big one by moving from gcc to clang/LLVM, but there is still a bunch of old GNU code shipped in the base system that I don't see them keeping forever. Now whether they rewrite it in Swift seems more questionable.

    5. Re:Unlikely by Anonymous Coward · · Score: 0

      Wow. One thing for sure is certain from your post. You're a douche.

    6. Re:Unlikely by mark-t · · Score: 2

      Because when it becomes acceptable to steal from somebody else, then one day it may become acceptable to steal from you.

    7. Re:Unlikely by msobkow · · Score: 1

      ...but it will also replace C...

      --
      I do not fail; I succeed at finding out what does not work.
    8. Re:Unlikely by MightyYar · · Score: 1

      And a lot that they did write. That's the beauty of open source - no need to reinvent the wheel, and returning your code means you don't have to maintain a fork.

      --
      W..w..W - Willy Waterloo washes Warren Wiggins who is washing Waldo Woo.
    9. Re: Unlikely by zaphirplane · · Score: 1

      Except it's not stealing and no is forced to contribute to BSD licenses projects. You and/GP are taking a moral stance by lying. What do you think about that.

    10. Re: Unlikely by Anonymous Coward · · Score: 0

      Goes to the kind of society in which one wants to live, respecting the work done by others. It's not stealing if author or license gives you the right but many works don't give you that right (music, movies, proprietary software) yet many don't respect that.

    11. Re:Unlikely by Feral+Nerd · · Score: 3, Insightful

      It is highly unlikely that Apple is going to rewrite all that GPL and BSD code at the heart of iOS with Swift. As long as those core projects are based on 'C', they'll stay in 'C'.

      Precisely, that's what wrapper code has been for since I started coding back in the early 90s. It always cracks me up when people let fly gold nuggets like "...the Python implementation of OpenCV...". As far as I am aware, nobody rewrote all of OpenCV in Python, they created Python bindings which is a fancy way of saying they created a Python wrapper for OpenCV. Programmers don't always realise that the API's they are using are actually wrappers. I used to use a C++ Linear Algebra library but because I just installed it with yum or apt-get I didn't pay it much thought. it wasn't until I tried to compile it for an embedded computer that I realised the thing was actually a wrapper for a Fortran 77 library that was ported to Fortran 90 and then given a C++ wrapper and that made it a bit of a bitch to compile (largely due to the fact that I didn't know squat about Fortran). Apple will provide Swift wrappers for at least some of the C/C++ libraries and the ObjC stuff if that's necessary (never used Swift myself so I don't know how well ObjC libraries integrate into Swift). Any other approach would have Apple's developers busy doing nothing but rewriting and debugging ported code for the next decade at least. What interests me is how far up shit creek will a developer be if he/she realises that they need a C/C++/ObjC library for his Swift application?

    12. Re:Unlikely by jythie · · Score: 1

      I keep hoping there will be a resurgence in GLPv2 development. While Apple is a high profile example, companies that work with embedded software have generally not been happy with what many feel were changes singling them out while not putting the same burden on other GPL users, kinda like sacrificial goats. The politics behind GPLv3 and who's needs it prioritized left a bad taste in some people's mouths.

    13. Re: Unlikely by mark-t · · Score: 1

      Taking someone's stuff without their permission is still considered theft, whether or not the person it was taken from will ever notice that it is missing, and whether or not the person that takes it sincerely believes that what they actually took is, or at least ought be (and in so doing, making a moral evaluation on their part) considered to be valueless, perhaps on the allegation that it's "just digital", or "it has no physical component to it", for instance. Asserting that it is not stealing is really just a perpetuation of a myth started by people who typically practice such behaviors to convince others, or maybe even themselves that they never really did anything wrong. Since you are regurgitating this baseless rationalization, from where I'm standing it looks like they succeeded with you.

    14. Re: Unlikely by zaphirplane · · Score: 1

      I missed a comment, thought it was about apple "stealing" by using BSD licensed code , my bad

    15. Re:Unlikely by Anonymous Coward · · Score: 0

      Same with quite a lot of the C/C++ numerical libraries out there. QuadPack's a nice example - it's written in (clean, but still archaic) Fortran77, and any of the C and C++ versions of the library you find are just wrappers around it. Or there are cases such as the GSL, where quite a few of the routines are simply copied from pre-existing F77 and minimally modified into C.

      I've got the advantage over you of having programmed Fortran since 2002 and C++ since 2000 (although I'm doing less and less Fortran these days and when I do it's in F95 or F08; I've bundled what I don't want to actually reimplement into libraries and I'm calling C++ wrappers). I do have the issue though that I know pretty much squat about C beyond "duh well I don't build a class, right?" and end up trying to write something that's effectively C++ written F77 style. And then give up and do it in C++ instead.

    16. Re:Unlikely by Anonymous Coward · · Score: 0

      Was this library BLAS/LAPACK, by any chance? We might have had the same issue crop up, and there is something similar that goes on when you use SciPy/NumPy in Python.

    17. Re:Unlikely by Yaztromo · · Score: 1

      What interests me is how far up shit creek will a developer be if he/she realises that they need a C/C++/ObjC library for his Swift application?

      Not far up at all. Swift and Objective-C can easily call each other (Using Swift with Cocoa and Objective-C). This isn't particularly difficult, as in Objective-C you can use very easy reflection against classes to do fancy things like key-value coding, grab methods by name, etc.

      Swift also has full C access support, with specialized types to map to standard C types. I'm not sure about C++, however it should be easy to add an Objective-C++ wrapper around it if there isn't some other way to do it (hopefully someone who has worked in Swift can jump in here -- I'm just looking at Swift right now, and haven't done any actual work in it yet).

      Yaz

    18. Re: Unlikely by david_thornley · · Score: 1

      Actually, it isn't considered theft in many ways, including by the law. Copyright infringement is not theft, and they have different legal structures.

      I've had stuff stolen from me on occasion. You know what really ticked me off? Losing the stuff. I didn't care about the thieves benefiting from it. I didn't even know them. That doesn't happen with copyright infringement.

      You fail to understand the reasons for this, and appear to prefer to morally castigate people who understand things better than you. Hint: it isn't that it's "just digital" or "it has no physical component".

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
    19. Re: Unlikely by mark-t · · Score: 1

      Copyright infringement is theft for the same reason that using your neighbor's cable to get cable in your house as well without paying for it is called cable theft, whether it's with or without your neighbor's permission. Either way, it's taking something that one does not have any legally recognized right to take.

    20. Re: Unlikely by david_thornley · · Score: 1

      Except that the law doesn't consider copyright infringement theft. Check it out. Do you have any reason for using the term improperly?

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
  3. On iOS platforms. by FireballX301 · · Score: 5, Insightful

    The future favors Swift only because Apple is going to phase out use of ObjC. That's it. Arguing about languages is silliness when Apple will likely force you into using Swift for iOS9 compatibility in the next 12 months.

    1. Re:On iOS platforms. by angel'o'sphere · · Score: 0

      Perhaps you should go back to school.

      Both Obj-C and Swift are programming languages.

      On the first glance no one knows which language you used to write a program / app in.

      How should Apple be able to force you to use one or the other?

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    2. Re:On iOS platforms. by Dog-Cow · · Score: 4, Insightful

      How should Apple be able to force you to use one or the other?

      should or could?

      Apple can easily do both.

      should: because Apple says so, and they control the App Store. Apple doesn't have to give a reason other than deprecation.

      could: compiled swift code looks different than objective-C code. It also links against the swift runtime and not the objective-C runtime. It's not hard to tell the difference.

    3. Re:On iOS platforms. by exomondo · · Score: 1

      How should Apple be able to force you to use one or the other?

      Well you're going to have a hard time writing for iOS9 if the iOS9 SDK doesn't come with Objective-C bindings for the API. If they do that then practicality will dictate that you use Swift or a cross-platform language & toolchain. Sure you could create a wrapper for the SDK like some other cross-platform tools do but given that Objective-C is really only used for Apple's products it would seem pretty pointless and impractical.

      Yes you're right that they can't actually force you and you could go way out of your way to get around their recommendations but we're obviously talking about a practical sense.

    4. Re:On iOS platforms. by Anonymous Coward · · Score: 0

      Are you some bad attempt at being Ethanol-fueled?

    5. Re:On iOS platforms. by Kyogreex · · Score: 2

      I think you're missing the point FireballX301 is trying to make. It's not about the languages, it's about the tools. If Apple wants to move developers to Swift for whatever reason, there are ways they could enforce that to an extent by removing support for Objective-C within their tools. Sure, there may be third-party solutions that pop up (such as Xamarin with C#), but if Apple's tools don't support Objective-C code, I think that would effectively force quite a few developers to make the change.

      With that said, I doubt Apple is going to do that, at least not yet.

    6. Re:On iOS platforms. by Anonymous Coward · · Score: 0

      Just ignore the child. He just discovered he could type dirty words into the internet when his parents weren't home and is busy performing self fellation as he types words he barely understands.

    7. Re:On iOS platforms. by complete+loony · · Score: 1

      could: Because apple compile every app submitted to the app store from source code

      FTFY

      --
      09F91102 no, 455FE104 nope, F190A1E8 uh-uh, 7A5F8A09 that's not it, C87294CE no. Ah! 452F6E403CDF10714E41DFAA257D313F.
    8. Re:On iOS platforms. by Anonymous Coward · · Score: 0

      Dude, you're fucking awesome! "Spend all of your education on mule blowing and not C#".. "Kim Kardashian's ass will have an IPO"... gold, fucking gold..

    9. Re:On iOS platforms. by Anonymous Coward · · Score: 0

      Since when? Last I heard, they never even get a copy of the source code. Just a binary that they scan to make sure it's not accessing anything it shouldn't.

    10. Re:On iOS platforms. by Noah+Haders · · Score: 1

      Microsoft is going to deprecate C# in favor of blowing a mule. Spend all of your education on mule blowing and not C#.

      I have to admit, i lol'd a bit on this one.

    11. Re:On iOS platforms. by Anonymous Coward · · Score: 0

      I'd actually be impressed with the self-fellation.

    12. Re:On iOS platforms. by tnk1 · · Score: 1

      I'm just waiting for the IDE for mule blowing. Is the debugger any good?

    13. Re:On iOS platforms. by Anonymous Coward · · Score: 0

      Also they make *the* IDE for iOS and OSX development. If they killed the ObjC support the language would be dead in months.

    14. Re:On iOS platforms. by viperidaenz · · Score: 1

      So if they stop including the Objective-C runtime libraries in iOS, what happens to Objective-C code?

    15. Re:On iOS platforms. by BronsCon · · Score: 3, Interesting

      This oft-quoted line of complete bullshit is why people think iOS and Apple's walled garden is more secure than any other mobile platform. The reality is that Apple gets a binary to review, just like Google, Microsoft, or Blackberry. Apple and Google actually review the binaries, even; and Google even actually catches some nasties (I'm sure Apple does, as well, but they aren't as transparent about it) and prevents them from entering the Play store. Apple has pulled malware from the iOS store in the past, but has never made any official comment on it, unlike Google, which does leave one wondering... Knowing that malware authors likely submit to both platforms at the same rate, we know how often Google rejects or removes malware from their store (because they publish the statistics), one should expect that Apple's numbers are roughly the same, but are they? If anyone has a link to some official (e.g. from Apple) stats on that, I'd love to see them.

      --
      APK quotes people (including myself) without context and should not be trusted. Just thought you should know.
    16. Re:On iOS platforms. by Dog-Cow · · Score: 1

      Why would they do that? Preventing new app submissions (including updates to existing apps) from linking to the ObjC runtime is a lot different than not including the runtime with the OS.

      Also, someone else pointed out that even Swift apps link to the ObjC runtime. I don't know if that's true for pure Swift apps, but either way, it's extremely unlikely that Apple will stop including the runtime.

    17. Re:On iOS platforms. by Richard_at_work · · Score: 1

      Apple tried the whole "your app must be written natively for IOS in ObjC" before, specifically to kill off projects like Xamarin who were at the time doing a great job of allowing people to write iPhone and iPad apps in c# - the ban lasted a few months, before Apple decided the legal challenges it was facing weren't worth it and dropped the clause.

      The main way in which they will force use of Swift is by dropping ObjC library updates - Xamarin succeeded because there were people willing to develop a parallel ecosystem for developers, but will anyone bother to do that for ObjC?

    18. Re:On iOS platforms. by mridoni · · Score: 2

      How should Apple be able to force you to use one or the other?

      The same way they did when, under the old MacOS, they switched the preferred language from Pascal to C: all the documentation refers to the "new language" examples, all data structures are listed in the "new language" formats, some information needed for compatibility with the "old language" is omitted or brushed under the carpet, some data structures will favor the "new language" (e.g. C vs Pascal strings in system calls), etc.

      Of course it will take time but they can do it, no doubt about that.

    19. Re:On iOS platforms. by Half-pint+HAL · · Score: 1

      I'm just waiting for the IDE for mule blowing. Is the debugger any good?

      It had better be -- mules can carry some pretty nasty bugs down there....

      --
      Got them moderator blues I blieve I walk out the do', With these mod-points I been gettin', I 'most never post no mo'
    20. Re:On iOS platforms. by angel'o'sphere · · Score: 1

      For a Pascal programmer it does not matter that the "new data types" are documented in C style.

      Changing from Pascal to C strings only affected new APIs, the old ones kept the Pascal types until they finally got abandoned/deprecated.

      Same with Swift, who cares if the doku favours Swift? Everyone who can C/ObjC easily can interface with the Swift libraries.

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    21. Re:On iOS platforms. by angel'o'sphere · · Score: 1

      Tool support is ofc an interesting point. Did not think about that as I'm not really using the Apple Tool Chain.

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    22. Re:On iOS platforms. by angel'o'sphere · · Score: 1

      have a hard time writing for iOS9 if the iOS9 SDK doesn't come with Objective-C bindings for the API.
      The API is C/C++ ... very hard to not be able to call that from Obj-C

      The tools might be a problem, as they might in future only generate Swift code ...

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    23. Re:On iOS platforms. by jeremyp · · Score: 1

      Apple will likely force you into using Swift for iOS9 compatibility in the next 12 months.

      Nope. That is not going to happen unless they don't care about 95% of the apps on the app store not working on iOS 9. It's more likely that they will just not make new APIs available in Objective-C, so that Objective-C apps can't use the latest features.

      --
      All I want is a secure system where it's easy to do anything I want. Is that too much to ask ~~ Randall Munroe
    24. Re:On iOS platforms. by angel'o'sphere · · Score: 1

      Makes no sense.
      could: On iOS binaries are hard linked. Without a very careful inspection, you don't know if it is linked against a Swift runtime or an Objective C one. No one is going to do that, there is no point in it.

      should: Apple is long beyond the point to dictate the languages you use. There are plenty of JavaScript, LUA, Python and even SmallTalk Apps in the App Store.

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    25. Re:On iOS platforms. by Anonymous Coward · · Score: 0

      compiled swift code looks different than objective-C code. It also links against the swift runtime and not the objective-C runtime.

      Not true. Any Swift app that links against any Obj-C framework is going to include the Obj-C runtime. Until and unless Apple replaces Foundation, AppKit and UIKit with Swift frameworks, ALL Swift apps will depend on the Obj-C runtime.

    26. Re:On iOS platforms. by drinkypoo · · Score: 1

      Knowing that malware authors likely submit to both platforms at the same rate

      Ah, but do they? Both platforms are probably not equally easy to exploit, and both platforms probably do not provide equal returns. (Obligatory apple users easier to deceive yet wealthier comment here)

      --
      "You're right," Fisheye says. "I should have set it on 'whip' or 'chop.'"
    27. Re:On iOS platforms. by F.Ultra · · Score: 2

      It pretty much sucks

    28. Re:On iOS platforms. by BronsCon · · Score: 1

      Both platforms are probably not equally easy to exploit

      Consider that the vast majority of Android "malware" consists of games or toy apps that request every permission under the sun and the user has to agree to let that app have those permissions at install time. Now, consider that apps also request permissions on iOS but, rather than listing all the permissions they'll want at install time, they request them the first time they try to use them. It's a user decision in both cases.

      both platforms probably do not provide equal returns

      All you're likely to get from a phone, in any case, is a contact list, schedule (calendar), and some photos; you can grant full access to all of that on either platform. You can also send mail or text messages from an app on either platform, if the user grants those permissions. Android does allow full filesystem access (again, if granted by the user), but iOS also allows access to stored documents (including iCloud, so not just what's on your phone, which could potentially be worse). Neither platform allows system files, configuration, or application files to be overwritten unless rooted or jailbroken; and Android not only needs to be rooted, but also specifically configured to allow those behaviors and the app granted root access (which is not the default). I'm not positive about iOS but I don't recall seeing any way to manage root privs when I had my jailbroken 3Gs, which would make jailbroken iOS much more vulnerable than rooted Android.

      (Obligatory apple users easier to deceive yet wealthier comment here)

      I don't know about wealthier; as an Android user with a job, I've bought my unemployed wife her last 3 iPhones. As for easier to deceive, well, I wasn't gonna go there but... One of the two platforms is marketed to people who just don't want to have to give a shit about security. That's not an inherent flaw in the platform so much as it is a flaw in the marketing, though, and it's only the user's fault insofar as they tend to place entirely too much trust in a corporation that places profit over people. Google is no better in the latter regard, but at least they don't do the former; Android users (generally) have no illusions that their devices are any more or less secure than any other computing device.

      Android and iOS are both fine platforms. Neither is perfect, neither is as secure as we'd like, but they're the best we've got at this point. I do feel that iOS is somewhat hamstrung by Apple's policies (NFC finally comes to iPhone, but only for Apple Pay? Proprietary connector that brings nothing to the table but the ability to plug in both ways and a new licensing revenue stream for Apple? No, thank you). As a result, will never own another iPhone; I've been using NFC for more than just payments for a few years by now, and think it's great that almost every rechargeable device I buy now uses the same micro-USB cable. Even iOS accessories. It's great, it really is, if I ever find myself needing a charge while I'm out and about; everyone has the cables, everywhere, and they're so cheap and plentiful that people don't mind lending them; that doesn't seem to be the case when my wife's iPhone runs out of juice. Mind you, I love my iPad, but it also doesn't leave the house all that often, so charging is rarely an issue, and none of the other restrictions that bother me when talking about the iPhone (an always-on-me device) seem to apply, either.

      --
      APK quotes people (including myself) without context and should not be trusted. Just thought you should know.
    29. Re:On iOS platforms. by macs4all · · Score: 1

      The future favors Swift only because Apple is going to phase out use of ObjC. That's it. Arguing about languages is silliness when Apple will likely force you into using Swift for iOS9 compatibility in the next 12 months.

      MUCH longer than that.

      Look how long it took them to phase out CarbonLib. In fact, I don't think it's even REALLY gone, yet. Or how long it took them to excise all the 68k Code out of MacOS.

      It only looked fast when they transitioned from PPC to Intel because they were maintaining parallel builds for quite some time.

      Don't look for Obj-C to be shown the door anytime soon. They just spent a bunch of effort upgrading it a few years ago, didn't they?

      No, the future favors Swift because it is syntactically cleaner, and much easier to learn. Will it eventually replace Obj-C completely? Maybe. But not in less than about a decade.

    30. Re:On iOS platforms. by macs4all · · Score: 1

      Knowing that malware authors likely submit to both platforms at the same rate

      Ah, but do they? Both platforms are probably not equally easy to exploit, and both platforms probably do not provide equal returns. (Obligatory apple users easier to deceive yet wealthier comment here)

      Why would you think that Apple users are "Easier to deceive"? (Or "Wealthier", for that matter. I've been an Apple user since 1976; and I assure you, at NO time was in any danger of being "wealthy").

      But let's get back to the "Easier to Deceive" bit: Since iOS has MUCH finer-grained Permissions that Android, and Alerts the User when many things are attempted to be accessed, I would say that Apple Users (on iOS at least) are actually much LESS likely to be Deceived.

      And if you are talking about OS X Users, not only does GateKeeper and XProtect stop a lot of malware before it can execute, there are a metric buttload of other technologies built into the OS to inform and protect the User. So, I would say that Apple Users are among the least easy to Deceive, thanks to good OS Design in both the Desktop and Mobile arenas.

      And their nearly spotless track-record regarding malware on both OS X and iOS tends to support that conclusion.

      Period.

    31. Re:On iOS platforms. by macs4all · · Score: 1

      Proprietary connector that brings nothing to the table but the ability to plug in both ways and a new licensing revenue stream for Apple? No, thank you).

      After being one of the BILLIONS that have struggled with those fucking RIDICULOUS, fragile, one-directional micro (or is it mini?) USB connectors, I can't imagine ANYONE not heralding the directional-agnostic Lightning connector. Apple still had a "licensing revenue stream" on the 30-pin connector; so the switch to the 8-pin Lightning connector doesn't bring them any new "revenue stream".

      And if the micro (or is it mini?) USB connectors would vanish from the face of the Earth, it wouldn't be too soon for me. I absolutely LOATHE trying to figure out which of my "looks the same, but isn't" micro/mini USB to "standard" USB cable it takes to charge my camera, my keyboard in my iPad case, etc. etc. and THEN, playing the "Which way does it go?" game, all the while worrying that you're going to snap off/bend the male portion, or mess-up the female portion. You SAY they're ubiquitous; but they aren't.

      And I had a really fun time on a vacation trip about a year ago, because I didn't bring the right mini/micro USB cable for my camera. So, not only do you have to find someone who has a cable they will lend you; it has to be the right one. I'm an embedded designer and I can't reliably tell the mini from the micro USB at a glance. How do you expect the average Consumer to do so?

      So, just how is that better than the Lightning connector, of which there is exactly one type, that you can find just about everywhere (just like it's ancestor, the 30-pin dock connector)?

      No fucking thank you VERY much.

    32. Re:On iOS platforms. by exomondo · · Score: 1

      The API is C/C++ ... very hard to not be able to call that from Obj-C

      Or they only provide a swift API.

    33. Re:On iOS platforms. by angel'o'sphere · · Score: 1

      Something like an "Swift API" does not exist.

      Programming languages and the tools, linkers, OSes don't work that way.

      You can call any API from any language. You should have learned that in what ever CS course you have been.

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    34. Re:On iOS platforms. by viperidaenz · · Score: 1

      It's more code to maintain.
      Do you think Microsoft likes having to maintain backwards compatibility? Apple isn't forced by its customers to do so with iOS.

    35. Re:On iOS platforms. by exomondo · · Score: 1

      Something like an "Swift API" does not exist.

      Not yet, but it could. One that accepts swift structures and types.

      You can call any API from any language. You should have learned that in what ever CS course you have been.

      In order to do that from a practical perspective you need a layer that binds the native function calls to language-specific ones and marshals the data types and structures. If a C API function returns a pointer to an object you can't expect to just be able to call that function from a language that has no concept of pointers, you should have learned that in what ever CS course you have been.

    36. Re:On iOS platforms. by angel'o'sphere · · Score: 1

      Not yet, but it could. One that accepts swift structures and types.

      There is nothing special about "swift structures and types"

      If a C API function returns a pointer to an object you can't expect to just be able to call that function from a language that has no concept of pointers, you should have learned that in what ever CS course you have been.

      Actually stuff like that is not covered in CS courses, you would know that if you ever had taken one.
      Secondly: you are wrong. A language does not need first class citizen pointers to support pointers. E.g. in Java speak everything "pointing" to an object is a reference (that is the name in Java). Technically that reference is a pointer and if you call C from Java via JNI or JNA you simply pass that java "reference" and in the C world it is a "pointer".

      Of course you could "implement" references as something different as pointers, like in old Mac OS as they used so called "handles" which is a pointer to a pointer and allowed the memory management system to compact memory by shuffling around the second pointer in that row of pointers.

      With integrating Swift into C or C into Swift you just do the same thing.

      BTW, if you remember Pascal, then you might wonder what this is:

      TYPE
      T : RECORD
          i : INTEGER;
          f : FLOAT;
      END;

      PROCEDURE callMe(var arg : T) BEGIN .... some code
      END;

      Yes, that var arg : T is a pointer. That you might have learned in your CS course ;D.

      However ordinary pointers in Pascal (you did know that pascal has in fact Pointers?) are syntactically different.

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    37. Re:On iOS platforms. by exomondo · · Score: 1

      There is nothing special about "swift structures and types"

      Of course there is, there is no implicit cast from a T **, for example, to any Swift type, the appropriate explicit cast would be to a AutoreleasingUnsafeMutablePointer<Type>. Most basic types in C don't have an implicit Swift equivalent.

      Actually stuff like that is not covered in CS courses

      Perhaps not in whatever pedestrian one you've taken.

      Secondly: you are wrong. A language does not need first class citizen pointers to support pointers.

      No, it's not wrong at all. You need to marshal the pointer to an appropriate type, you've just proven that what I said was exactly right. But you probably don't know it, re-read what I've written, I didn't say you "can't" call an API from a different language, but that you need to marshal the relevant types and as such people are more likely to just use Swift than bothering to do that.

      It's pretty clear you don't even know what point you're trying to make and you're now arguing against something you've made up.

    38. Re:On iOS platforms. by Anonymous Coward · · Score: 0

      should: Apple is long beyond the point to dictate the languages you use. There are plenty of JavaScript, LUA, Python and even SmallTalk Apps in the App Store.

      Nope. There may be some apps like that which made it in to the app store, but I can state from experience that they are still using "Does not use a significant number of native iOS features" as reasons for rejecting apps.

    39. Re:On iOS platforms. by angel'o'sphere · · Score: 1

      Sorry, you are pretty mistaken.

      You only need to marshal relevant types if there is something to marshal.

      Not when there is a one to one relationship. And to not have a one to one relationship you deliberately need to break it.

      I suggest to read something like this: https://developer.apple.com/li...

      And then go back to compiler construction, especially code generation classes. You seem to be fond about those but seem to have missed something.

      You need to marshal the pointer to an appropriate type And why is that so, that you actually don't need to do that in C/C++/Java/Pascal?

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    40. Re:On iOS platforms. by exomondo · · Score: 1

      Ok you're obviously having too much difficulty understanding this so I will provide you an exercise:

      Suppose an API function is provided that returns a UnsafeMutablePointer<SomeClass>, now the SDK provides a Swift definition (an interface at the least) of "SomeClass" so I can manipulate its members, call functions on it or whatever. So now explain to me how you are going to manipulate this object in the language of your choice.

    41. Re:On iOS platforms. by BronsCon · · Score: 1

      Sadly, it's the "don't worry, your OS will keep you safe" mindset that makes iOS and OSX users easier to deceive. I say this as a user of both platforms, but also as a user who does not subscribe to that mindset.

      --
      APK quotes people (including myself) without context and should not be trusted. Just thought you should know.
    42. Re:On iOS platforms. by BronsCon · · Score: 1

      I'm sorry you can't tell the difference between the larger (and not used much on anything more recent than a PS3 controller) USB-mini and smaller (and user everywhere) USB-micro, but that's a you problem, not a USB problem. Remember, the opposite end of that lightning cable is USB, too; it used to crack me right the fuck up when I would hear someone claim that lightning was faster than USB.

      Furthermore, the lightning port is no more or less sturdy than USB-micro. Personally, I've never broken either port, despite having owned more USB-micro devices than I can count over the past decade, and a handful of lightning (read: iOS) devices since that port was released. In fact, I don't know anyone who's broken a USB-micro port (though I did knock one partially loose by dropping something heavy on it as it sat hanging off the edge of a table, something that would have done the same, or worse, to a lightning connector), but I do have a friend who snapped the lightning connector right out of her iPhone. This is in spite of the fact that I know more people who own more USB-micro devices.

      I'll concede that you may have better access to lightning cables within your circle of friends than I do within mine (despite my wife and two best friends being iPhone users and myself and my other best friend being iPad users), but that does not change the fact that a USB-micro cable can be had for $1 (literally from the dollar store) while a licensed (e.g. won't make iOS 8 devices complain and possibly refuse to charge) lightning cable can not. You surely could have purchased the correct cable while on your trip; even if you were broke, you could have found enough cash on the side of the road to buy the USB cable you needed, but I doubt you'd have been able to scrape together $5-10 that way for a lightning cable.

      Regarding the 30-pin connector, there were plenty of unlicensed 30-pin connectors out there, which Apple didn't make a penny on; that's why the lightning connector includes an authentication chip, the absence of which makes iOS 8 devices complain when an unlicensed cable or device is plugged in. That connector actually was stronger than USB-micro, on top of also being more capable (having analog audio/video and control pins, on top of USB and Firewire). It was a proprietary connector that actually brought something meaningful and useful to the table.

      Of course, then there's USB3, which neither the 30-pin nor lightning connector support. Plug either into a USB3 port and it falls back to USB2 speeds (another reason I laugh when I hear someone say lightning is faster than USB). USB-micro "A" doesn't support USB3 speeds either, but will plug into a USB-micro "B" (the wider one with extra pins) port and work with no issues. The design of the lightning connecter prevents that, which is why Apple recently adopted USB-C, rather than try and make that work. Expect the next round of iDevices after the iPhone 6s (which will, of course, feature the lightning port) to ship with USB-C. You know, because lightning is just so much better.

      --
      APK quotes people (including myself) without context and should not be trusted. Just thought you should know.
    43. Re:On iOS platforms. by macs4all · · Score: 1

      Sadly, it's the "don't worry, your OS will keep you safe" mindset that makes iOS and OSX users easier to deceive. I say this as a user of both platforms, but also as a user who does not subscribe to that mindset.

      I use Windows, OSX AND iOS every day, and have for decades.

      So, I know the difference between false security, like that afforded by third-party AV Suites, and the real, baked-in security that is only afforded by good OS design. Windows has gotten a lot better in this regard; but it is still much-more vulnerable than any other OS. But even on OSX and (less-so) on iOS, I don't treat my OS as invincible, nor do I think most OS X/iOS users, especially those with Windows experience, believe so, either. In fact, "switcher" users are actually the other way, (IMHO) too much...

    44. Re:On iOS platforms. by angel'o'sphere · · Score: 1

      Depends on the language binding, does it not?

      What is

      UnsafeMutablePointer<SomeClass>

      in Swift is
      SomeClass *

      in C.

      https://developer.apple.com/li...

      That was easy to google btw.

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    45. Re:On iOS platforms. by exomondo · · Score: 1

      You haven't completed the exercise: I said, modify it's members or call member functions on it. You have cast it to a pointer in C but it's just a chunk of memory. Are you seeing the problem yet?

    46. Re:On iOS platforms. by angel'o'sphere · · Score: 1

      Are you seeing the problem yet?

      There is no problem. Why don't you simply read a Swift manual?

      Swift code and C/Objective-C code can call each other without any problems.

      You can pass Swift "objects" to Objective-C functions/methods, you can extend a Swift class with Objective-C (inherit from it) and vice versa.

      I suggest to simply google for that.

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    47. Re:On iOS platforms. by exomondo · · Score: 1

      There is no problem.

      Of course there is, you don't have a C declaration of SomeClass, in C you don't know what that object is ... take it one step further in your "You can call any API from any language" and you're also not going to understand what SomeClass is in VBScript or C#.

      Swift code and C/Objective-C code can call each other without any problems.

      If you have the language-specific definition of what the object is, otherwise it is just a block of memory. This is really basic stuff, I gave you the exercise and you simply suggested casting it to a pointer to a type you have no definition for, so you failed.

      This is why you can't complete the exercise, casting the UnsafeMutablePointer<SomeClass> to a SomeClass * will not compile because you don't have a Obj-C or C declaration of SomeClass (be it a class, struct or whatever). This is really basic CS stuff, it's not that complicated so you really should educate yourself on this.

      Like I said, Apple can easily make it highly impractical to use another language with their API by not providing other language-specific declarations of their Swift structures.

    48. Re:On iOS platforms. by angel'o'sphere · · Score: 1

      Sorry, read a book about Swift.

      Your explanations are all wrong. And I'm tired about this discussion.

      This is why you can't complete the exercise, casting the UnsafeMutablePointer to a SomeClass * will not compile because you don't have a Obj-C or C declaration of SomeClass (be it a class, struct or whatever).

      Why do you think so? The Swift compiler generates a SomeClass.h file .... actually a no brainer.

      I even gave you a link where it is described, but I'm to lazy to search that link for you again.

      Like I said, Apple can easily make it highly impractical to use another language with their API by not providing other language-specific declarations of their Swift structures

      And that would be pointless as you simply can write the relevant header files yourself, I don't get why you argue about stuff like this.

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    49. Re:On iOS platforms. by exomondo · · Score: 1

      Why do you think so? The Swift compiler generates a SomeClass.h file .... actually a no brainer.

      Swift doesn't require them though, that exists as a legacy to support Objective-C, obviously if they are going to try to force people away from Objective-C then they will remove that, and - as I said at the start - it will make it harder since you will have to create relevant definitions for each language manually.

      Again - since you're really struggling with this - I never said you can't, I said they can make it harder to the point of being impractical.

      And that would be pointless as you simply can write the relevant header files yourself, I don't get why you argue about stuff like this.

      That's what I said from the beginning! I have said that all along. I never said you can't do it, I said they could make it impractical and having to "write the relevant header files yourself" is exactly that.

      You're tired of arguing with yourself because you're not reading, you keep arguing against points that I'm not even writing. Clearly it doesn't matter what I write because you aren't reading it anyway.

    50. Re:On iOS platforms. by angel'o'sphere · · Score: 1

      That's what I said from the beginning! I have said that all along.
      You where not saying that from beginning.

      You claimed special marshaling and unmarshaling code is necessary. While it is not. Swift and C are binary compatible, you only need a definition of the class suitable for the relevant compiler, be it C, Fortran, Pascal or Swift. There is no marshaling involved at all.

      Making "Swift binary incompatible" makes absolutely no sense, so while Apple could do that, they very certainly won't do that.

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    51. Re:On iOS platforms. by exomondo · · Score: 1

      You where not saying that from beginning.

      It's the first thing I wrote, your habit of making up things rather than reading what was written is getting pretty ridiculous:

      "Well you're going to have a hard time writing for iOS9 if the iOS9 SDK doesn't come with Objective-C bindings for the API. If they do that then practicality will dictate that you use Swift or a cross-platform language & toolchain."

      You claimed special marshaling and unmarshaling code is necessary.

      Which depends on the language you are working with, obviously. Remember how you said "You can call any API from any language"? Well depending on the language you may need marshaling code but in any case you need a language-specific definition of the objects you want to work with.

      Swift and C are binary compatible

      I don't see where I limited this to C, in fact not only are you making up things and claiming I said them but you can't even remember what you wrote!
      You can call any API from any language.

      Making "Swift binary incompatible" makes absolutely no sense, so while Apple could do that, they very certainly won't do that.

      Nobody suggested that at all, again you're making up something to argue with. Why are you now creating strawmen?

    52. Re:On iOS platforms. by angel'o'sphere · · Score: 1

      Should I go back and quote every line where you claimed: you can not simply call ObjectiveC/C from Swift because you need to have "special data structures" to marshal/unmarshal stuff?

      You seem to forget what you wrote :D

      Why are you now creating strawmen?
      I guess no one is. As usually we both got sidetracked in the discussion and emphasized different things.

      I emphasized that Swift and ObjectiveC are completely interoperable, while your very first posts tried to explain why they are not and how Apple could break that even more. I'm right and you are wrong in that regard.

      The other stuff you talk now about never was relevant for me.

      EMPHASIZE, I requote your quote:
      "Well you're going to have a hard time writing for iOS9 if the iOS9 SDK doesn't come with Objective-C bindings for the API.

      There is no Objective-C binding for Swift. As they are binary compatible there is no binding needed!

      This is the only discussion point I actually cared about, and which I tackled and you started to site track ... so if at all: you are the guy creating strawmen, but I rather assume you simply were site tracked.

      Now, go read a book about Swift, and I meanwhile doubt you grasp what marshaling does/is supposed to do and actually means. I would e.g. try to grasp what the difference is between "linking" and other ways of passing information is. Especially compare "in process" with "inter process" communication especially over networks or between storage systems and/or different hardware architectures. Most TCP/IP protocols might be interesting but you can also go on a higher level and think about CORBA or SOAP.

      Even if you have to bridge paradigms "in process" ... like embedding a JScript engine into a C program (e.g. using swig) then the terms coming to mind are: proxy, bridge, wrapper. Not marshaling.

      Ah, and regarding straw man: should I really go back and copy/paste all your programming exercises and claims that my quick solutions would be wrong? In all those exercises you tried to claim: a Swift structure can not be accessed from C/Objective-C with out "magic", while my point was: there is nothing special needed (perhaps I should have informed you earlier that XCode automatically generates a .h file for every Swift class, but as that was a no brainer I assumed you knew that. As Objective-C has more reflection support Swift does not need anything special for calling/using Objective-C stuff. However I would not wonder if the Swift compiler glances at the .h files of the Objective-C libraries as well)

      To summarize: my only point of argumentation is: your idea how different programming languages interact "in the same process", aka linked (either dynamic or static) and cross VM / runtime: is technically wrong.

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
  4. Don't go out on a limb, Paul by Anonymous Coward · · Score: 1

    The only reason anyone cared about Objective-C was for Apple development. Otherwise it would be as popular today as Delphi or Eiffel, for instance. Nothing wrong those object-oriented languages, just no particular business need for them.

    Now Apple wants to replace Objective-C with Swift. Apple is probably going to get what it wants with its own developer base, just like MS managed to "convince" its developer base to abandon VB-6 in favor of C#.

    1. Re:Don't go out on a limb, Paul by Anonymous Coward · · Score: 0

      There's a bloody good reason for replacing VB6 with C#, VB6 is utter shite.

    2. Re:Don't go out on a limb, Paul by narcc · · Score: 1

      Maybe. But VB developers were really inexpensive. If you found a good one, they were crazy productive as well.

    3. Re:Don't go out on a limb, Paul by ArhcAngel · · Score: 1

      It's a shame Delphi doesn't get the attention it deserves. It's an elegant, cross-platform environment.

      --
      "A person is smart. People are dumb, panicky dangerous animals and you know it." - K
    4. Re:Don't go out on a limb, Paul by Anonymous Coward · · Score: 0

      Productive does not mean effective.

    5. Re:Don't go out on a limb, Paul by Anonymous Coward · · Score: 0

      There's a bloody good reason for replacing VB6 with C#, VB6 is utter shite.

      And you've just given us the rationale for replacing Obj-C with Swift.

    6. Re:Don't go out on a limb, Paul by Man+On+Pink+Corner · · Score: 1

      Of course it does. If you're productive, and people are actually using your code, then you're effective.

      VB6 has enabled a lot of people to get a lot of useful stuff done. This is widely considered (on Slashdot at least) to be a Bad Thing.

    7. Re:Don't go out on a limb, Paul by Anonymous Coward · · Score: 0

      Oh c'mon, I mean "immersive, responsive, consumer-facing applications"... what executive/MBA isn't going to be immediately drawn to such amazing language like that? That's some damn fine marketing language there, Swift itself could be a steaming pile of horse dung and with 'marketspeak' like that they'll be pounding in the doors to get more of it!! That's the stuff promotions are made from.

    8. Re:Don't go out on a limb, Paul by Half-pint+HAL · · Score: 1

      Yeah, and the Czechoslavakians used to make plotters out of Meccano sets. (Well, "Merkur" brand, but essentially the same thing.) The point is that lots of people can do lots of cool things with the tools at hand, but if you gave them better tools, they'd be able to do soooo much more.

      --
      Got them moderator blues I blieve I walk out the do', With these mod-points I been gettin', I 'most never post no mo'
    9. Re:Don't go out on a limb, Paul by Gramie2 · · Score: 1

      Yes, but no one is going to adopt it when the base version (Delphi Architect, I don't count the lesser versions that don't even have client/server capabilities) is $2,500 with a mandatory $800/year subscription ($4,300 and $1,500 respectively for the cross-platform RAD studio). Oh, the subscription is not mandatory, but you literally get no bug fixes or updates without it.

      And they have adopted a twice-yearly release cycle, so you have to upgrade every six months.

      I was a big Delphi booster (owned 5 versions over the years) but they lost me with the above insanity.

  5. As an OS X/iOS dev who has used Swift... by goosesensor · · Score: 2

    I donno. "development shops that cling to fading paradigms do [die]." Obj-C is a perfectly good tool. Fortran and COBAL as still used all over the place. The only way Obj-C dev shops are going to die is if Apple makes it so (and I have no doubt they will). But I think this fundamental argument is flawed if not downright wrong.

    1. Re:As an OS X/iOS dev who has used Swift... by _merlin · · Score: 2

      What's with the outbreak of people who can't spell COBOL? It's like kids are trying to sound older than they are by using jargon but completely screwing it up.

    2. Re:As an OS X/iOS dev who has used Swift... by Cro+Magnon · · Score: 1

      It could be worse. I've seen it spelled "KOBOL", probably by someone who's seen too much Battlestar Galactica.

      --
      Slow down, cowboy! It has been 4 hours since you last posted. You must wait another few hours.
    3. Re:As an OS X/iOS dev who has used Swift... by crunchy_one · · Score: 1

      Reminds me of the time a salesman came through and gave us a presentation for a COBOL optimizer (CAPEX, iirc). Everyplace in the script he was supposed to say "COBOL" he instead said "cobalt". Q&A was fun.

  6. Debate settled. We know the future! by Paradoks · · Score: 4, Funny

    It's nice that there's a programming language debate where the future has been entirely settled. Thanks infoworld!

    1. Re:Debate settled. We know the future! by Half-pint+HAL · · Score: 2

      There's a new version of Siri, coded in Swift, that answers your questions about the future. It was released next December.

      --
      Got them moderator blues I blieve I walk out the do', With these mod-points I been gettin', I 'most never post no mo'
    2. Re:Debate settled. We know the future! by knarfling · · Score: 1

      There's a new version of Siri, coded in Swift, that answers your questions about the future. It was released next December.

      A seminar debating the merits of time travel will be held last week. Seating is limited and tickets have been available in two weeks. Get yours yesterday!!

      --
      Great civilizations have lived and died on false theories. Don't mess up mine with a few facts.
  7. Swifties by Anonymous Coward · · Score: 1

    "There's no way to catch it!" cried Tom, with exceptional angst.

    1. Re:Swifties by Applehu+Akbar · · Score: 0

      "Are you in San Francisco Mensa?" asked Tom homogeneously.

  8. "More approachable" by etinin · · Score: 1

    You do not need a more approachable language for iOS core components. Sure, that may be good for people creating end-user applications. But people who won't learn C because it's too hard are not quite the kind of people you want working at the heart of your operating system.

    --
    "I decided I could write something better than everything out there in two weeks. And I was right." - Linus Torvalds
  9. Swift is destroying Rust. by Anonymous Coward · · Score: 0, Insightful

    The important thing to remember here is that Swift is absolutely destroying Rust.

    Rust has been nothing but hype so far. Many Ruby on Rails hipsters have rallied around it, but they haven't actually managed to produce anything useful with it.

    Anything that can be done using Rust can be done better by using C++.

    C, C++ and Go are the dominant languages on Linux. Rust has made no inroads here.

    C++ and C# are the dominant languages on Windows. Rust has made no inroads here.

    Now that Swift is seeing tremendous uptake within the iOS and OS X sphere of influence, Rust has even less of a chance than it had before.

    I think that Swift will be seen as the final nail in Rust's coffin. Swift has provided developers with productivity, while Rust has provided them with false hopes.

    We're seeing a convergence on exactly three languages: C++, C#, and Swift. Every other language is becoming a minor player compared to these Three Giants.

    1. Re:Swift is destroying Rust. by EmeraldBot · · Score: 3, Insightful

      The important thing to remember here is that Swift is absolutely destroying Rust.

      Rust has been nothing but hype so far. Many Ruby on Rails hipsters have rallied around it, but they haven't actually managed to produce anything useful with it.

      Anything that can be done using Rust can be done better by using C++.

      C, C++ and Go are the dominant languages on Linux. Rust has made no inroads here.

      C++ and C# are the dominant languages on Windows. Rust has made no inroads here.

      Now that Swift is seeing tremendous uptake within the iOS and OS X sphere of influence, Rust has even less of a chance than it had before.

      I think that Swift will be seen as the final nail in Rust's coffin. Swift has provided developers with productivity, while Rust has provided them with false hopes.

      We're seeing a convergence on exactly three languages: C++, C#, and Swift. Every other language is becoming a minor player compared to these Three Giants.

      According to the TIOBE Index, Java has more usage than all three of them put together. I'd hardly call it a "minor player".

      --
      "Set a man a fire, he'll be warm for the rest of the night. Set a man afire, he'll be warm for the rest of his life."
    2. Re:Swift is destroying Rust. by lucm · · Score: 4, Insightful

      We're seeing a convergence on exactly three languages: C++, C#, and Swift. Every other language is becoming a minor player compared to these Three Giants.

      Baghdad Bob, is that you?

      --
      lucm, indeed.
    3. Re:Swift is destroying Rust. by TWX · · Score: 4, Insightful

      I suppose it depends on what you want to do with it, and what you see Java's future as a wholly-owned subsidiary of Oracle is.

      I was studying programming in college when the hype for Java began. We were using C and C++. What was true then still holds true today, in that in C/C++ you can write operating systems and conventional programs, but in Java you are limited to conventional programs. Java has the theoretical interoperability feature between OSes and hardware platforms, but in practice there's a lot of customization to make programs actually do this, and if one has to write versions for several platforms, it's not a whole lot more burden to compile those and distribute binaries instead of Java runtimes.

      As for servers, I've always liked the mindset of putting as little as possible on the production server beyond what its job is. Hell, the idea of statically-compiling everything to allow one to eliminate libraries, let alone compilers on the production box, appeals in that if someone does break in there's a lot less they can do once on there. Java for server-side applications flies in the face of that, there are more general-purpose tools on the server rather than less.

      I'm aware that I'm not in the majority for this stuff, and I didn't make programming my profession anyway so perhaps even I should be taken with a grain of salt, but it seems like in this speed to push features we've taken steps backward in real system security, and we're being bitten in the ass by it with ever increasing frequency. The very choice of programming language appears to be fundamental to that.

      --
      Do not look into laser with remaining eye.
    4. Re:Swift is destroying Rust. by Anonymous Coward · · Score: 1

      Any study can be turned to favor whatever you want it to say.
      Want to see real number check out http://langpop.com/
      The funny thing is that in most every case C beats out C++, C#, and Swift (Which is so low it doesn't even show up.) So, I really have to wonder if your estimations really have any real world bearing. To make matters worse every single argument made for Swift by OP's linked article was made for Java, and C# once upon a time in fact every managed language seems to get that label until security experts beat it to death. (Also please note that security holes that are reported are often just a fraction of the actual security holes that exist. many are left unreported so that various companies can spy on each other and you while thinking they are the sole company with this ability. For many of these companies unpatched security holes are more valuable than 10lb gold bars.)

    5. Re:Swift is destroying Rust. by Anonymous Coward · · Score: 0

      man, what are you smoking? C++ is a major player as it has been and will continue to be for the foreseeable future. C# has it's niche, and that's it. For web programming I know python is huge, GO seems to have a large following and of course java EE is always there. Probably plenty of others since web dev is so fragmented.

      Swift....yeah. Never actually met anyone who programs in it as their primary language.

      Interesting thing is though, out of all 3 that you said, none of them are used for embedded. And when I say embedded, I mean microcontroller type embedded. That's all done in C. C++ has too much overhead. Now, if you're going to argue C that was compiled with a C++ compiler, then I might give you that, but C++ as in templated OO programming, yeah, you never see that in microcontrollers.

    6. Re:Swift is destroying Rust. by Gr8Apes · · Score: 1

      man, what are you smoking? ... Now, if you're going to argue C that was compiled with a C++ compiler,

      You better pass some of that.... C++ compiled with a C compiler after going through a transformation, sure.

      --
      The cesspool just got a check and balance.
    7. Re:Swift is destroying Rust. by Gr8Apes · · Score: 1

      You know, if RoR was ever more than a splash in the history of time, maybe someone would have cared more about Rust. Somehow, being "rusty" just doesn't seem to go with hipster, geek, ninja, or rockstar.

      --
      The cesspool just got a check and balance.
    8. Re:Swift is destroying Rust. by Dutch+Gun · · Score: 1

      Speaking of C++... I'm currently learning Objective-C rather than Swift. Why? Because all I want is a thin interop layer between my cross-platform C++ code (the bulk of my game engine and game code) and the operating system APIs. Objective-C can iterop with C or C++ fairly easily, while Swift can only interop with Objective-C.

      Frankly, I wish I could use Swift instead of Objective-C, whose syntax takes some real getting used to.

      --
      Irony: Agile development has too much intertia to be abandoned now.
    9. Re:Swift is destroying Rust. by Anonymous Coward · · Score: 0

      Modded you up. The Langpop site seems to have data that is much more in line with reality than the usual ones. You can generally tell a site is bs if COBOL and all the flavors are VB are missing. Most people might not like them, but they are certainly there.

    10. Re:Swift is destroying Rust. by viperidaenz · · Score: 2, Insightful

      There's a shit load more "conventional programs" than there are operation systems
      Java also solves your libraries and compile problem.

      Last project I worked on the build server was Windows 2008, my dev PC was Windows 8.1 and test and production ran Linux. I don't even think prod was x86.
      No cross-platform issues at all with ~ 100,000 lines of code.

    11. Re:Swift is destroying Rust. by Dog-Cow · · Score: 1

      Swift can also interop with C, but it's ugly.

    12. Re:Swift is destroying Rust. by goose-incarnated · · Score: 3, Insightful

      We're seeing a convergence on exactly three languages: C++, C#, and Swift. Every other language is becoming a minor player compared to these Three Giants.

      Wait, what? Swift is basically statistical noise at this point. "Dead" languages like ML and Pascal are higher in the tiobe index than swift is. It may become a force in the future but it's nowhere near that now.

      --
      I'm a minority race. Save your vitriol for white people.
    13. Re:Swift is destroying Rust. by Anonymous Coward · · Score: 0

      The important thing to remember here is that Swift is absolutely destroying Rust.

      Rust has been nothing but hype so far. Many Ruby on Rails hipsters have rallied around it, but they haven't actually managed to produce anything useful with it.

      Judging by the number of trolls who have rallied around the language, I'm beginning to think that the Rust crew must be doing something right.

    14. Re:Swift is destroying Rust. by Dutch+Gun · · Score: 1

      Really? Everything I dug up during research said you pretty much had to interop with Objective-C, since Swift classes are exported as Objective-C classes. I'm not doubting you, as I'm sure there's some horribly ugly way to do it, given that we're talking about C here.

      Still, for my purposes, it doesn't really matter that much. I'd still prefer a "clean" interop, since I'll be doing a lot of that.

      --
      Irony: Agile development has too much intertia to be abandoned now.
    15. Re:Swift is destroying Rust. by Anonymous Coward · · Score: 0

      What would you call Android if not an OS? Sure it's both Java and a Linux kernel, but much of the OS is Java

    16. Re:Swift is destroying Rust. by TheRaven64 · · Score: 1

      I'm not sure how they're aggregating the data, but some of their source data is very surprising. Apparently Objective-C is the most popular language on GitHub projects, yet way down the list for projects tracked by Ohloh (which, as I recall, has been called OpenHub for a while now, so I don't know how old their data is). I'd have expected GitHub to be fairly representative of open source projects in general, though I wonder how good both the GitHub and Ohloh results are at deduplication - I have several copies of exactly the same code on GitHub...

      --
      I am TheRaven on Soylent News
    17. Re:Swift is destroying Rust. by Anonymous Coward · · Score: 0

      Fortran will live forever!

    18. Re:Swift is destroying Rust. by Anonymous Coward · · Score: 1

      Hello 1990. Great to meet you again! Fun times when search-engines were called Lycos, Yahoo and Astavista, and granted nothing beyond basic weighted keyword search. The time of MUDs, not MMORPGS, "social media" and distributed grid computing.

      Fortunately, 25 years later the world moved on. While I applaud out-of-the-box thinking, you need to _first_ understand why companies ditched C and C++ from a value-based perspective. It's not that difficult: Java just don't provide a platform-agnostic runtime environment, but also pretty much the same development environment as well. If you do it correctly, you can be pretty sure what you've developed on is much the same as on production, at least in theory. This, even though the OS might be different! Sometimes it is, sometimes not. It's about the flexibility and the part where it "just works" (when you do it right).

      Remember DLL-hell? Incompatible dynamic libraries conflicting with your application, 3rd party libraries and even sometimes the OS itself? Lots of "fun" there, but not if you depend on developers to bring value-add to your portfolio. Static libraries might also work, but Java versioning solves most of these problems, at least when it's gotten as far as production. Simply, there's been enough investment in creating good general-purpose Java-libraries for the common good, that it has out-competed most everything else in the Enterprise-world. Often for simply lack of robust and scalable alternatives.

      Java has JEE, something that was sorely missing before Y2K. Now, you might argue it and its implementations has gotten fat, bloated and ugly over the years, but for Enterprise with lots of wads, it's _working_. One-off scripts and myriads of different programs doesn't work over the longer run (after years you learn this). There is a framework in place which makes deployment, scalability, monitoring, upgrade and support standardized, and not bastardized (requiring lots more folks and provides more flaws and re-work).

      Java has gardbage collection, the JVM should never crash, should secure certain hardware-based security attacks, can do dynamic optimization using the JIT, the list goes on and on.

      In 2015, C/C++ is great for OSes and unconventional programs requiring special access to the underlying hardware. For most everything else, there are simpler solutions and Java is the best for Enterprise.

      Pro tip: What do you, or the business/organization, actually need? Do you really "need" C/C++, or is there some underlying value that is really required?
      When you've found the value, what's the lowest cost to provide this value?
      Start to think business, instead of fancying technology.
      Or just have fun! (But do remember that's what you're doing :-)

    19. Re:Swift is destroying Rust. by Anonymous Coward · · Score: 1

      Java has the theoretical interoperability feature between OSes and hardware platforms, but in practice there's a lot of customization to make programs actually do this, and if one has to write versions for several platforms, it's not a whole lot more burden to compile those and distribute binaries instead of Java runtimes.

      Lol. You clearly never used Java. Our team develops large enterprise applications on Windows machines. All we have to do is export a WAR, deploy it on a Linux cluster running Tomcat/JBoss/Glassfish, and it works without further modifications.

    20. Re:Swift is destroying Rust. by Anonymous Coward · · Score: 0

      Yes, everyone knows that it's better to burn out than it is to Rust.

    21. Re:Swift is destroying Rust. by Anonymous Coward · · Score: 0

      Pascal's not dead. Delphi targets every major hardware platform using Object Pascal and up to 64 bit code too.

    22. Re:Swift is destroying Rust. by geoskd · · Score: 1

      According to the TIOBE Index [tiobe.com], Java has more usage than all three of them put together. I'd hardly call it a "minor player".

      As with all language comparisons, this one vastly undercounts C and to a lesser extent C++. Embedded systems design is almost exclusively done in C or C++ (so much so that almost all embedded design toolchains support C / C++ only ). As a result, jobs that are available for embedded system designers all require C / C++, but never explicitly state that fact because either you know C / C++ or you dont know embedded systems design.

      On a cycle by cycle basis, there are more lines of C code executed every second than all of the other languages put together.

      To demonstrate: your PC has about a half dozen processors in it for handling all kinds of complex tasks like disk drive read head alignment, GPU, Even some higher end peripherals like fancy keyboards will have a processor in them. All of those peripheral processors (and I mean ALL) are running C code. Your car has another half dozen processors, all of which are running C code. Your Cell phone has another two or three processors, all of them except the CPU are running C code exclusively. Unless its a windows phone, the majority of the CPU time is spent executing C code.

      --
      I wish I had a good sig, but all the good ones are copyrighted
    23. Re:Swift is destroying Rust. by goose-incarnated · · Score: 2

      Pascal's not dead. Delphi targets every major hardware platform using Object Pascal and up to 64 bit code too.

      In the tiobe list Pascal is listed separately from Delphi. Delphi is higher in ranking than pascal, which itself is higher in ranking than swift.

      --
      I'm a minority race. Save your vitriol for white people.
    24. Re:Swift is destroying Rust. by Feral+Nerd · · Score: 1

      We're seeing a convergence on exactly three languages: C++, C#, and Swift. Every other language is becoming a minor player compared to these Three Giants.

      ..."Dead" languages like ML and Pascal...

      Has Netcraft confirmed that?

    25. Re: Swift is destroying Rust. by senatorpjt · · Score: 1

      Even when running Java you're executing more C++, because that's what the JVM is written in.

    26. Re:Swift is destroying Rust. by Anonymous Coward · · Score: 0

      > According to the TIOBE Index [tiobe.com], Java has more usage than all three of them put together. I'd hardly call it a "minor player".

      I take it you mean it takes three times as long to do anything as the others?

    27. Re:Swift is destroying Rust. by jythie · · Score: 2

      Since when does Java not suffer from DLL hell? Maven tries to mitigate this, but does so about as elegantly as RPM....

    28. Re:Swift is destroying Rust. by jythie · · Score: 1

      "We do not know what the language of the future will look like, but it will be called FORTRAN"

    29. Re:Swift is destroying Rust. by jythie · · Score: 1

      Heh. I keep forgetting that people use Python for web development.

      Even setting asside that use, in scientific computing, you pretty much either use Python, Matlab, R, or FORTRAN, depending on the complexity of your non-equation needs.

    30. Re:Swift is destroying Rust. by jythie · · Score: 1

      Pascal was never alive in the first place.

    31. Re:Swift is destroying Rust. by ehynes · · Score: 2

      The numbers a langpop.com may be "real", but they're also old - the page was last updated on October 2013. Swift's failure to show up isn't because it's "so low", it's because Swift wasn't unveiled until June of 2014.

    32. Re:Swift is destroying Rust. by Anonymous Coward · · Score: 0

      , but in Java you are limited to conventional programs. Java has the theoretical interoperability feature between OSes and hardware platforms,

      That's not entirely true. When Java was first invented, it was meant to be embedded in things like cable boxes. That is, the JVM was meant to interface with hardware essentially making the JVM an operating system. The JVM has become a valuable platform for other, non-Java languages as well.

      If Microsoft can actually make .NET truly cross platform, then it might give Java a run for the money. Despite Microsoft's recent generosity, I can't imagine them letting go of something that might be profitable. Of course Oracle is doing what they can to kill Java anyway.

    33. Re:Swift is destroying Rust. by Daniel+Hoffmann · · Score: 1

      Well don't forget to set the character encoding to UTF-8 on the JVM while in windows or else your URL parameters will only accept ANSI characters when using servlets. By default the JVM uses the system character encoding if you do not set it (which in windows is ISO something) so you either have to manually set the JVM to UTF-8 or configure your application to handle that.

      That is just one thing that made my life annoying as a dev that needs to deploy to windows and linux. There are many more.

    34. Re:Swift is destroying Rust. by Anonymous Coward · · Score: 0

      Why would you ever use Java on Windows?

      Java runs better on Linux by a long shot.

      Meanwhile, Windows has vastly-superior .Net integration to the point that Java on Windows just looks like a sad joke. Like "sadder than .Net on Linux" sad, and that's saying something.

    35. Re:Swift is destroying Rust. by Anonymous Coward · · Score: 0

      You had a good point up until you started farting out C# references.

    36. Re:Swift is destroying Rust. by Anonymous Coward · · Score: 0

      Actually, much of the OS is C++.

    37. Re:Swift is destroying Rust. by Anonymous Coward · · Score: 0

      >If Microsoft can actually make .NET truly cross platform, then it might give Java a run for the money.

      LOL, the race ended a long time ago. That's like saying windows phone is going to give Android a run for its money. .NET and windows phone are dead.

    38. Re:Swift is destroying Rust. by Anonymous Coward · · Score: 0

      >I take it you mean it takes three times as long to do anything as the others?

      Only if you're incompetent.

    39. Re:Swift is destroying Rust. by Anonymous Coward · · Score: 0

      The tiobe Pascal rank is a mess IMHO. It is a mix of Delphi compatible Free Pascal and old, but extremely popular versions (mostly Turbo Pascal).

      My guess is that the Delphi rank should be higher, and the Pascal lower.

    40. Re:Swift is destroying Rust. by Anonymous Coward · · Score: 0

      You're arguing against Java for web servers? You need to take a long look at Python, it is 100 times slower and worse for the reasons you specify.

    41. Re: Swift is destroying Rust. by Anonymous Coward · · Score: 0

      Even when running Java you're executing more C++, because that's what the JVM is written in.

      Even when running C++ you're executing more Assembly/Machine Code, because that's what the machine understands.

    42. Re:Swift is destroying Rust. by Plumpaquatsch · · Score: 1

      Any study can be turned to favor whatever you want it to say. Want to see real number check out http://langpop.com/ The funny thing is that in most every case C beats out C++, C#, and Swift (Which is so low it doesn't even show up.)

      Gee, could there be a reason for that? "Last data update: Fri Oct 25 17:17:19 -0400 2013" - Maybe that?

      --
      Of course news about a fake are Fake News.
    43. Re:Swift is destroying Rust. by BasilBrush · · Score: 0

      >We're seeing a convergence on exactly three languages: C++, C#, and Swift.

      According to the TIOBE Index, Java has more usage than all three of them put together. I'd hardly call it a "minor player".

      Oops. Did you use Java to add those 3 numbers up and do the comparison?

    44. Re:Swift is destroying Rust. by Anonymous Coward · · Score: 0

      I wanted to say something similar but you beat me to it... FORTRAN, COBOL, C, Pascal, Perl, assembler - what more do you need. ...I know, if it ain't new it can't possibly do the job and there's always someone who thinks they can build that better mouse trap, I've yet to see one though.

    45. Re: Swift is destroying Rust. by Anonymous Coward · · Score: 0

      I use C++ templating all the time in embedded code. Claiming C++ has more overhead than C is an overgeneralization. C++ has more potential for misuse, but it also has more potential for compile time optimization. Also, on most embedded projects, language runtime overhead seems negligible compared to other things like frequent interrupts and excessive double precision math.

    46. Re:Swift is destroying Rust. by molarmass192 · · Score: 1

      Java has more usage than all three of them put together.

      Might want to double check your spelling or your math there.

      --

      Good people do not need laws to tell them to act responsibly, while bad people will find a way around the laws-Plato
    47. Re:Swift is destroying Rust. by __aaclcg7560 · · Score: 1

      Blaise Pascal was alive from 19 June 1623 to 19 August 1662.

      http://en.wikipedia.org/wiki/Blaise_Pascal/

    48. Re:Swift is destroying Rust. by macs4all · · Score: 1

      Swift....yeah. Never actually met anyone who programs in it as their primary language.

      Well, considering it isn't even a year old yet, I'm not really that surprised.

    49. Re:Swift is destroying Rust. by Anonymous Coward · · Score: 0

      You can always spot a shitty code monkey. They're the insecure worms that attack another language because they've threatened by it.

    50. Re:Swift is destroying Rust. by Anonymous Coward · · Score: 0

      I could assure you that .NET isn't dead, that it's widely used in business programming and that competence in .NET still provides more jobs in my company, for instance, than competence in C++ (let alone C), and that you're probably in some bubble, but unfortunately you'd probably just respond with an ad hominem attack and repeat that .NET is dead, even though it obviously isn't.

    51. Re:Swift is destroying Rust. by Anonymous Coward · · Score: 0

      (Parent AC). Well, that's what you get for decoding streams without explicitly specifying the encoding (i.e. what's recommended in the docs).
      But it's not such a big deal, since you have to configure the JVM anyway, because the default config severely limits memory. And this doesn't change anything in your compiled code.
      I had much more problems with PHP, which for example uses 32-bit ints under Windows and 64-bit ints under Linux, causing serious head scratching why the same code runs differently on those platforms.
      C/C++ can be even worse (wrt portability, they have their uses) since they are much closer to the bare metal and have many compilers/variants/versions.

    52. Re:Swift is destroying Rust. by the_arrow · · Score: 1

      C, C++ and Go are the dominant languages on Linux. Rust has made no inroads here.

      Wait what? How long have I been away? Nobody told me that Go is a dominant language on Linux, or anywhere for that matter.

      --
      / The Arrow
      "How lovely you are. So lovely in my straightjacket..." - Nny
    53. Re: Swift is destroying Rust. by vhogemann · · Score: 1

      You can solve this by hosting your own maven repo and targeting specific versions for your dependencies instead of "anything newer than x".

      Or you can move into the present and use Gradle instead. Or go back to ANT, or use GANT for a more pleasant experience... The list goes on forever.

      Point is: Yes, Maven sucks. But we have better alternatives now. Find another reason to dislike Java.

      --
      ---- You know how some doctors have the Messiah complex - they need to save the world? You've got the "Rubik's" complex
    54. Re: Swift is destroying Rust. by vhogemann · · Score: 1

      The JVM is written in Java. As it is the javac compiler and every other tool bundled within the JDK.

      --
      ---- You know how some doctors have the Messiah complex - they need to save the world? You've got the "Rubik's" complex
    55. Re: Swift is destroying Rust. by jythie · · Score: 1

      My point is that the problem still exists in Java, and just like other languages there are solutions, but none are complete and all fail if not used.

    56. Re:Swift is destroying Rust. by Keybounce · · Score: 1

      We are now correcting the errors of the past.

      Make way for "FOURTRAN".
      Now with proper spelling.

    57. Re:Swift is destroying Rust. by Anonymous Coward · · Score: 0

      The important thing to remember here is that Swift is absolutely destroying Rust.

      On a related note, oranges are absolutely destroying apples.

      Anyway, I couldn't give a fetid dingo's kidney which programming languages are more popular - learn a bunch & use the best fit for the job. Duh.

    58. Re:Swift is destroying Rust. by lsatenstein · · Score: 1

      You forgot python

      --
      Leslie Satenstein Montreal Quebec Canada
    59. Re:Swift is destroying Rust. by lsatenstein · · Score: 1

      I suppose it depends on what you want to do with it, and what you see Java's future as a wholly-owned subsidiary of Oracle is.

      I was studying programming in college when the hype for Java began. We were using C and C++. What was true then still holds true today, in that in C/C++ you can write operating systems and conventional programs, but in Java you are limited to conventional programs. Java has the theoretical interoperability feature between OSes and hardware platforms, but in practice there's a lot of customization to make programs actually do this, and if one has to write versions for several platforms, it's not a whole lot more burden to compile those and distribute binaries instead of Java runtimes.

        I second your opinion. When we had 1.44meg floppies, it was extremely important to have shared libraries. By now, 20 years later, we can have 8 terrabyte disks on our desktops, and 32gigs of ram. Yes, for shared system libraries (I/O, system calls, etc.) but statically bound libraries for the rest. If I upload a package and it is defective, I want to only remove that package, and retain the rest. I also want to isolate that package to certain directories. I suppose, that's what containers is about.

      As for servers, I've always liked the mindset of putting as little as possible on the production server beyond what its job is. Hell, the idea of statically-compiling everything to allow one to eliminate libraries, let alone compilers on the production box, appeals in that if someone does break in there's a lot less they can do once on there. Java for server-side applications flies in the face of that, there are more general-purpose tools on the server rather than less.

      I'm aware that I'm not in the majority for this stuff, and I didn't make programming my profession anyway so perhaps even I should be taken with a grain of salt, but it seems like in this speed to push features we've taken steps backward in real system security, and we're being bitten in the ass by it with ever increasing frequency. The very choice of programming language appears to be fundamental to that.

      --
      Leslie Satenstein Montreal Quebec Canada
  10. Objective-C was ahead of its time by jblues · · Score: 3, Funny

    Objective-C was ahead of its time. It uses messaging for communication between Objective-C, and using "the runtime" (a tiny virtual machine that is embedded into each executable) messages are resolved to a function pointer. Other compiled languages use static dispatch, vtable dispatch (allows overriding) or in-lining. However, messaging gives an advantage in that it affords features that are available in higher-level 'interpreted' or 'managed' languages:

    • * Object introspection - describe the methods and properties of an object
    • * Dynamic invocation - reflectively invoke methods of an object.
    • * Method interception - add or reroute methods for all instances or a single instance of an objection, optionally calling the original.

    The above features allow all kinds of useful things like Aspect Oriented Programming, instrumented objects at runtime (eg for object-relational-mapping), Cocoa's elegant property observers, etc. Another advantage is that Objective-C is close to the bare-metal so its very easy to take advantage of the above, while dropping back to raw C (or C++) as needed for performance tuning, which given the 95-5 rule is not too often.

    Contrast these dynamic features, with C++ which fills another niche. Now the industry has had 30 years to forget how useful these features are, so Swift uses static and vtable dispatch. Given a virtual machine, with just-in-time compilation this is no problem, but as a compiled language it means forfeiting the above. Swift allows the above if a class extends a Cocoa Foundation class, but this problems are:

    • * Developers are excited about writing 'pure' Swift.
    • * The advantage or dynamic dispatch is that it can be applied to any class. Now if Swift adds compile-time AOP, this will only work with code that you have the source for.
      • I'm surprised more people didn't raise concerns about this.

    --
    If it acquires resources on instantiation like a duck, then its a shared_ptr<Duck>
    1. Re:Objective-C was ahead of its time by angel'o'sphere · · Score: 1


      * Object introspection - describe the methods and properties of an object
      * Dynamic invocation - reflectively invoke methods of an object.
      * Method interception - add or reroute methods for all instances or a single instance of an objection, optionally calling the original.

      All that has nothing to do with "message passing".

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    2. Re:Objective-C was ahead of its time by Anonymous Coward · · Score: 0

      Ahead of its time and just a decade or so behind Smalltalk in this regard.

      It still amazes me how languages are still trying to catch up with what I was doing in Smalltalk 20 years ago and others had been doing in Smalltalk since the 70s.

      And, yes a lot of what Smalltalk did was predated by other languages.

    3. Re:Objective-C was ahead of its time by Anonymous Coward · · Score: 0

      yea, yea yea; Python has all of that and is scripting language too boot. Google screwed up. Instead of java, morphed into android, they should have use python with a gtk stack.

    4. Re:Objective-C was ahead of its time by jblues · · Score: 2

      * Object introspection - describe the methods and properties of an object * Dynamic invocation - reflectively invoke methods of an object. * Method interception - add or reroute methods for all instances or a single instance of an objection, optionally calling the original.

      All that has nothing to do with "message passing".

      You think so?

      Runtime method interception is supported in languages that use vtable style dispatch rather than messaging, only because these languages feature a virtual machine, and class-loader. Otherwise the function-pointers are compiled right in. It is not possible to perform method interception without evil. With Objective-C we can perform method swizzling - modify the lookup table to resolve methods to a function pointer) or isa swizzling - change the 'class', to a dynamically generated one, for a given instance at runtime. Cocoao's property observers use this. Its not possible without messaging. This is why AOP frameworks for C++ are compile time only.

      Object introspection & dynamic invocation : When methods are in-lined, statically dispatched or vtabled we can't reliably dynamically invoke a method. Even with the most flexible of these three, vtabling, we're still stripping the function name out so that its replaced with something like 'method[3]'. It doesn't have to be like this, but it is for C++ and Swift follows suit.

      --
      If it acquires resources on instantiation like a duck, then its a shared_ptr<Duck>
    5. Re:Objective-C was ahead of its time by jblues · · Score: 1

      Ahead of its time and just a decade or so behind Smalltalk in this regard.

      It still amazes me how languages are still trying to catch up with what I was doing in Smalltalk 20 years ago and others had been doing in Smalltalk since the 70s.

      And, yes a lot of what Smalltalk did was predated by other languages.

      Agree. Objective-C was most certainly based on SmallTalk. Though except for the message parsing, which can be considered a kind of interpreter, its compiled, and interoperable with C, which was its value proposition. It does seem that we're mostly just rehashing now, doesn't it.

      --
      If it acquires resources on instantiation like a duck, then its a shared_ptr<Duck>
    6. Re:Objective-C was ahead of its time by jblues · · Score: 2

      yea, yea yea; Python has all of that and is scripting language too boot. Google screwed up. Instead of java, morphed into android, they should have use python with a gtk stack.

      Python is great, but Java, by virtue of having a virtual machine can supports method reflection, method interception and dynamically generating new methods or instrumenting classes too, even though it uses vtable dispatch. Its still considered a 'late binding' language because the class-loader provides a hook-point, prior to emitting a just-in-time compiled class, the class loader can check for method interceptions and emit and instrumented one. . The catch is that Android's Dalvik platform introduces some quirks into this.

      --
      If it acquires resources on instantiation like a duck, then its a shared_ptr<Duck>
    7. Re:Objective-C was ahead of its time by jblues · · Score: 1

      It uses messaging for communication between Objective-C

      doh - I meant to write 'for communication between objects', ie method invocation.

      --
      If it acquires resources on instantiation like a duck, then its a shared_ptr<Duck>
    8. Re:Objective-C was ahead of its time by angel'o'sphere · · Score: 1

      You think so?
      Yes, I do.

      No idea what you want to say with the two paragraphs you "quote".

      They again have nothing to do with "message passing".

      The question if you can do "Reflection/Introspection" is answered by having meta data of the classes available and an API to query it.

      E.g. Java supports reflection and introspection and: does not use message passing!

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    9. Re:Objective-C was ahead of its time by jblues · · Score: 2

      E.g. Java supports reflection and introspection and: does not use message passing!

      Read my comment again. I said that Java supports method interception while still using vtable dispatch. The reason for this is that it has a virtual machine and class-loader, which provides another point of interception. Examples of this are:

      • * The hibernate library uses cglib, which is in turn uses asm, to provide managed objects. You write a plain-old Java object and hibernate instruments this at runtime.
      • * Spring uses cglib or the aspectJ weaver to provide AOP features, such as annotation-based declarative transaction management or security
      • (There is another in J2SE that provides interception called Java dynamic proxies, but this only works for interfaces.)

        The above techniques of method interception do not work in C++, which uses vtable dispatch, because there is no JVM and class-loader to provide an intercept point. Therefore when it comes to things like managed objects, the observer pattern, or other features that can benefit from runtime instrumentation, we can't have these, and the next best thing is compile-time instrumentation. Given that Apple replaced the runtime garbage collector, with compile-time ARC, we might see them continue to provide 'dynamic' features at compile-time.

        So dynamic method interception most certainly has everything to do with message passing - its how compiled-to-executable machine language languages achieve this

        When it comes to reflection, C++ strips out meta-data. There are libraries to work around this, but its not a language feature. And except for enumerating a classes properties, to enable tool support, Swift follows suit. So there is no list of a classes methods, and no dynamic invocation. Again, as I said, this part does not have to be this way, but C++ is like this, and Swift follow suit. So message passing is loosely related to reflection and dynamic invocation here, in that by default vtable dispatch strips out method meta-data.

      --
      If it acquires resources on instantiation like a duck, then its a shared_ptr<Duck>
    10. Re:Objective-C was ahead of its time by sribe · · Score: 1

      Ahead of its time and just a decade or so behind Smalltalk in this regard.

      Later than Smalltalk, but NOT behind. Smalltalk suffered the same problem that all other single-inheritance class libraries of the time did--hugely deep inheritance hierarchies, with arbitrary, thus hard-to-remember, ordering. With NextStep, that was not the case--the judicious use of delegates to break out functionality that clients could customize, somewhat similar to AOP, massively reduced the depth and complexity of the inheritance hierarchy, but without introducing the problems that multiple inheritance brings. So Objective-C started with a core of features taken directly from Smalltalk, but the end result was actually much cleaner in the big picture.

    11. Re:Objective-C was ahead of its time by angel'o'sphere · · Score: 1

      I don't need to read again what you write.

      Your basic idea what message passing is, what reflection is, what introspection is, what a virtual machine does and what method interception is: are all wrong.

      Vtable dispatch does not strip out meta data, how retarded is that idea? Sorry, I suggest to read some books about how message passing/dispatch, and "method" dispatch actually work.

      Nothing speaks agaisnt a vm-less, class loader less, vtable based, method dispatch WITH reflection and introspection.

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    12. Re:Objective-C was ahead of its time by jblues · · Score: 1

      Nothing speaks agaisnt a vm-less, class loader less, vtable based, method dispatch WITH reflection and introspection.

      Sigh. I agree with this, but point out that C++ and Swift don't provide these, and that vtable dispatch creates an array of method pointers, and unlike objective-c, does not preserving the method names. This information has to be added on separately. Java 1.0 didn't include reflection. Even if I was mistaken in this, there is no need to start making personal insults and calling this "retarded".

      Important (for you):I think you might be missing the point about method interception. Are you familiar with this concept? In Objective-C we call this method swizzling. You can either swizzling the look-up table for a method (modify all instances) or change the isa pointer for a class - modify a single instance.

      In the Objective-C community, swizzling is misunderstood to be a hack, but it affords all kinds of useful features, such as Cocoa's elegant property observers, Core Data managed objects and such.

      People also misunderstand that this has nothing to do with introspection and dynamic invocation. In Java we can do the following:

      • * Before a class is emitted from the class-loader, emit a run-time generated sub-class, where methods are proxied in the same way as above. Libraries like asm, cglib and javassist do this. Spring uses cglib to proxy concrete classes and provide AOP such as declarative transaction management and security. Hibernate uses it to provide 'managed objects'
      • Er, to emit a runtime generated sub-class of a class, just prior to it being loaded, does require a class-loader, which in turn requires a JVM. Many people outside the Java community don't relaize this, but it gives most of the benefits of Objective-C's (messaging) late binding, although it does not allow arbitrarily adding new methods to a class.

        I do know something about Java, having made some contributions to the framework that revolutionized enterprise development, and going on to teach it around the world. Later I created my own framework to help Objective-C developers implement a design pattern that is well understood among Java developers.

        I enjoy discussion, I'm open to being corrected if I make a mistake, but if you would like to revert to childish insults then I don't have time to participate. I'm interested in sharing my knowledge and learning new things.

      --
      If it acquires resources on instantiation like a duck, then its a shared_ptr<Duck>
    13. Re:Objective-C was ahead of its time by angel'o'sphere · · Score: 1

      My point is pretty simple:

      You originally claimed that method interception only works in "message passing" systems. I disagreed and explained why it is wrong.

      Now you are riding more and more on "method interception", which is in general terms called: aspect oriented programming

      As you point out that this is simply done in Java by load time weaving, obviously you agree now that "message passing" has nothing to do with it.

      But you might want to look at groovy and see how it is done there, as you don't need a class weaver/weaving class loader there.

      but point out that C++ [...] don't provide these, and that vtable dispatch creates an array of method pointers, and unlike objective-c, does not preserving the method names.
      That is wrong ;D
      Compile every class, or a set of classes into a DLL and you have the member function names and usually also the "properties" / "attributes" of every class accessible in the DLL and you have high level libraries to access any of them.
      Check the "load library" function, don't remember how it is exactly called.
      It is usually used in all applications that support third party plug ins.

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    14. Re:Objective-C was ahead of its time by jblues · · Score: 1

      You originally claimed that method interception only works in "message passing" systems. I disagreed and explained why it is wrong.

      I did not claim this at all. I claimed that without a virtual machine it can't be done with vtable dispatch, unless you use compile time weaving or evil.

      I then explained how Spring and Hibernate use byte-code generation (the cglib library) by hooking the class-loader to provide method interception. This is different than load-time weaving, which uses a JVM agent. Spring supports both, and both require a virtual machine in any case, which was my point.

      Further, my point was that although Swift supports messaging as an interop to Cocoa, 'pure' Swift uses inlining, static or vtable type dispatches. And without a virtual machine this means foregoing runtime instrumentation of classes. Its a drawback that deserves more attention.

      But you might want to look at groovy and see how it is done there, as you don't need a class weaver/weaving class loader there.

      That's right. As we have just discussed cglib, which is built on top of asm (confusing name - has nothing to do with assembly language) hooks the classloader, so that it looks for method interception rules and emits a runtime generate subclass. This is called byte-code generation. Another library for this is Javassist.

      I stand corrected on method symbols and static/vtable dispatch.

      --
      If it acquires resources on instantiation like a duck, then its a shared_ptr<Duck>
    15. Re:Objective-C was ahead of its time by angel'o'sphere · · Score: 1

      I claimed that without a virtual machine it can't be done with vtable dispatch,
      You simply can replace the pointer in the vtable and then call the original method.

      confusing name - has nothing to do with assembly language
      It is absolutely not confusing, java byte code is an assembly language for a VM, hence the tools manipulating it often have "asm" in the name.

      This is different than load-time weaving, which uses a JVM agent. Spring supports both, and both require a virtual machine in any case, which was my point.

      And that point is wrong. Swift is compiled to LLVM byte code in the end, you can manipulate that with class weavers as much as you want.
      There are Aspect Oriented add-ons for C++ on LLVM as well.

      You even could do it with plain C code / plain 86k assembly, but granted, it would be more complicated.

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    16. Re:Objective-C was ahead of its time by jblues · · Score: 1

      And that point is wrong. Swift is compiled to LLVM byte code in the end, you can manipulate that with class weavers as much as you want. There are Aspect Oriented add-ons for C++ on LLVM as well.

      That is compile-time weaving. For run-time instrumentation (or load-time weaving as its called in Java, because it hooks the classloader) we need a virtual machine.

      Furthermore, even if Java didn't have runtime instrumentation, compile-time weaving would work just about anywhere because libraries are shipped as byte code. With Swift its a limitation, because we can only weave libraries that we have the source or LLVM byte-code for.

      My point: vtable dispatch works pretty well for Java, but is a limitation in Swift. Its great that it supports both messaging and static dispatch, but I think it should've favored messaging and used static/vtable for performance tuning.

      --
      If it acquires resources on instantiation like a duck, then its a shared_ptr<Duck>
    17. Re:Objective-C was ahead of its time by angel'o'sphere · · Score: 1

      That is compile-time weaving. For run-time instrumentation (or load-time weaving as its called in Java, because it hooks the classloader) we need a virtual machine.
      That is incorrect.
      Bytecode only makes it platform independent.
      Ofc you can weave also on plain machine code.

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    18. Re:Objective-C was ahead of its time by jblues · · Score: 1

      Ofc you can weave also on plain machine code.

      I didn't consider this as I wasn't aware of any available solutions. Will have a look around to see what's out there.

      --
      If it acquires resources on instantiation like a duck, then its a shared_ptr<Duck>
    19. Re:Objective-C was ahead of its time by jblues · · Score: 1
      Found the following information on weaving machine code:

      Weaving in machine code

      • * strictly limits available AOP features
      • * has to be implemented on numerous platforms (obviously)

      Let's see if the dynamic features that we're used to in Cocoa become available for 'pure' Swift.

      --
      If it acquires resources on instantiation like a duck, then its a shared_ptr<Duck>
    20. Re:Objective-C was ahead of its time by angel'o'sphere · · Score: 1

      Yeah it is a shame that Swift right now not even has full grown reflection.

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
  11. What is Swift written in? by Areyoukiddingme · · Score: 5, Informative

    What is Swift written in?

    It is built with the LLVM compiler framework included in Xcode 6, and uses the Objective-C runtime...

    So... C. Ok, we're done here.

    No wait. One more thing. It's the Objective-C runtime. Which means Objective-C programs will just keep running, as they ever have.

    Swift and Objective-C code can be used in a single program, and by extension, C and C++ as well.

    The new language can't supplant the old one while the old one exists in the same environment. More to the point, compatibility with Objective-C, C, and C++ was an explicit design goal. So you can just pack up all the bullshit about taking over the world.

    1. Re:What is Swift written in? by Anonymous Coward · · Score: 0

      > nm /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift_static/macosx/libswiftRuntime.a | c++filt

      Runtime it in C++, talking to the Objective-C runtime.

      > nm /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc | c++filt

      Compiler is in C++ (no surprise here, it's llvm based)

    2. Re:What is Swift written in? by multimediavt · · Score: 1

      The new language can't supplant the old one while the old one exists in the same environment. More to the point, compatibility with Objective-C, C, and C++ was an explicit design goal. So you can just pack up all the bullshit about taking over the world.

      Thank you! I was scrolling through the comments and took a damn long time before I found someone else that had the same thought I did. All Swift seems to be is a higher-level abstraction of the same animal ... C If that's the case, C, C++ and Obj-C will still be around for a long time on the platform and Swift will just jump in the bus with them.

    3. Re:What is Swift written in? by T.E.D. · · Score: 1

      What is Swift written in?

      It is built with the LLVM compiler framework included in Xcode 6, and uses the Objective-C runtime...

      So... C. Ok, we're done here.

      That means nothing of the sort. LLVM is a compiler framework, whose back end contains rather a lot of machine language, and whose front end depends on the language being used. Most language front ends are self-hosted (written in themselves).

      Likewise, using the Objective-C runtime doesn't mean anything other than that it was a convenient runtime that already existed, and they know how to interface to it. If you can do that, your sources can be in any language you prefer.

      But most importantly, C fans seem to have gotten it in their collective heads that C is somehow the root of all language, from which all other programs must have ultimately sprung. This is complete and utter hogwash, and makes having a discussion with them really difficult. If such a thing exists, it is machine language, not C. Does that mean machine language is superior? Hell no. You just need it sometimes, but mostly to help build things that are better for humans to use.

    4. Re:What is Swift written in? by Anonymous Coward · · Score: 0

      But most importantly, C fans seem to have gotten it in their collective heads that C is somehow the root of all language, from which all other programs must have ultimately sprung. This is complete and utter hogwash, and makes having a discussion with them really difficult. If such a thing exists, it is machine language, not C. Does that mean machine language is superior? Hell no. You just need it sometimes, but mostly to help build things that are better for humans to use.

      I prefer to think of C as "portable assembly language".

    5. Re:What is Swift written in? by T.E.D. · · Score: 1

      I prefer to think of C as "portable assembly language".

      The problem with that is that it simply isn't. Take a look at the sources for any multiplatform project, and you'll see its chock full of platform-specific precompiler code sections. C is one of the *least* portable programming languages available.

      Where it does get similar is that the language provides a lot of features that are frankly too low-level for a programming language. For example, there's the "auto" and "register" keywords. Those are supposed to be for telling the compiler when to put variables into a register. Every modern C compiler *ignores* these keywords, as no human can hope to perform this optimization properly at the C source level on a modern processor. That's just one prominent example.

      So C is actually a non-portable non-assembly language.

    6. Re:What is Swift written in? by iluvcapra · · Score: 1

      One must always keep in mind that when the first guy called "C", "portable assembly language," he was saying it pejoratively.

      --
      Don't blame me, I voted for Baltar.
    7. Re:What is Swift written in? by david_thornley · · Score: 1

      The "auto" keyword was never used because it's completely unnecessary. If it isn't "static", it's "auto", and "auto" is the default. People wrote "auto" variables and functions all the time, and just didn't use the keyword. They used it so seldom that C++ was able to repurpose the keyword. It has nothing to do with optimizations.

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
  12. More approachable? by Dog-Cow · · Score: 2, Interesting

    I don't know how this idea started, but only a non-programmer could think Swift is more approachable than Objective-C. Swift is way more complicated and has more fundamentals that must be understood.

    let versus var
    optionals, including implicit and explicit binding
    differences between structs and classes (value versus reference)
    generics
    different ways of specifying parameters, including named and unnamed parameters
    property declarations, including a multitude of shortcuts

    The problem is, if you don't learn most of the syntax in all its variety, you'll have a hard time understanding any random code you come across. Learning by example helps make a language approachable.

    1. Re:More approachable? by Dog-Cow · · Score: 0

      Minor correction:

      optionals, including binding and implicit and explicit wrapping

    2. Re:More approachable? by Dog-Cow · · Score: 1

      Correction to the correction:

      unwrapping

      I didn't get much sleep.

    3. Re:More approachable? by MassacrE · · Score: 2

      I don't know how this idea started, but only a non-programmer could think Swift is more approachable than Objective-C. Swift is way more complicated and has more fundamentals that must be understood.

      let versus var

      const char* vs char* vs char const*
      NSInteger vs const NSInteger
      NSString vs NSMutableString

      optionals, including implicit and explicit binding

      NSInteger vs NSInteger*
      nil vs NULL vs NSNull

      differences between structs and classes (value versus reference)

      NSInteger vs NSColor

      generics

      vs not having generics :-)

      different ways of specifying parameters, including named and unnamed parameters

      vs:
      [NSString stringWithFormat: @"%@", value]
      [NSString initWithFormat: @"%@" arguments: va_arg]
      NSStringFromPoint(pt)

      property declarations, including a multitude of shortcuts

      vs
      @property(readwrite,copy) NSString* foo;

      The problem is, if you don't learn most of the syntax in all its variety, you'll have a hard time understanding any random code you come across. Learning by example helps make a language approachable.

      The problem is that you are judging a new language's learning difficulty by comparing it to a language you already know.

      That said, Swift is not solid enough to live there 100% yet. You have to understand both languages currently to really be efficient. Going forward, knowing both languages will just be a very desirable skill (but not essential).

    4. Re:More approachable? by Half-pint+HAL · · Score: 1

      I don't know how this idea started, but only a non-programmer could think Swift is more approachable than Objective-C. Swift is way more complicated and has more fundamentals that must be understood.

      let versus var

      Neither "var" nor "let" is more approachable to someone not already informed. Programmers know variables, mathematicians are familiar with the "let" convention.

      optionals, including implicit and explicit binding

      Optionals are actually pretty intuitive when you're not already in the programmer's mindset. Why can't we simply ask whether something is there or not? Many languages force you into all sorts of silly workarounds, including subtyping, flag management, or (lazy man's favourite) exception handler.s

      differences between structs and classes (value versus reference)

      There's never an easy answer to that one. Values are far more intuitive, but classes as values are never likely to work.

      --
      Got them moderator blues I blieve I walk out the do', With these mod-points I been gettin', I 'most never post no mo'
    5. Re:More approachable? by Anonymous Coward · · Score: 0

      NSInteger vs NSInteger*
      nil vs NULL vs NSNull

      you forgot Nil

    6. Re:More approachable? by Anonymous Coward · · Score: 0

      differences between structs and classes (value versus reference)

      Argh, seriously? There are major conceptual differences between structs and classes in most languages. If you don't know the difference then I guess you've never had to write anything that does data interchange between memory and file or between hosts on a network. Hint: structs allow you to specify layout, packing and alignment.

  13. Swift is not ready to replace ObjC by Anonymous Coward · · Score: 4, Insightful

    > 8. Swift supports dynamic libraries

    The swift runtime is a static library (written in C++11) and linked in every executable, everytime there's an update to swift (runtime) you need to recompile all your code (see Apple's swift blog, first entry). This is why swift cannot be used for system API / libraries, at least until they have a stable runtime that can made a dynamic lib (like Obj-C is). But it being C++, I don't know if that ever gonna happen.

    1. Re:Swift is not ready to replace ObjC by Smurf · · Score: 1

      The swift runtime is a static library (written in C++11)

      I had absolutely no idea that the Swift runtime was written in C++11. Can someone please provide a link to this, since the parent is an AC?

    2. Re:Swift is not ready to replace ObjC by Anonymous Coward · · Score: 0

      I have no link, just my own investigation,
      1-Find the switf runtime: find /Applications/Xcode.app -iname '*swift*runtime*'
        You'll find 3 : .../swift_static/iphoneos/libswiftRuntime.a, .../swift_static/iphonesimulator/libswiftRuntime.a, .../swift_static/macosx/libswiftRuntime.a
        no dylib, only static

      2- inspect one of those: nm /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift_static/macosx/libswiftRuntime.a
          You should probably pipe it through c++filt to demangle the C++ symbols.

      You'll find a mixed of C/C++/Obejctive-C++, but mostly C++.

    3. Re:Swift is not ready to replace ObjC by Dog-Cow · · Score: 1

      A significant, though perhaps still minor, portion of Cocoa Touch is also written in (Objective-)C++.

    4. Re:Swift is not ready to replace ObjC by jeremyp · · Score: 1

      Swift Blog July 11th 2014 entry.

      you can target back to OS X Mavericks or iOS 7 with that same app. This is possible because Xcode embeds a small Swift runtime library within your app’s bundle. Because the library is embedded, your app uses a consistent version of Swift that runs on past, present, and future OS releases.

      The embedded part is actually quite small and it's only there because the language is still evolving (and to allow apps to target the previous versions of OS X and iOS). The main reason it is necessary to do it like this is that the Swift ABI is not yet stable. When the ABI stabilises, Apple plans to incorporate the runtime into the OS (where it should be).

      --
      All I want is a secure system where it's easy to do anything I want. Is that too much to ask ~~ Randall Munroe
  14. I disagree by SuperKendall · · Score: 5, Insightful

    I've done Objective-C since before the release of the iOS App Store, and Swift almost full time since Apple released it last year...

    Some of the things you mention beginners do not have to use (generics, and struts for example). To keep things simple to start with, they could just use classes instead.

    I will agree that optionals might be a bit rough on the beginner - but perhaps not as starting from nothing, the concept of a bucket that holds a value instead of just using the value directly, would not be so foreign...

    You also mention different ways to specify params, and shortcuts - but I see those as a major plus. You can just pick a level of detail that makes sense to you and work with that, until you feel comfortable with reducing further the syntax you use.

    I think the function syntax is one of the cleanest and easiest styles to understand... I believe a few other languages have this form also, but in swift you just say something like "a function named takes in these params, and outputs those params" So it looks like:


    func myFunc (a:String, b:Int) -> (a:String, b:Int)

    it's just so balanced that you can have any number of things in or out.

    There are a few things I think make Objective-C less approachable.

    The separate header files, and the heavy modern use of private categories to define most internal properties confuse people as to where they need to define things.

    Simply more verbose syntax all over. I like verbosity myself, I love named parameters... you get that with Swift though with a lot fewer characters typing.

    Part of that extra syntax in ObjC is the shorthand to make arrays like @[] and @(value) to make NSNumbers... but in Swift Integer is treated the same as String, both are first class objects that you can do things with so it's more consistent. That in particular is I think a large benefit for newcomers.

    --
    "There is more worth loving than we have strength to love." - Brian Jay Stanley
    1. Re:I disagree by Anonymous Coward · · Score: 0

      Ugh. That function syntax might look ok for a couple short named variables, but it'll be super ugly for anything that users proper variable names and has more than a couple parameters. Where's the recommended break point? Some styles will have all parameters on one line and the returns on another. Another style will have each variable on it's own line regardless if it's a function argument or return value and it'll easy to accidentally overlook something. The styles for that are gonna be messy.

    2. Re:I disagree by Dog-Cow · · Score: 1

      I like syntactical shortcuts too. Apple has added many to Objective-C over the years, and I have welcomed all of them. However, there is still a single style. For any particular feature, there's one syntax that works. Contrast with Swift. Even if you learn only one style and stick with that until you're comfortable, it's hard to learn from others because code can be in so many different styles. If you hit a shortcut you're not familiar with, you hit an obstacle. By definition, a path with obstacles is not "approachable". Swift has a too many such obstacles, in my opinion.

      Your point about private categories is an issue of style, not syntax. If you learn about categories, you understand the syntax wherever you see it; it's always the same.

    3. Re:I disagree by sribe · · Score: 1

      Ugh. That function syntax might look ok for a couple short named variables, but it'll be super ugly for anything that users proper variable names and has more than a couple parameters. Where's the recommended break point? Some styles will have all parameters on one line and the returns on another. Another style will have each variable on it's own line regardless if it's a function argument or return value and it'll easy to accidentally overlook something. The styles for that are gonna be messy.

      How is that different from ANY possible alternative syntax???

    4. Re:I disagree by fluffernutter · · Score: 1

      I don't get it.. you don't need to type all those parameters twice do you?
      Not understanding why the string "(a:String, b:Int)" needs to be there twice. Is the second one for the return value? In which case a better example would be to use something different, like -> x:String?

      --
      Laws are rules for the court, but merely a bottom bar to hit for life. Think beyond laws in your actions always.
    5. Re:I disagree by SuperKendall · · Score: 1

      The second is for the return value, yes.

      Although you can absolutely name the return values something different, I just had in mind some optional transformative thing where you could use it or not and treat the data tuple the same way.

      --
      "There is more worth loving than we have strength to love." - Brian Jay Stanley
    6. Re:I disagree by SuperKendall · · Score: 1

      The recommended break point is as it is with any language - whatever is most readable.

      Sometimes that might be the return value being on the next line.

      Sometimes it might be each parameter on it's own line.

      I myself prefer to either have the whole thing on one line, or everything broken out per line if that will not fit. But I'll admit I let some longer methods sometimes wrap to two lines on the display (even though it's really one long line).

      --
      "There is more worth loving than we have strength to love." - Brian Jay Stanley
  15. I'll start using Swift by SpaghettiPattern · · Score: 2, Insightful

    I'll start adopting Swift as soon as it has an active community on most commercially interesting platforms. E.g. all UNIX derivatives, Windows, z/OS and Mac of course. When I have ample choice of programmers to hire. Not interested in technologies exclusively centered around one supplier.

    --

    I hadn't the slightest objection to his spending his time planning massacres for the bourgeoisie... (P.G. Wodehouse)
    1. Re:I'll start using Swift by Anonymous Coward · · Score: 0

      Gee, I wasn't aware that Objective-C had "an active community on most commercially interesting platforms. E.g. all UNIX derivatives, Windows, z/OS and Mac of course." You learn something new every day.

    2. Re:I'll start using Swift by Anonymous Coward · · Score: 0

      The thing that may be confusing you is that he probably isn't using Objective-C either.

      Which makes his comment make more sense as a standalone argument, but less when you consider this is an article about comparing the use of Objective-C to Swift.

    3. Re:I'll start using Swift by Anonymous Coward · · Score: 0

      Gee, I wasn't aware that Objective-C had "an active community on most commercially interesting platforms. E.g. all UNIX derivatives, Windows, z/OS and Mac of course." You learn something new every day.

      He didn't say it did. He said Swift didn't.

    4. Re:I'll start using Swift by Anonymous Coward · · Score: 0

      Why are you even in this conversation then?

  16. Replace C? by fozzy1015 · · Score: 2

    "Swift will not only supplant Objective-C when it comes to developing apps for the Mac, iPhone, iPad, Apple Watch, and devices to come, but it will also replace C for embedded programming on Apple platforms."

    Not if you want to write something that compiles on other platforms. With Android/iOS being based on Linux/BSD it could very well make sense to write the back end of your app in C/C++ and only then branch into a different language as required by the GUI framework and other required proprietary APIs you'll be using.

    1. Re:Replace C? by jblues · · Score: 1

      "Swift will not only supplant Objective-C when it comes to developing apps for the Mac, iPhone, iPad, Apple Watch, and devices to come, but it will also replace C for embedded programming on Apple platforms."

      Not if you want to write something that compiles on other platforms. With Android/iOS being based on Linux/BSD it could very well make sense to write the back end of your app in C/C++ and only then branch into a different language as required by the GUI framework and other required proprietary APIs you'll be using.

      We tried this. It turned out to be not much fun. (Thought maybe we weren't doing it right).

      • * When the kernel is C++, unless you write a native language interface, it exposes the developers to C++. Its difficult to find developers who are good at C++, Objective-C and Java. Even experienced developers can make mistakes with regards to memory management.
      • Threading is usually a big concern. In Objective-C/C/Swift tools like grand-central dispatch make this easy, however in C++ its p-threads. C++11 has threads, but this isn't supported by Android yet.
      • The native environment give you an API of libraries and a community of open-source projects to fill in the gaps. With C++ you have identify and source your own stack. Poco or boost. etc.

      Perhaps with something like Xamarin's Mono framework the above points are less of a concern. An interesting one is Apportable.com (part funded by Google, I believe) are offering 75% of the App written in Objective-C or Swift and then a native UI in ObjC/Swift or Java.

      --
      If it acquires resources on instantiation like a duck, then its a shared_ptr<Duck>
    2. Re:Replace C? by fozzy1015 · · Score: 1

      We tried this. It turned out to be not much fun. (Thought maybe we weren't doing it right).

      To be fair, my experience with this was taking a Windows/Mac OSX program written by predominately C++ programmers and porting it to iOS and Android. The C++ code was already well debugged.

      Threading is usually a big concern. In Objective-C/C/Swift tools like grand-central dispatch make this easy, however in C++ its p-threads. C++11 has threads, but this isn't supported by Android yet.

      The native environment give you an API of libraries and a community of open-source projects to fill in the gaps. With C++ you have identify and source your own stack. Poco or boost. etc.

      Boost assuredly. It's what has been incorporated into C++11 and makes up the bulk of its new features(e.g. you mentioned threading).

    3. Re:Replace C? by multimediavt · · Score: 1

      "Swift will not only supplant Objective-C when it comes to developing apps for the Mac, iPhone, iPad, Apple Watch, and devices to come, but it will also replace C for embedded programming on Apple platforms."

      Not if you want to write something that compiles on other platforms. With Android/iOS being based on Linux/BSD it could very well make sense to write the back end of your app in C/C++ and only then branch into a different language as required by the GUI framework and other required proprietary APIs you'll be using.

      I take it you've never written cross-platform code for MacOS? There's a lot of things like memory management, for one, that you'd want to use Obj-C for. By the time you've done all the "required proprietary API" changes, you'd have been better off just writing the whole thing in Obj-C. Not only would it save dev time, the end product would be a lot more stable and have better overall performance, but I guess it depends on what trade-offs you're willing to accept.

    4. Re:Replace C? by fozzy1015 · · Score: 1

      I take it you've never written cross-platform code for MacOS? There's a lot of things like memory management, for one, that you'd want to use Obj-C for. By the time you've done all the "required proprietary API" changes, you'd have been better off just writing the whole thing in Obj-C. Not only would it save dev time, the end product would be a lot more stable and have better overall performance, but I guess it depends on what trade-offs you're willing to accept.

      Cross platform Obj-C? You mean with GNUStep? I have never used it. Have only written Obj-C in Xcode. As far as memory management, C++ has smart pointers, including one that does reference counting. Why would the performance be better with Obj-C?

      Although my experience with Obj-C is more limited I find it more painful to use than C++.

    5. Re:Replace C? by Dog-Cow · · Score: 1

      I take it you've never worked on an app with a well-defined logic layer. Apple writes a lot of C++ themselves, and they're not concerned about portability beyond OS X and iOS.

  17. Sometimes I think Swift is Taylor made for ios. by Anonymous Coward · · Score: 0

    But then I shake shake shake it off.

  18. Good grief. by engineerErrant · · Score: 2

    FYI, I'm an iOS developer who uses a mix of languages, including Ob-C, every day. My coworkers and I met Swift with a mildly positive reaction - it's a decent, if imperfect, effort. It's not the second coming of Christ, but it definitely isn't a bad thing to try to modernize some of Ob-C's age-related shortcomings. The notion that we'd re-write code just to use it is utterly laughable, but we could certainly see ourselves using it to start a new app, or maybe at our next jobs.

    The OP, though, sounds like a marketing intern wrote it. To add a little historical perspective: our apps are a riotous mix of C and C++ (for Android portability) and Ob-C. We chose to do it this way, within the last 3 years, so this is not a legacy issue. Both C++ and Ob-C were, at one time, meant as "replacements" for C, and we know how that turned out.

    Swift may very well become the preferred language over Ob-C within, say, 5 years, for Apple-specific development. But the breathless "it'll replace C!" rhetoric is just silly. Over the coming decades, C will surely fade, but it will be replaced by other, newer, even more amazing tech, not just Swift.

  19. Subjects are worthless by Anonymous Coward · · Score: 0

    As a former ios app dev, swift is better than obj-c as obj-c is terrible. If you look in any obj-c book, they will compare obj-c to c++ in an attempt to show why its better. In every example I've seen, its not.

  20. Mature, third-party libraries... by jtara · · Score: 1

    So, mature, third-party, solid, stable, best-in-class, tried-and-true libraries that are the standard foolproof way to do "X" (choose from many "X"s) will all re-write themselves from C or C++ to Swift, and then keep themselves in sync with the mainline library, right?

    C and C++ will continue to be used in iOS apps for the same reasons that so many (of the better...) Android apps color outside of the approved Java lines and use C/C++ using the NDK.

  21. There's some of us who've seen this before... by mark-t · · Score: 3, Interesting

    And we know from experience that WHENEVER somebody uses terms like "language <XYZ> is the future", it is inevitably baseless speculation, and often rests on the false belief that some single programming language, or any single technology for that matter, can actually be the "best" one.

    Brooks said it best, There is No Silver Bullet

  22. You wanna Vegas that claim? by Tablizer · · Score: 2

    Predictions are like assholes; everybody has one.

  23. I don't agree by Anonymous Coward · · Score: 0

    In a world of programming for multiple platforms, a single vendor language has absolutely no applicability any more. Even Microsoft have realised this.
    Having tried Swift, I just don't think it compares favourably with choosing either C++ or C#. Even Microsoft now understands the need to have cross platform support for their development tools.
    Who wants to learn a language that exists for the benefit of the profit of a single greedy vendor, who happily takes a third of your revenue? Are you really that stupid?
    I don't get the comment about embedded development. I have never seen an embedded apple platform, and given the rise of Linux, I don't ever expect to.

  24. They do? by Anonymous Coward · · Score: 0

    "but development shops that cling to fading paradigms do"
    That is not my experience, the shops who jump on the train too soon usually do, however.

  25. Language wars joy by Anonymous Coward · · Score: 0

    The Language Wars - they seem to arise over and over again, like The Crusades.

    It's always somebody advocating for a new one (Swift?) or somebody defending a previous new one that ended-up only occupying a niche (Rust?) who launch these and their tiny little perspectives always prevent them from seeing the horizon and remembering how BIG the coding language world truly is; While C and C++ dwarf these obviously superior new languages, there are other huge language bases they are forgetting like COBOL and FORTRAN which, while ancient, are STILL far more popular than the newest ones.

    There's also my favorite one which ALWAYS trumps all of them: assembly language - which is the ONLY one that can be used to do ANYTHING and even create all the others (wink)

    1. Re:Language wars joy by jythie · · Score: 1

      I doubt we'll ever get away from language wars. Beyond touching on people's egos and world views, language wars are heavily linked to very real world concerns like industry direction, priority/visibility, and employability. They are a proxy for the anxiousness people have over their own professional futures.

    2. Re:Language wars joy by fgb · · Score: 1

      Bah! Real programmers don't need fancy crap like assemblers! They program directly in machine language ;-)

    3. Re:Language wars joy by dlingman · · Score: 1

      Lets not forget microcode - which is pretty much needed to make assembly work.

    4. Re:Language wars joy by Anonymous Coward · · Score: 0

      Let's also not forget that Fortran hasn't been called FORTRAN for a very long time indeed.

    5. Re:Language wars joy by macs4all · · Score: 1

      Lets not forget microcode - which is pretty much needed to make assembly work.

      Depends on the processor. Not all of them use Microcode. One example is the Motorola 6809. And I don't believe the 6502 is Microcoded, either.

  26. Separate specs and impls. are NOT a drawback by Anonymous Coward · · Score: 0

    I have nothing for or against Swift – but the article lost all credibility for me when it claimed that a big "advantage" for Swift was that it would eliminate the need for separation between specification (.h) and implementation (.c) files.

    For large, real-world projects, separation of specification and implementation (or "public declarations/members" and "private declarations/members") is crucial for keeping the complexity and maintainability of the code under control. Having a file that consists of (mostly) specification and another that consists of (mostly) implementation is a feature, not a drawback - it means developers who want to use a module's public interfaces don't need to wade through mountains of private implementation details just to browse through the public interfaces.

    Compared to that advantage, the disadvantage of having to repeat a function or member prototype twice (once in each file) is minor, especially given that the consistency of the two prototypes will be checked by the compilation toolchain.

  27. The Reality Distortion Field is gone by Anonymous Coward · · Score: 0

    Since Jobs' dead, Apple finds it more difficult to get away with this kind of stupid things.

    Now they only can rely on their market share size and their captive developers greed (or desperation to make a profit). Maybe they will succeed with this one, but I predict ZERO uptake of Swift outside (w)Oz Land. So, go ahead. If you want to go even deeper inside the rabbit hole Swift looks like a good option. The rest of us will be out there still doing C and C++ (and Python, and Java, and -God forbid- PHP).

  28. Swift or Dylan? by aaaaaaargh! · · Score: 1

    I just can't decide on which loosing horse I should all my money!

    Jokes aside, anyone who knows a little bit about the history of Apple should be careful not to put too much efforts in one of their 'projects'. At least develop the core of your applications in C or C++ and use the proprietary technology just for GUI glue code. Unless we're talking about another fart app that requires zero know-how and programming effort anyway.

    1. Re:Swift or Dylan? by Anonymous Coward · · Score: 0

      which loosing horse

      "losing". One "s".

  29. Get real.. by Anonymous Coward · · Score: 1

    The NSA does not code in SWIFT, they go straight for barebone assembly because that is the only way to address the secret built-in backdoors in the baseband processor of all those devices...

  30. No one cares about Rust .... by Anonymous Coward · · Score: 0

    really dude... no one ....

    1. Re:No one cares about Rust .... by Anonymous Coward · · Score: 0

      I do.

      Actually, in retrospect I really don't. Rust will end up in the pantheon of great Mozilla contributions such as Firefox OS and Firefox extensions that break after every browser update.

  31. Swift for the system programming? by ThePhilips · · Score: 2

    People keep bringing up the Swift in context of system programming, but so far I haven't seen any concrete info about features of the language which make it even suitable for the system programming.

    The thing is, even C++ was/is used for system programming, but its C++-ness is so castrated that it is hardly can be called C++ anymore.

    I personally do not see any reason to replace C with another language, which I can't use to its fullest. On top of it, lots of C extensions are needed to make the system development efficient: code/data section assignment, untyped/unchecked memory access, memory/IO barriers, assembler intrinsic. None of that is part of C standard - all of it are vendor/compiler extensions. While Swift documentation is devoid of the similar features.

    P.S. If Apple folks want to push the Swift into the embedded area... Good luck. Even C++ still struggles. Higher-end embedded system require proof of validity and literally all of the solver software is C-only. Most static/dynamic code analyzers - C-only too.

    --
    All hope abandon ye who enter here.
  32. Ha! Memory Leaks Impossible by laughingskeptic · · Score: 1

    "The huge memory leaks that a programmer can have in Objective-C are impossible in Swift". He clearly hasn't actually worked with Automatic Reference Counting (ARC) environments. What this really means is that the Apple shills promoting Swift don't see the need to create tools for finding memory leaks while simultaneously making memory management a black-box operation that is hard for the engineer to debug.

  33. Not surprising the future is swift by DrXym · · Score: 1

    You only have to look at Obj-C code snippets for trivial things like string concatenation to realise what a horrible experience it is. So it's no wonder that Swift is so popular given that it resembles more high level languages like Typescript, Ruby or Python. That said, it's still as proprietary as its predecessor. Nobody but OS X devs will want to touch it unless it becomes a cross platform tool.

  34. MACHINE AGE 2 by Anonymous Coward · · Score: 0

    It's the start of the 2nd machine age, and we need a new high level programming language that encorporates the 3 laws for all robotics, while enableing additional lws, but the three laws should always be included as the default for everything. They could be programatically turned off, but it would have to be intentional.

    No accidental robots doing things to harm humans.

    Think about it.

  35. Does it generate Android apps? by biodata · · Score: 1

    The future favours cross-platform apps

    --
    Korma: Good
  36. Comment removed by account_deleted · · Score: 1

    Comment removed based on user account deletion

  37. Not Necessarily by tmjva · · Score: 1

    If scripture has any bearing, time and chance happeneth to them all!

    --
    Tracy Johnson
    Old fashioned text games hosted below:
    http://empire.openmpe.com/
    BT
  38. Swift? by Anonymous Coward · · Score: 0

    Can Swift meet the performance of Obj C? Is it easier to use? Is there much of a learning curve? Does it save time? Is it it simpler?

  39. Why when I can code in C#? by rhyous · · Score: 1

    Why would I learn objective-c (which I already learned and loath) or Swift, when I can code in C#.

    Sure objective-C will be nice for a fast thin layer between a big game and the OS.
    Many consumer apps already exists.

    The big white space now is enterprise apps. You watch, C# is going to own the enterprise app market thanks to Visual Studio 2015, open source .NET, and Xamarin.

  40. Windows on Mac by Anonymous Coward · · Score: 0

    With CrossOver you can run MS Visual Basic programming applications on Mac and Linux, if you want to purchase CrossOver Mac or Linux use promo code ( WEAVEME ) and save 25% off the retail price!