Slashdot Mirror


Apple Announces New Programming Language Called Swift

jmcbain (1233044) writes "At WWDC 2014 today, Apple announced Swift, a new programming language. According to a report by Ars Technica: 'Swift seems to get rid of Objective C's reliance on defined pointers; instead, the compiler infers the variable type, just as many scripting languages do. ... The new language will rely on the automatic reference counting that Apple introduced to replace its garbage-collected version of Objective C. It will also be able to leverage the compiler technologies developed in LLVM for current development, such as autovectorization. ... Apple showed off a couple of cases where implementing the same algorithm in Swift provided a speedup of about 1.3X compared to the same code implemented in Objective C.'" Language basics, and a few worthwhile comments on LtU.

636 comments

  1. First Rhyme by Art3x · · Score: 4, Funny

    AAPL's YAPL

  2. Good bye source compatibility by ugen · · Score: 4, Interesting

    Good bye source compatibility. We hardly knew ye.
    First Windows, and now OSX. I am still maintaining applications that are built crossplatform (Windows/Mac/Linux, with unified GUI look) but it's getting harder every year and, by the looks of it, will be impossible soon.
    Which means that an individual developer (like myself) or a smaller shop would have to choose one big player/OS vendor and stick with it. That increases risk and makes small players that much less viable (while, of course, helping the big ones consolidate user base and profit).
    Funny how the world works.

    1. Re:Good bye source compatibility by nobdoor · · Score: 0

      My team has already stopped supporting Mavericks because it apparently does not support GDB. Creating GUI's in OSX is currently problematic because of font issues. With Chrome/Android OS's becoming more popular, I wonder whether this kind of move could a boon for Linux.

    2. Re:Good bye source compatibility by angel'o'sphere · · Score: 5, Insightful

      Since when does Qt not work X-platform anymore?

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    3. Re:Good bye source compatibility by danomatika · · Score: 1

      A C/C++ backend and platform-specific front ends aren't an option?

    4. Re:Good bye source compatibility by Lunix+Nutcase · · Score: 4, Insightful

      Why is this dumb post modded insightful? You can still use all the same languages you did before.

    5. Re:Good bye source compatibility by angel'o'sphere · · Score: 0

      A good UI is much more complex than the backend.
      Assuming backpend and frontend would require the same work (which is not the case, usually it is more an 1/3 to 2/3 relation) then rewriting the frontend for 3 platforms means it costs like writing it two times for one.
      A crossplatform GUI framework is much much cheaper. Hence the success of Java (regardless weather you use Swing or SWT)

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    6. Re:Good bye source compatibility by Anonymous Coward · · Score: 4, Informative

      What possible application could ever require GDB as a dependency?

      LLDB is a far superior debugger anyways.

    7. Re:Good bye source compatibility by Anonymous Coward · · Score: 0

      The future:
      ASM => C => C++ => VB.net => rust

    8. Re:Good bye source compatibility by ugen · · Score: 4, Interesting

      Qt does not (and cannot) support Windows "Metro" (or whatever the name is for the C#/event driven/non Win32 environment now)
      By the same token it won't be able to support this new environment.

      Qt, XWidgets and others like them rely on basic C compatibility and certain common UI themes and primitives to be able to build cross-platform libraries and applications. With proprietary, non-portable and non-overlapping languages vendors make sure that any development has to target their platform specifically.

      Aside from that, if new development environment does not support linking against "old" binary libraries - developers also don't get the benefit of code reuse (since they won't be able to use existing libraries for things like image handling, graphics, sound, networking, you name it).

    9. Re:Good bye source compatibility by Anonymous Coward · · Score: 5, Funny

      Creating GUI's in OSX is currently problematic because of font issues.

      Obviously this must be the case as no-one else is creating GUIs in OS X either. That, and the fact that OS X is hated the world over by designers for it's awful handling of fonts.

    10. Re:Good bye source compatibility by roc97007 · · Score: 1

      Obviously you should pick Windows.

      .....

      ....

      *snerk* Sorry, I just couldn't say that with a straight face.

      --
      Oliver's law of assumed responsibility: If you're seen fixing it, you will be blamed for breaking it.
    11. Re:Good bye source compatibility by ddtstudio · · Score: 4, Insightful

      Hey, I'm not a developer/coder/programmer, so I honor and respect the work you've put in to things in the past. But if you've been tying yourself to a "unified GUI look" across platforms, you've long been dooming your products and yourself.

      As a UX person, I can throw data at you all day long that shows device/OS specificity and familiarity are key elements in making something work for the user. I'm sure you don't literally mean you chose either a menu bar in all app windows on every platform or a top-of-the-screen menu bar on every platform, but the obvious reason why that would be wrong also holds for controls, colors, placement, text sizes, and so on to the last turtle at the bottom.

    12. Re:Good bye source compatibility by nine-times · · Score: 1

      It doesn't sound like they're dropping support for existing languages. Couldn't you keep using whatever you're using?

    13. Re:Good bye source compatibility by jbolden · · Score: 0

      Apple has always been hostile to unified look on their platform. They want their applications written by developers in the Apple culture. That being said, nothing has actually changed. They are just releasing a new language.

    14. Re:Good bye source compatibility by Anonymous Coward · · Score: 4, Funny

      Could you tell me who your team is? I have a tumblr for really shitty software and I'd love to feature them!

    15. Re:Good bye source compatibility by Frosty+Piss · · Score: 3, Insightful

      Qt does not (and cannot) support Windows "Metro"

      "Windows Metro" is dead, irrelevant to this discussion. QT will continue to be available for Apple's little garden. Your comment constitues "fear mongering".

      --
      If you want news from today, you have to come back tomorrow.
    16. Re:Good bye source compatibility by Anonymous Coward · · Score: 0, Flamebait

      Qt does not (and cannot) support Windows "Metro" (or whatever the name is for the C#/event driven/non Win32 environment now). By the same token it won't be able to support this new environment.

      If we applied that standard to everything, we'd be stuck with Qt's obsolete and cumbersome programming model and UI in perpetuity. I, for one, am happy to jettison it once and for all.

      Qt, XWidgets and others like them rely on basic C compatibility and certain common UI themes and primitives to be able to build cross-platform libraries and applications.

      And people should care about this... why? Writing a UI in C/C++ is itself a questionable proposition. And if you really want a C++ toolkit, you can still provide it even if the UI tools are implemented in a completely different language and runtime (just have a look at HTML+JavaScript).

    17. Re:Good bye source compatibility by StikyPad · · Score: 3, Informative

      Whatever source compatibility existed before Swift (and the degree to which that exists is surely debatable), it was not removed by Swift. Objective-C, C/C++, and Swift can coexist in the same project. I believe they can even coexist inline, which makes me shudder to think, but there it is. Still, you could ostensibly have a UI in Swift and your core business logic in C, if your architecture is solid. (Obviously YMMV, and there are bugs to be discovered, to be sure.)

    18. Re: Good bye source compatibility by VTBlue · · Score: 1

      Or you switch to dev environments that compile down to native, such as Xamarin.

    19. Re:Good bye source compatibility by Frosty+Piss · · Score: 2, Funny

      Why is this dumb post modded insightful? You can still use all the same languages you did before.

      Because Slashdot Sheep have a childish hate for apple, as they post comments from their iPhones?

      --
      If you want news from today, you have to come back tomorrow.
    20. Re: Good bye source compatibility by loufoque · · Score: 1, Insightful

      If your frontend requires more work than your backend, then your app doesn't do anything useful.

    21. Re: Good bye source compatibility by loufoque · · Score: 0, Troll

      You, sir, are part of the cancer destroying the UI of perfectly fine applications.

    22. Re:Good bye source compatibility by jbolden · · Score: 1

      Now let's talk real life. Digia is porting to Windows 8. They don't think it is so bad they just have to port over the ANGLE library to Windows RT (which is their target, but that will get Metro soon after). Qt 5.3 included a Beta of this support.

    23. Re:Good bye source compatibility by peragrin · · Score: 1

      You can't post from the iPhone anymore. Mobile Slashdot on safari is horribly broken. At least for me I can't log in or post once I do login. I switch to classic.Slashdot and everything works as normal. Switch back to mobile and it breaks. I don't know why they can't test it. It is not like you can extend mobile safari.

      --
      i thought once I was found, but it was only a dream.
    24. Re:Good bye source compatibility by Anonymous Coward · · Score: 0

      A good UI is much more complex than the backend.

      Well, that's disingenuous as fuck.

      A good UI design might be more complex (for a programmer, not a designer) to design. But fucking implementing the design in any language is typically easy as shit. It's a few grids plus primitives. It's designing the interactions (which are platform agnostic) and stuff that is the hard part, and that has nothing to do with any language.

    25. Re:Good bye source compatibility by Frosty+Piss · · Score: 2

      You can't post from the iPhone anymore. Mobile Slashdot on safari is horribly broken. At least for me I can't log in or post once I do login. I switch to classic.Slashdot and everything works as normal. Switch back to mobile and it breaks. I don't know why they can't test it. It is not like you can extend mobile safari.

      That's not Apple's issue, that's a Slashdot issue. Just like unicode...

      --
      If you want news from today, you have to come back tomorrow.
    26. Re:Good bye source compatibility by linearz69 · · Score: 1

      Is Windows "Metro" really a platform? Metro seems more like a design language (not even a programming language), with its own custom libraries, that runs on top of a platform (Windows 8). But Metro is hardly the only way to write an app that will run on a Windows 8 platform, just as the Windows Metro based shell is hardly the only way to run Windows 8... There are still a lot of people running Windows 8 the old fashioned way - with a desktop, changing the way Microsoft has shipped things out of the box - and from the start menu running a QT (or some other) program.

      Certainly QT can still generate cross platform applications that will run on Windows 8 and look like Metro. It doesn't use Metro's libraries. And judging from what nearly everyone I know who has tried the Windows 8 Metro shell, not using the Metro libraries isn't exactly a handicap.

      The question about cross platform comes down to this: is there one environment that can build a program to run on Windows, Mac, Linux, Android, iOs. The answer is still YES. For this answer to be NO, it will take a lot more than inventing a new language and writing a goofy, near useless frontend. This would essentially require a redesign of the platform as it is today, providing all of the access to the platform through closed libraries for proprietary languages.

      Apple may have the resources, leverage, limited market share, and Apple Logo worshiping minions to pull something like this off, but why? To gain an even greater infinitesimal share in desktop user and make it all the more relatively easier to write an Android app? And Microsoft's whole business is built on software compatibility (and yes, I know M$ has failed so many times here, but, really, the reason why many people still buy Microsoft OS is because they want to run some program that can only run on Microsoft OS). It is a bit over the top to think that new OS makers coming out with scripting type languages with tight coupling to the OS can actually use these languages to do away with C and cross platform development tools.

      The real reason for all of these garbage scripting type languages is so that people who don't want to spend the time or effort to learn computer science can still put together a usable piece of software. They want to make it easier for graphic designers to program. The world wants pretty pictures.

    27. Re:Good bye source compatibility by Anonymous Coward · · Score: 0

      You know what's even more sad than your cliche and buzzword filled garbage? It's that your post was voted insightful.

    28. Re:Good bye source compatibility by PCM2 · · Score: 1

      Good bye source compatibility. We hardly knew ye.
      First Windows, and now OSX. I am still maintaining applications that are built crossplatform (Windows/Mac/Linux, with unified GUI look) but it's getting harder every year and, by the looks of it, will be impossible soon.

      That's a kinda silly thing to say. Anytime a problem comes up like this, it creates an opportunity for vendors. In the game development world, you have toolkits like Unity. Xamarin is already helping developers port C# code to OS X. And there are and will be lots of other solutions.

      And Apple isn't even abandoning support for Objective-C. Nobody is being forced to code in Swift.

      --
      Breakfast served all day!
    29. Re:Good bye source compatibility by Anonymous Coward · · Score: 0

      What's stopping you from sticking to the meat and potatoes? On Windows, I never bothered to screw around with MFC, and I'm saner for it... arguably. On Mac OS X, I just use Cocoa. It's not like I had to learn C# and it's not like I have to use Swift. But both are there when I want them.

    30. Re:Good bye source compatibility by ugen · · Score: 1

      Are you sure about the "metro"? Name is dead, but I was under impression that all new windows "apps" had to be written in C# against a new SDK that has neither binary nor source compatibility with Win32/posix/C/C++. I'd be glad to be wrong, but that's what I've seen so far.

      Are you saying that it is possible to write new "Windows app-store-acceptable" apps using C/C++/posix/winsdk? That would be exciting news to me (honestly).

    31. Re:Good bye source compatibility by Anubis+IV · · Score: 1

      It seems to me as if your entire post could apply equally as well to Obj-C as to Swift, yet cross-platform compatibility wasn't an issue with Obj-C in the picture, simply because straight-up C was always an option...and continues to be an option. How has anything changed at all when it comes to compatibility? This is an additional option for developers who want to take advantage of it. For developers who want compatibility, they weren't using Obj-C to begin with, so the introduction of Swift changes nothing at all.

    32. Re:Good bye source compatibility by immaterial · · Score: 1

      No, but you can use a different browser and set it to send a desktop user agent string so you don't get bullshit "mobile" versions of websites (posting this from my iPhone).

    33. Re: Good bye source compatibility by Anonymous Coward · · Score: 0

      I have a theory about loufoque. This theory, which I am about to tell, is mine...is mine.
      Mty theory, which is is mine, is that Loufoque is thin at one end, much much thicker in the middle, and then thin again at the far end. That is the theory that I have and which is mine, and what it is too.
      Oh wait, sorry, When I typed loufoque I meant to type dinosaur. I don't know how that mixup could have happened.

    34. Re:Good bye source compatibility by Anonymous Coward · · Score: 0

      Apple users are the xenophobe bigots of the computer world.

    35. Re:Good bye source compatibility by ugen · · Score: 3, Insightful

      That's not what cross-platform compatibility implies. Placement of specific elements and their view is a subject of "themes" and is readily customizable.
      As a developer I care about underlying primitives - things like "windows", "buttons", "menus" or more generically "events", "inputs" etc. Once those underlying things can no longer be shared - you have to write a new product from scratch for every platform.

      Think of something like Adobe Photoshop (I assume as a UX person you are using it?). It is possible to have a version for Windows, and one for Mac precisely because you have those common underlying primitives and APIs, even though they don't necessarily look the same in all respects.

      If commonality of platforms is gone - even a company like Adobe will have really hard time building products for both platforms. That will eventually affect users too, since they will likely have to select different (and no longer compatible) products for each platform as well. For now that's not the case - but given where things go, it probably will be.

    36. Re:Good bye source compatibility by phantomfive · · Score: 1

      "Languages that don't provide stability are simply unsuitable for large, long-lived projects." -- Bjarne Stroustrup

      --
      "First they came for the slanderers and i said nothing."
    37. Re: Good bye source compatibility by Anonymous Coward · · Score: 1

      That's why I use RPG III and not C with all it's flash new versions every ten years causing fragmentation.

    38. Re: Good bye source compatibility by Anonymous Coward · · Score: 0

      Apple users pay $ for stuff they like.

    39. Re:Good bye source compatibility by Jane+Q.+Public · · Score: 4, Funny

      That, and the fact that OS X is hated the world over by designers for it's awful handling of fonts.

      As a programmer, I can tell you that designers are hated the world over for their awful handling of fonts.

    40. Re:Good bye source compatibility by binarstu · · Score: 1

      Hey, I'm not a developer/coder/programmer...

      And that explains your comments quite nicely.

      I don't think there is anyone here who would seriously disagree with you that the best possible scenario for the end user is dedicated UI design that is customized, when appropriate, for each target OS. But in the real world, those of us who must develop and maintain cross-OS applications with limited resources and small teams often don't have the luxury of building custom UIs for each target platform. Off-the-shelf cross-platform UI toolkits, such as Qt, are the only realistic way to support multiples OSs in these cases. It's either that, or only develop for one platform, which will usually have to be windows due to the size of the customer base. That is a far worse option, in my opinion.

      So no, the "unified GUI look" that toolkits like Qt strive for across platforms is not ideal. Any serious programmer already knows that. But often times, it's the only practical way to support more than one OS, and for that reason, such toolkits are indispensable. Furthermore, those of us who don't use windows or OSX appreciate the benefits of these toolkits even more (GNU/Linux, in my case), because it means that we have far more software options than we might otherwise.

    41. Re:Good bye source compatibility by R3d+M3rcury · · Score: 3, Insightful

      It's a good point.

      Consider the menu bar. It's a pretty handy place for commands. On the Mac, it sits at the top of the screen. On Windows, it sits along the top of your window. Now if we consider Fitts' Law for a moment and compare Mac and Windows, the menu bar is much easier to access on the Mac than it is on Windows because it's sitting at the top of the screen.

      So, putting things that people access somewhat frequently into a menu item on the menu bar isn't a horrible thing on the Mac. But on Windows--because the menu bar is harder to access--it will frustrate your users. You probably want to set up some kind of contextual menu on Windows.

      Do it the Mac way, you've annoyed your Windows users. Do it the Windows way and you confuse your Mac users (who are used to searching the menu bar to find things). Or devote the time and effort to doing it both ways.

    42. Re:Good bye source compatibility by phantomfive · · Score: 1

      As a UX person, I can throw data at you all day long that shows device/OS specificity and familiarity are key elements in making something work for the user.

      But how much are they willing to pay for it? Sometimes the cost of making platform specific code is not worth it, to the developer or the user. Sometimes it is.

      --
      "First they came for the slanderers and i said nothing."
    43. Re:Good bye source compatibility by tlhIngan · · Score: 2

      Good bye source compatibility. We hardly knew ye.
      First Windows, and now OSX. I am still maintaining applications that are built crossplatform (Windows/Mac/Linux, with unified GUI look) but it's getting harder every year and, by the looks of it, will be impossible soon.
      Which means that an individual developer (like myself) or a smaller shop would have to choose one big player/OS vendor and stick with it. That increases risk and makes small players that much less viable (while, of course, helping the big ones consolidate user base and profit).
      Funny how the world works.

      You can still use C. In fact, because they all use LLVM internally, Obj-C, Swift and C code can be combined together in a single program.

      So your cross-platform code will be in C, while your UI code can be in either Obj-C or Swift, your choice.

      Swift gets its speedups from optimizations that are based on restricting what you can do in a language. It's why you can implement the same code in C and Fortran, and the Fortran version will run faster because the Fortran compiler can be more aggressive as there are certain things you can do in C that aren't allowed in Fortran (aliasing for example - where you can have overlapping arrays. Not allowing this means the compiler has freedom to choose how to execute the loops).

      The nice thing is, Apple finally gives choice - you no longer are restricted to Obj-C. Swift gets full citizenship status.

    44. Re:Good bye source compatibility by macs4all · · Score: 4, Informative

      Apple has always been hostile to unified look on their platform.

      You do realize, of course, that you are talking about the company that literally wrote the book on good, consistent UI design, right?

      The above, linked pdf copy dates from 1995 (the earliest actual copy I could find in a 2 minute search), but Apple first published their most-excellent HIG manual on or around 1985, before most slashdotters were even born.

      Now, get off my lawn!

    45. Re:Good bye source compatibility by ljw1004 · · Score: 4, Informative

      Are you sure about the "metro"? Name is dead, but I was under impression that all new windows "apps" had to be written in C# against a new SDK that has neither binary nor source compatibility with Win32/posix/C/C++. I'd be glad to be wrong

      You're wrong! You can write Windows Store apps in C++ just fine. This C++ can use win32, posix, STL etc just fine. (however, all apps run in a sandbox, so some win32/posix functions aren't as powerful as normal, e.g. the sandbox doesn't let a Windows Store app enumerate files on the hard disk outside of the files it's allowed to touch).

      You can also write Windows Phone apps in the same C++. So a mobile app developer could write their core in posix platform-neutral C++, and have it portable across Android+iOS+Windows. I know a few who do.

      Of course posix doesn't have anything to do with windowing systems or touch, and win32 APIs (e.g. gdi32.dll, user32.dll) don't apply to windows store or phone apps since they don't have GDI or the traditional windowing system. So your C++ code will invoke new WinRT APIs to access the new functionalities. WinRT is perfectly compatible with posix/win32 APIs. Indeed, for some functionality (e.g. audio), you're REQUIRED to use win32 APIs because they're not exposed in WinRT.

      Here's some example code that shows how you'd mix the new WinRT APIs to get hold of sandbox-specific stuff, and then interop with traditional posix APIs. It also shows how the asynchronous nature of WinRT APIs combine with the synchronous traditional posix APIs:

              auto f1 = Windows::ApplicationModel::Package::Current->InstalledLocation;
              create_task(f1->GetFolderAsync("Assets")).then([this](StorageFolder ^f2)
              {
                      create_task(f2->GetFileAsync("Logo.scale-100.png")).then([this](StorageFile ^f3)
                      {
                              auto path = f3->Path;
                              FILE *f = _wfopen(path->Data, L"r");
                              byte buf[100];
                              fread(buf, 1, 100, f);
                              fclose(f)
                      });
              });

    46. Re:Good bye source compatibility by Anonymous Coward · · Score: 0

      http://apps.microsoft.com/windows/en-us/app/ad41d87d-9cb0-4b76-9a4a-5e2c739161e6

      Qt app in Windows Appstore

    47. Re:Good bye source compatibility by Anonymous Coward · · Score: 0

      Fuck you.

      There are plenty of developers around with more taste and sense than some designers I see floating around.

    48. Re:Good bye source compatibility by gl4ss · · Score: 1

      all new windows apps don't need to be.

      only if you're targetting windows phone 7/8 or windows RT. if you're targetting those you either live in Finland or for some reason care about 3% marketshare and already have ios and android versions too and it's not that big of a hit on your budget(or alternatively MS just gave you a chunk of money to do it).

      also what I heard is that qt is working on winRT support.

      anyhow, simplest way to do desktop(x86) and windows-store apps at the moment seems to be writing them for directx 11.

      (anyhow, you can use c++ for store apps, http://msdn.microsoft.com/en-u... )

      --
      world was created 5 seconds before this post as it is.
    49. Re:Good bye source compatibility by phantomfive · · Score: 3, Funny

      I believe they can even coexist inline, which makes me shudder to think, but there it is.

      If that makes you shudder, then this will terrify you. It compiles in eight different languages.

      --
      "First they came for the slanderers and i said nothing."
    50. Re:Good bye source compatibility by countach · · Score: 1

      Errrm, how does this announcement make it better or worse? Were you using Objective-C for your windows apps? This is just the old Objective-C brought into the 21 century. It doesn't really change the compatibility landscape.

    51. Re:Good bye source compatibility by Parafilmus · · Score: 1

      Qt does not (and cannot) support Windows "Metro." By the same token it won't be able to support this new environment

      Nah, this isn't something like metro. Swift is just another language, not a new runtime.

      Swift actually has good interoperability with C and ObjC. You can link precompiled libraries or just drop C code into your project, #import the header files, and call C functions directly from swift or vice-versa.

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

      Alas, it doesn't have the same interoperability with C++. Apple recommends creating a C or ObjC wrapper for C++ libraries, which doesn't sound awesome.

      However, QT already links with cocoa, apple's ObjC / Swift interface. Cocoa isn't going anywhere, so QT won't be going anywhere.

    52. Re:Good bye source compatibility by Parafilmus · · Score: 1

      Here's a document about how C data types and pointers map to swift. It looks reasonably straightforward.

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

      I don't really see myself using the language because it's locked to one platform, but the sky is not falling. I'm sure we'll see swift-wrappers for popular C and C++ libraries popping up all over the place.

    53. Re:Good bye source compatibility by JustOK · · Score: 0, Flamebait

      It's cute how people think it's "their" iphone.

      --
      rewriting history since 2109
    54. Re:Good bye source compatibility by Anonymous Coward · · Score: 0

      Forever. Compilers can target any machine/byte-code, the source language really does not matter. They'd only be able to force use of swift by preventing unsigned programs running and only signing swift ones. They never tried that before (eg Obj-C) and it'd break a massive amount of legacy applications. Not going to happen.

    55. Re: Good bye source compatibility by Anonymous Coward · · Score: 0

      Guess what? Most consumer software doesn't do much according to your analysis. Actually, I totally disagree with that statement.

    56. Re:Good bye source compatibility by Anonymous Coward · · Score: 0

      Good bye source compatibility. We hardly knew ye.
      First Windows, and now OSX. I am still maintaining applications that are built crossplatform (Windows/Mac/Linux, with unified GUI look) but it's getting harder every year and, by the looks of it, will be impossible soon.
      Which means that an individual developer (like myself) or a smaller shop would have to choose one big player/OS vendor and stick with it. That increases risk and makes small players that much less viable (while, of course, helping the big ones consolidate user base and profit).
      Funny how the world works.

      All those vendors will soon be hiring people with 5 years of experience in Swift, though! :)

    57. Re:Good bye source compatibility by LongearedBat · · Score: 1

      You have options. Cross platform options (for Win, OSX, iOS & Android) that you can use...

      - Mono C#

      - Delphi Firemonkey (My personal preference.)

      - wxWidgets

      - other web related technologies that I've heard of but don't use.

    58. Re:Good bye source compatibility by angel'o'sphere · · Score: 2

      That's why you use the desktop site and not the mobile one.
      I never use the mobile version of any website on my iPhone or my iPad ...

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    59. Re: Good bye source compatibility by angel'o'sphere · · Score: 1

      Sigh, I could likely iterate 100ds of programs where the UI is more work than the "backend".
      The simplest is image/graphics manipulation, then comes CAD and GIS then comes CASE then comes anything with desktop publishing.
      Data analytics software ...

      Obviously you never ever worked on "interesting" GUI focused software.

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    60. Re: Good bye source compatibility by loufoque · · Score: 1

      None of the software your described requires more work on the UI than the rest.

      Image processing, simulation and spatialization in particular are domains requiring intensive computing, potentially involving some advanced algorithmics and math, which are much more challenging to engineer than writing glue code for user interaction.

    61. Re:Good bye source compatibility by Alioth · · Score: 1

      Please be a UI person *not* a UX person. If a user interface is giving me an experience it's doing it wrong. I want user interfaces to melt into the background so I hardly notice them.

    62. Re:Good bye source compatibility by Anonymous Coward · · Score: 0

      Qt on mobile is a pile of unfinished shite, no good abstractions for the mobile platforms in a unified way, no such thing as an activity or task that is paramount on mobile. Not easy way to make inter activity navigation, Qml is just a pile of bones.

    63. Re: Good bye source compatibility by Anonymous Coward · · Score: 0

      That's why IDEs are so much smaller than C compilers.

    64. Re:Good bye source compatibility by countach · · Score: 1

      I don't see why QT can't support this. Swift and Objective-C objects map 1:1. Objective-C objects are just blobs of memory to other C-like languages. You'll be able to wrap all method calls with C wrappers.

      Will it be easy? No. But it won't be any harder than it was with Objective-C. It's always hard to wrap an object framework with a foreign language.

      As for Metro, I'd imagine it would be possible IF Microsoft allowed you to run non-Metro programs from their app store. I know nothing about it, but I suspect they might not. Would it be easy to wrap Metro? No, pretty hard. But it doesn't sound impossible. If there's a C interface, use that. If not, you feed method calls to the Metro engine as text strings.

    65. Re:Good bye source compatibility by Anonymous Coward · · Score: 0

      You started the topic drift. You should enjoy the fruits of it.

    66. Re:Good bye source compatibility by Anonymous Coward · · Score: 0

      What about languages with an ABI per compiler version?

    67. Re:Good bye source compatibility by Anonymous Coward · · Score: 0

      Slashdot Sheep have a childish hate for apple

      As opposed to cretinous fanboys defending Apple's shit?

    68. Re:Good bye source compatibility by Goaway · · Score: 1

      "I'm wrong, but I could be right in the future!"

    69. Re: Good bye source compatibility by Anonymous Coward · · Score: 0

      Others obviously get stuff they like for free, don't they?

    70. Re:Good bye source compatibility by Anonymous Coward · · Score: 0
    71. Re:Good bye source compatibility by Anonymous Coward · · Score: 0

      Adobe is a bad example. They use their own UI framework that was based on flash. It's terrible and feels out of place in every operating system, but it kowtows to the Windows way of doing things. For an application that got it's start on the Mac, it's quite a slap in the face.

    72. Re:Good bye source compatibility by mark-t · · Score: 1

      They'd only be able to force use of swift by preventing unsigned programs running and only signing swift ones.

      The default settings of the latest version of OSX already do this via 'Gatekeeper'. I recall when people first heard of this new "feature" in OSX, many expressed concern that a future version of the OS might prevent it altogether. If or when that happens, I have no doubt that there will be no small number which will permanently leave the Apple culture, but knowing Apple, they probably won't care, because there will be enough that stick around anyways.

    73. Re:Good bye source compatibility by Anonymous Coward · · Score: 0

      "A good UI is much more complex than the backend."

      This is one of the most insanely stupid things I have ever read on /.

      Thats like saying a good dashboard console in a car is more complex than the engine. Its fucking loony.

    74. Re:Good bye source compatibility by Anonymous Coward · · Score: 0

      gdb works just fine on Mavericks. No offense but your team is stupid.

    75. Re: Good bye source compatibility by Anonymous Coward · · Score: 1

      The UI code to all of those things just render windows, buttons etc. and wires up events. Those events call methods/routines on "backend" code - dlls, linked libraries, jar files whatever. When you click "Rasterize", its not the Rasterize button that is doing the rasterizing you dumbshit. Its "backend" code that performs the calculations.

    76. Re: Good bye source compatibility by Anonymous Coward · · Score: 0

      For fucks sake, in IDEs - possibly even especially IDEs - the code that makes up the UI of the IDE is far, far less code than the "backend" (i.e non-UI) code of the IDE.

    77. Re: Good bye source compatibility by Altus · · Score: 1

      not if you do a really shit job on the UI

      --

      "In America, first you get the sugar, then you get the power, then you get the women..." -H. Simpson

    78. Re:Good bye source compatibility by Anonymous Coward · · Score: 0

      As a Mac and Linux user, I'm used to keystrokes...I rarely, if ever, use application menus.

    79. Re: Good bye source compatibility by Anonymous Coward · · Score: 0

      The counter though, if your backend requires more work than your fronted, then your app isn't usable by anyone.

    80. Re:Good bye source compatibility by Anonymous Coward · · Score: 0

      Placement of specific elements is precisely outside what is commonly referred as 'themes'. The visual skin of those elements is typically a theme, also including an assortment of related metrics (font sizes, spacing between widgets, borders, etc.). The specific positioning and order of elements in dialogs is some times programatic, some times based on a tool-assisted template, but it is rarely a trivial change.

      Furthermore, the platform UX conventions are usually designed for humans (as they should). It is not as easy as 'in Mac, put the default button to the right, in Windows, put it to the left'. You may find some cases of that, but the hard cases will be plenty and cannot be generalized: use a ribbon in Windows, but a traditional menu in Mac, for example.

    81. Re:Good bye source compatibility by Anonymous Coward · · Score: 0

      Cross-platform toolkits like Qt abstract all that so you just have to care about using a QMenuBar with QActions and it handles putting it on the top on the Mac and in the window on Windows. As a bonus it even handles connecting toolbar buttons to menu items (text, icon, checked state, etc).

    82. Re:Good bye source compatibility by Anonymous Coward · · Score: 0

      Metro is based on the XAML-based GUI shared with WPF and Silverlight, it's a higher-level layer than Qt itself, more like QML.

      It makes more sense to re-create Metro GUI framework on Qt, not the other way around. Although the future of Windows 8 and all other platforms utilizing XAML is now very questionable. While it's advanced, it's far from perfect and M$ did a very bad job promoting it, if not ruining it actually.

    83. Re: Good bye source compatibility by Anonymous Coward · · Score: 1

      Pretty sure you mean "designers", with a healthy dose of scare quotes.

    84. Re: Good bye source compatibility by angel'o'sphere · · Score: 1

      None of the software your described requires more work on the UI than the rest.
      If you believe that, you never have programmed a UI intensive application ... or you made yourself comfortable with a mediocre UI.
      Hint CAD stands for Computer Aided Design, that means 90% of the work is UI. You can now argue about import capabilities for various data formats or build in scripting languages but you won't drop the UI part below 75%.
      Same for GIS.

      Image processing can be done without UI, obviously.

      However we are talking about 'interacting' programs like Photoshop, where certainly the main part of the work is in the UI.

      Or look at something like Notes or even MS Paint. Do you realy believe the 'backend' of MS Paint needs more work than the UI? Even Notepad needs more work in the UI than in the 'backend', bad example perhaps as you can in our days program a 'Notepad' like application witha a few lines of code by reusing an editor component (then arguable your own UI code is only wiring the menu to the actions).

      Anyway, more or less ever iOS app has more work in the UI than in the backend, especially when you consider that most native programmers will generate most of the backend code with tools.

      Actually I never worked or was involved in the work of a Desktop application where the 'backend' code was less work than the 'frontend'. But perhaps I only had bad luck there?

      potentially involving some advanced algorithmics and math, which are much more challenging
      We did not talk about 'challanging' but about 'efford' as in temrs of money and time invested.

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    85. Re:Good bye source compatibility by shutdown+-p+now · · Score: 2

      Consider the menu bar. It's a pretty handy place for commands. On the Mac, it sits at the top of the screen. On Windows, it sits along the top of your window. Now if we consider Fitts' Law [wikipedia.org] for a moment and compare Mac and Windows, the menu bar is much easier to access on the Mac than it is on Windows because it's sitting at the top of the screen.

      And if we consider the real world with 24"+ screens been very common, putting the menu bar on top is ridiculous because it's so far away (and even if you just "swipe"
      up, said swipe still takes time to reach the top).

      By the way, for the same reason, you don't want to skimp on the context menu on a Mac.

    86. Re:Good bye source compatibility by shutdown+-p+now · · Score: 1

      And then they repeatedly broke the conventions in that book themselves. Just look at stock OS X apps...

    87. Re:Good bye source compatibility by R3d+M3rcury · · Score: 1

      The issue isn't so much "can you put something in the menu bar" but "should you put something in the menu bar."

      On the Mac, this might make sense because the menu bar is easier to access than it is on Windows.

    88. Re:Good bye source compatibility by Anonymous Coward · · Score: 0

      Photoshop is as great of an example as Google Earth. Yes, it runs and it self-consistent. But it stands out like a sore thumb if you use *ANY* other apps on your platform of choice. Photoshop stopped looking mac native at around CS3.

    89. Re: Good bye source compatibility by Jane+Q.+Public · · Score: 1

      Pretty sure you mean "designers", with a healthy dose of scare quotes.

      I don't use "scare quotes". I just use quotes.

    90. Re: Good bye source compatibility by BasilBrush · · Score: 1

      Spoken as someone who clearly doesn't develop apps. Most app development is UI work.

    91. Re:Good bye source compatibility by BasilBrush · · Score: 1

      Designers have the problem that programmers haven't yet come up with a better App for designing custom UIs than Photoshop. And even when using what is supposed to be the same font, Photoshop typography usually isn't per pixel identical to the target OS typography.

    92. Re: Good bye source compatibility by BasilBrush · · Score: 1

      Image processing, simulation and spatialization in particular are domains requiring intensive computing, potentially involving some advanced algorithmics and math, which are much more challenging to engineer than writing glue code for user interaction.

      Image processing on iOS and OSX is usually very easy, taking just a few lines, as the built in Core Image framework does most of what you could possibly want. And where it doesn't writing a plugin isn't hard. All those Image processing apps you can get on iOS have certainly spent far more time on UI than engine.

      Come to that I wrote a warping app on Symbian OS years ago, where there wasn't any image processing library to help. And I did part of the image processing code in assembler to get the speed I needed. And the UI work was still far greater.

      Simulation and spatialization are very specialised domains. Most app work is not like that. And it may well still be the case that UI work is greater than engine work even with those - depending on the specifics.

    93. Re: Good bye source compatibility by BasilBrush · · Score: 2

      If the applications don't follow the OS norms, they are not fine applications.

    94. Re: Good bye source compatibility by loufoque · · Score: 1

      The OS is but a tool to help you build your application, not something you must constrain yourself to.

    95. Re:Good bye source compatibility by BasilBrush · · Score: 1

      even a company like Adobe will have really hard time building products for both platforms.

      Bad example. Adobe have horrible UIs and are really slow to adapt to changing technology.

      As to cross platform work in general, those companies that try to do it with cross platform widget libraries such as Qt and Swing generally have sub-standard UIs, not really fitting in on anything but the primary development OS.

      The companies that do cross platform well split out out the non-UI elements into an engine, then implement the UI with the native UI libraries on each OS.

    96. Re: Good bye source compatibility by loufoque · · Score: 1

      And most apps are useless crapware.

    97. Re: Good bye source compatibility by BasilBrush · · Score: 1

      You're just adding weight to the conclusion that you are not an app developer. Each platform has it's UI norms and if you don't match them, your app is shit and won't sell.

    98. Re: Good bye source compatibility by loufoque · · Score: 1

      Your app will sell if it does something useful.
      Only superficial people care about looks.

    99. Re:Good bye source compatibility by Simon+Brooke · · Score: 1

      Since Qt works with Objective-C and Objective-C works with Swift, doesn't Qt already (automatically) work with Swift?

      --
      I'm old enough to remember when discussions on Slashdot were well informed.
    100. Re: Good bye source compatibility by Anonymous Coward · · Score: 0

      And most apps are useless crapware.

      Read: "I'm a whiny curmudgeon, and you won't convince me that the nonsense I believe is not unquestionably true."

    101. Re:Good bye source compatibility by Anonymous Coward · · Score: 0

      Consider the menu bar. It's a pretty handy place for commands. On the Mac, it sits at the top of the screen. On Windows, it sits along the top of your window.

      ...except when it doesn't, because God dammit, Windows. Windows is a nightmare of inconsistent interface elements. I'm presently looking at the ribbon in Outlook, the menu in Notepad, and the menu button in Lync and Chrome on my work machine.

    102. Re:Good bye source compatibility by Douglas+Goodall · · Score: 1

      Not funny Ha Ha, but funny peculiar I guess. If the world's strangeness continues, I expect the day will come that Apple will embrace the trusted computing initiative and their compilers will start generating a new proprietary IL pseudocode. As an independent developer, I have tried to keep my code portable so as to leverage off marketing opportunities that require shifting platforms. Each time I have to play what I call "Engineering Poker" and guess which toolset will benefit me the most, it causes me grief. In my opinion, Apple doesn't need to play lock-in games. Mac OS X (Unix) is a superior platform to Windows, and the Apple hardware has been worth the extra cost for the longevity and stability. I think Apple would win on a totally level playing field.

    103. Re:Good bye source compatibility by Anonymous Coward · · Score: 0

      And if we consider the real world with 24"+ screens been very common, putting the menu bar on top is ridiculous because it's so far away (and even if you just "swipe" up, said swipe still takes time to reach the top).

      I suppose this is a hardship for those who've set their mouse to track at a ridiculously slow pace. I have two 30" monitors attached to my Mac, and the length of time it takes for me to move from the bottom of one to the menu bar on the other is only marginally greater than the time required for me to form the conscious thought that it's something I want to do.

      We move from one anecdote to the next.

    104. Re:Good bye source compatibility by Anonymous Coward · · Score: 0

      Now, I feel old.

    105. Re:Good bye source compatibility by Anonymous Coward · · Score: 0

      If you're horrified by how badly the stock apps violate the HIG, I hope you never get to experience the wonder that is iTunes....

    106. Re:Good bye source compatibility by Anonymous Coward · · Score: 0

      I'm a "nobody" ... and as a "nobody" I've choosen to support Android, I like my S4 and I like programming in Java!

    107. Re: Good bye source compatibility by Anonymous Coward · · Score: 0

      And klan member are part of a social club they like.

    108. Re: Good bye source compatibility by BasilBrush · · Score: 1

      You just pile more evidence on the conclusion that you are not an app developer and don't know what you're talking about with regard to app development.

    109. Re: Good bye source compatibility by BasilBrush · · Score: 1

      Design isn't how it looks, design is how it works.

    110. Re:Good bye source compatibility by cyber-vandal · · Score: 1

      That happens on Android too. It's Slashdot that sucks. It tells me I've entered my password wrong when I haven't.

  3. Whoa 1.3x by the+eric+conspiracy · · Score: 4, Funny

    That's what about 1/10,000th of what hiring a good programmer would get you, at the price of not being to find any programmers.

    1. Re:Whoa 1.3x by Anonymous Coward · · Score: 0

      that's the whole point, it's much faster to write the code while actually gaining some runtime performance

    2. Re:Whoa 1.3x by Anonymous Coward · · Score: 1

      10,000x speedup in run time performance from a good programmer? I wanna know where you've been hiring these 'bad programmers' so I can avoid them.

    3. Re:Whoa 1.3x by Anonymous Coward · · Score: 0

      well, he's one of the bad programmers.

    4. Re:Whoa 1.3x by SQLGuru · · Score: 4, Funny

      Now hiring Swift programmers. 10 years experience required. /sarcasm.

    5. Re:Whoa 1.3x by Anonymous Coward · · Score: 0

      Java started out like that.

    6. Re:Whoa 1.3x by Anonymous Coward · · Score: 0

      "10 years experience" - keep in mind time at a university counts for work experience. So does time spent working in related fields. Always assume X programmer, Y years experience required means just that. Not Y years experience programming X.

    7. Re:Whoa 1.3x by PhilHibbs · · Score: 1

      I was recently brought in to a team to help with some performance problems, and I ended up speeding up one of the operations by nearly 100,000 times. But I accept that these gains are few and far between, I've only achieved 5-figure performance improvements a handful of times in my 30-year career as a programmer. Most of the time it's hard to get much more than double, as you say depending on how good the original development was. Sometimes I've managed to get 5-figure improvements on revisiting my own code, so I do have sympathy for the 'bad programmers', it isn't always easy to do a good job on the first pass, especially in unfamiliar environments.

    8. Re:Whoa 1.3x by Anonymous Coward · · Score: 0

      That's what about 1/10,000th of what hiring a good programmer would get you, at the price of not being to find any programmers.

      Sheesh. People will say and believe any old shit just so long as it agrees with their opinions.

    9. Re:Whoa 1.3x by Anonymous Coward · · Score: 2, Insightful

      ""10 years experience" - keep in mind time at a university counts for work experience."

      On what planet? University time counts for work experience about as much as work experience counts for university time.

      If you told me you had 4 years Java experience because you were in school studying CS for 4 years I'd laugh in your fucking face and tell you to get the fuck out.

    10. Re:Whoa 1.3x by rrr00bb5454 · · Score: 1

      Bad algorithms are the major difference between a totally self-taught programmer and a programmer who has learned some actual computer science. Yes, "1000x speedup" is not ridiculous at all. Use the wrong algorithm, and you can make this speedup number as large as you want by feeding it a larger data set.

    11. Re:Whoa 1.3x by gordo3000 · · Score: 1

      just wondering, what in the world could you possibly be doing that was originally designed at 1/100,000th of optimal and relevant?

      I mean, I've done this before. I had to generate all the legit ticker symbols for derivatives on futures, and just to understand the rules I wrote code for that. Now, I could have built a config file from that code that would have sped up the "generation" portion by 10,000x I'm sure. But the thing is, all it cost me was about 3 seconds on initialization of a process that required about 10 minutes to run. So for me, I didn't care as optimization in the guts of the calculations I was doing were far more important (i.e. at one point I was able to take the run time down from 20 minutes to 15 minutes earn on in dev, which was only a 50% speed increase on the relevant section, but far more important than a 10000x speed up on the ticker generation).

    12. Re:Whoa 1.3x by jittles · · Score: 1

      Now hiring Swift programmers. 10 years experience required. /sarcasm.

      Don't worry, I've already updated my resume and linkedin profile to showcase my experience with Swift. I'm now taking appointments to interview me.

    13. Re:Whoa 1.3x by PhilHibbs · · Score: 1

      The most recent one was a custom SQL cursor in Oracle EBS. Add an index, refactor some correlated queries, and create a cut-down version of a complex view that it was using.

      Another of the examples a few years back was where I reimplemented an FTP process to retry each individual step instead of reverting to the first step on failure. Given that each step had about a 50% chance of failure on a bad day, and each script had about 20 steps, it meant that it was failing... (runs calc...) 99.9999% of the time. OK I'm exaggerating a little, maybe it wasn't 50%, and only a few of the jobs had as many as 20 steps, it was about 10 years ago and I forget the details so my ego may be filling in the gaps. But it did mean that we didn't have to have a guy sitting at a screen hitting "Retry" all day long, and we could get file sets deployed in a couple of minutes instead of taking all day. The FTP was being done by a proprietary tool, so I had to implement my own system to parse its manifest.

      And then there was that Excel spreadsheet that was massively bigger than it should have been. Everyone's system ground to a halt every time they openened it. No-one could figure out why it was so big, I spent an afternoon trying the obvious things and gave up. Then inspiration hit me, and I wrote some VBA to look at the number of "shape" objects in each sheet. There were millions of them. Someone had put boxes around a bunch of cells, those boxes had somehow been shrunk down to one pixel and replicated thousands of times, so a quick VBA procedure to delete all box shapes, and bingo, some people could do their jobs again.

      A lot of people don't realise that computers don't behave in the way that we expect - we have an intuitive grasp of the laws of physics, but information is not physical and does not obey the same laws. There are infinities and paradoxes and undeterminables that are hard to understand. Minds that can intuitively navigate this space are few and far between.

  4. New bells and whistles by garote · · Score: 2, Interesting

    I was particularly surprised to see closures appear. So far I've only been using them in Javascript and Perl, but my experience has been that they are about 15% added flexibility for about -40% readability. That is, they make it harder to tell what's going on, more than they reduce development time.

    1. Re:New bells and whistles by angel'o'sphere · · Score: 3, Interesting

      Depends on the language.
      In groovy closures are perfectly readable, as they are in Smalltalk.
      Problem is that closures are often considered second class citizens, hence they get plugged in later nad then they look wiered.

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    2. Re:New bells and whistles by Anonymous Coward · · Score: 1, Informative

      Closures are already in Objective-C, the call them blocks, they have be really usefully, in dealing with multithreading they have been especially usefully.

    3. Re:New bells and whistles by mark-t · · Score: 2

      If closures are making your code harder to understand then you have tried to use them where other techniques would be more appropriate. In the right contexts, closures should greatly enhance readability, not reduce it.

    4. Re:New bells and whistles by Anonymous Coward · · Score: 0

      Closures have been present in Obj-C for many years, under the name "blocks".

    5. Re:New bells and whistles by Anonymous Coward · · Score: 0

      15% added flexibility for about -40% readability

      You're definitely an idiot.

    6. Re:New bells and whistles by jbolden · · Score: 1

      It depends who is using them. People who come from functional language cultures use them all the time and they increase readability tremendously. Essentially you start breaking with imperative concepts, most of the time you don't need to understand order of evaluation / execution.

      Have you ever tried LISP or Haskell or languages where closures are an absolutely standard part of programming, the way say for loops are in the Algol family?

    7. Re:New bells and whistles by Anonymous Coward · · Score: 1

      I like closures, but these days they're as much a fashion statement as anything. That's why most sample code you'll see of them is uses them needlessly while making the code more difficult to unit test to the same level of coverage. It wouldn't surprise me at all if the people designing Swift picked out closures and other trends and then try to reverse engineer a language that could do what they need to have done. Some of what it does is then immediately undercut by other things it has to allow for practicality purposes.

    8. Re:New bells and whistles by phantomfive · · Score: 2

      They're being added everywhere. Java has them now, C#, Python, Scala.......

      If you use them right, they increase readability. Unfortunately they are very, very easy to use in a way that decreases readability.

      --
      "First they came for the slanderers and i said nothing."
    9. Re:New bells and whistles by Anonymous Coward · · Score: 0

      What.are?.you.talking.?about; this.is.?definitely.?readable;

    10. Re:New bells and whistles by Anonymous Coward · · Score: 0

      If your only experience with closures are with Javascript and Perl, of course they obsure things. In other languages, you'll find I think that they make things clearer. JS and Perl are two of the most hard-to-read languages I know anyway.]

    11. Re:New bells and whistles by Tom · · Score: 1

      I've started to use closures in PHP in some places, and they're quite good if used correctly.

      Basically, if you need a short, simple function that you know you will never call from anywhere else, a closure is a good way to do it. With good indendation and enough self-control to actually go and write a proper function when you have more than a few lines, it doesn't make the code any less readable.

      For example:

      public function getActiveUsers() {
          return $this->getUsers()->filter(
              function($entry) {
                  return ($entry->isActive());
              }
          );
      }

      --
      Assorted stuff I do sometimes: Lemuria.org
    12. Re:New bells and whistles by dkf · · Score: 1

      That's a lambda term (i.e., anonymous function) and not a closure. You tend to use them together, but they're formally different. A closure would be having a variable defined in the outer function being accessed and/or updated in the inner one.

      --
      "Little does he know, but there is no 'I' in 'Idiot'!"
    13. Re:New bells and whistles by Xest · · Score: 1

      Part the problem you're probably facing is that closures in Javascript are basically broken by the fact you can't trivially explicitly pass by value or pass by reference. This results in some non-obvious variable capture results that you don't see in many other languages because they're much better designed. The only way to work around them is indeed to use horrendous hacks, to, for example, force creation of a new scope which as you say absolutely destroys readability. See here for example, note that jQuery alleviates some of the issues at least by providing wrappers that hide much of such uglyness:

      http://stackoverflow.com/quest...

      In languages with more sane closure support you can cut out a good few lines of code and a bunch of ugly syntax too from the example there.

      I don't know so much about Perl, but Javascript at least, don't let it put you off anything, it's rarely an example of a language that does anything much well which isn't to say it doesn't work, but that it just inherently forces less readable code than many other languages.

    14. Re:New bells and whistles by Tom · · Score: 1

      Really? That's funny, because in both JS and PHP documentation I've seen this exact construct being referred to as a closure, and in this particular case, it's even in the API documentation of the filter() method of the ArrayCollection class of the Doctrine project. And I just realized I might have been overly specific there.

      --
      Assorted stuff I do sometimes: Lemuria.org
    15. Re:New bells and whistles by shutdown+-p+now · · Score: 1

      Every single modern language has some form of closures and anonymous functions. Even C++ and Java have jumped onto that bandwagon.

      As far as readability goes, it's a matter of getting used to it, IMO. I find map/filter/fold-style code much easier to read these days compared to explicit loops, but then I've been reading and writing this kind of code in mainstream languages for several years now. I suspect that, back in the day, when structured programming was replacing loops+goto, a lot of people had similar complaints about how it reduces readability.

    16. Re:New bells and whistles by flargleblarg · · Score: 1

      The simplest way of differentiating the two is to say that a lambda function is a degenerate case of a closure, right? — A pure, standalone function with no captured variables?

    17. Re:New bells and whistles by garote · · Score: 1

      I didn't know jQuery provided those. Thank you!

    18. Re:New bells and whistles by microbox · · Score: 1

      Then you're not using the correctly. If you understand how to design functional software (i.e., using closures), then you end up with far less code, and much better separation of concerns. Had to spend some time in lisp/scheme to really get it.

      --

      Like all pain, suffering is a signal that something isn't right
    19. Re:New bells and whistles by david_thornley · · Score: 1

      You can do that in C++, but you do have to make sure the variable you've closed over remains valid.

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
    20. Re:New bells and whistles by spiralx · · Score: 1

      Thankfully, the new let keyword for declaring lexically scoped variables will sound the death of the IIFE construct, although in practice you learn to avoid it.

    21. Re:New bells and whistles by Xest · · Score: 1

      Well he's right. Honestly you shouldn't consider the JS and PHP documentation as authoritative for any kind of computer science terminology given that both languages are probably the two worst applications of computer science principles going. PHP doesn't even get transitivity right and JS thinks a language is object oriented even if you can only have two out of three fundamental pillars of OO at once.

      Which isn't to say I'm necessarily trying to slag those languages off, simply making the point that the rigour of computer science isn't something those languages do well. It's largely a cultural thing with those languages - you look at many PHP and Javascript frameworks for example and some of them try and redefine MVC with arguments like "well MVC isn't well defined so we've decided to redefine it as...". This is nonsense, it's a well defined pattern. What they really mean is "We failed comp. sci. 101 but we're not going to let that stop us writing a framework, we don't totally grasp MVC but we're going to do something that we feel is close enough".

      So use those technologies away as much as you wish to, but don't take them as examples of correctness from a comp. sci. point of view.

  5. It's about time by Anonymous Coward · · Score: 1

    Just the other day I was wondering when we'd have another programming language.

    1. Re:It's about time by Anonymous Coward · · Score: 5, Funny

      I can't wait to add this to my résumé.... I already have 2 years of experience with Swift!

    2. Re:It's about time by Anonymous Coward · · Score: 3, Funny

      Oooh, sorry. We're only looking for candidates with at least 5 years of experience with Swift.

    3. Re:It's about time by scheme · · Score: 3, Insightful

      Wow, I happen to meet that requirement. I've been using SWIFT for quite a few years and have done image processing and molecular docking workflows in it./p.

      --
      "When you sit with a nice girl for two hours, it seems like two minutes. When you sit on a hot stove for two minutes, it
    4. Re:It's about time by cheesybagel · · Score: 1

      Apple seems to have reinvented Pascal looking at typed variable declarations.

    5. Re:It's about time by Anonymous Coward · · Score: 0

      I can't wait to ignore your irrelevant Swift experience!

    6. Re:It's about time by phantomfive · · Score: 2

      You joke, but I just added Swift to my linkedIn. Seriously.

      --
      "First they came for the slanderers and i said nothing."
    7. Re: It's about time by Anonymous Coward · · Score: 0

      swift-lang.org != Apple's Swift, FYI.

    8. Re:It's about time by david_thornley · · Score: 1

      Apple liked Pascal. The original MacOS API was essentially Pascal-based.

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
  6. Bret Victor influence? by slacka · · Score: 2

    The live REPL reminds me of Bret Victor, who used to work for apple.
    http://worrydream.com/Apple/

    I hope they take advantage of some of his ideas?
    https://www.youtube.com/watch?...

    1. Re:Bret Victor influence? by Anonymous Coward · · Score: 0

      That people immediately think about Bret just shows how much the world has forgotten about interactive languages. There's been Logo, Smalltalk, Smalltalk-esque languages like Squeak, various BASICs, etc., etc. Lots of game scripting languages that are run "live" all the time, too. The really cool stuff that Bret showed that goes beyond just a live REPL isn't in Swift.

  7. Who designed this, and what drugs were they on? by shutdown+-p+now · · Score: 4, Interesting

    "Immutability has a slightly different meaning for arrays, however. You are still not allowed to perform any action that has the potential to change the size of an immutable array, but you are allowed to set a new value for an existing index in the array. This enables Swift’s Array type to provide optimal performance for array operations when the size of an array is fixed."

    i.e. Swift arrays that are "immutable" actually aren't. Way to rewrite the dictionary. But wait, it gets worse. Here's for some schizophrenia.

    "Structures and Enumerations Are Value Types. A value type is a type that is copied when it is assigned to a variable or constant, or when it is passed to a function. Swift’s Array and Dictionary types are implemented as structures."

    So far so good. I always liked collections that don't pretend to be any more than an aggregate of values, and copy semantics is a good thing in that context (so long as you still provide a way to share a single instance). But wait, it's all lies:

    "If you assign an Array instance to a constant or variable, or pass an Array instance as an argument to a function or method call, the contents of the array are not copied at the point that the assignment or call takes place. Instead, both arrays share the same sequence of element values. When you modify an element value through one array, the result is observable through the other. For arrays, copying only takes place when you perform an action that has the potential to modify the length of the array. This includes appending, inserting, or removing items, or using a ranged subscript to replace a range of items in the array"

    Swift, a language that is naturally designed to let you shoot your foot in the most elegant way possible, courtesy of Apple.

    1. Re:Who designed this, and what drugs were they on? by mbkennel · · Score: 3, Interesting


      That is bizarre. So if you see a function signature which takes an array as a parameter, you either do know that elements will be changed, or will not be changed---but only depending on potentially hidden implementation of that function?

      And which things have the 'potential to modify' the length of an array? Implementation defined?

      Fortran 90+ had it right. You just say for each argument whether the intent is data to go 'in' (can't change it), 'out' (set by implementation), or 'inout', values go in, and may be modified.

    2. Re:Who designed this, and what drugs were they on? by shutdown+-p+now · · Score: 3, Informative

      And which things have the 'potential to modify' the length of an array? Implementation defined?

      It's defined by the operations on the array. Basically, appending, inserting or removing an element would do that, but subscript-assigning to an element or a range will not.

      Fortran 90+ had it right. You just say for each argument whether the intent is data to go 'in' (can't change it), 'out' (set by implementation), or 'inout', values go in, and may be modified.

      Funnily enough, they do actually have in/out/inout parameters in the language.

      Note however that the story for arrays here does not apply only to parameters. It's also the behavior if you alias the array by e.g. assigning it to a different variable. So it's not fully covered by parameter passing qualifiers.

    3. Re:Who designed this, and what drugs were they on? by Anonymous Coward · · Score: 0
    4. Re:Who designed this, and what drugs were they on? by The+Snowman · · Score: 2

      I don't agree with the decisions either. However, it is consistent with Java. Like it or don't like it, Java is popular and its semantics are well-known.

      --
      24 beers in a case, 24 hours in a day. Coincidence? I think not!
    5. Re:Who designed this, and what drugs were they on? by Anonymous Coward · · Score: 0

      That's irrelevant to real-world programming. Even a factor of 2 overhead over mutable arrays is totally unacceptable in numerical computing.

    6. Re:Who designed this, and what drugs were they on? by Anonymous Coward · · Score: 0

      Swift, a language that is naturally designed to let you shoot your foot in the most elegant way possible, courtesy of Apple.

      My favourite part was the bit near the end of the developer documentation where they describe how to arbitrarily define your own custom operators, giving an example of how you can define a postfix triple-plus +++ operator to double the length of a Vector2D through a reference.

      Yeah.

    7. Re:Who designed this, and what drugs were they on? by Anonymous Coward · · Score: 0

      My favorite syntactic sugar has to be how they manage to take Obj-C's method calls and make them uglier -- e.g., let's say you're hard-code passing the numbers 1, 2, 3 to a method with 3 arguments:

      object.method(1, argumentName2: 2, argumentName3: 3)

      You wrap the call in parens, put the variable names inside the parens -- except for the first variable, because leaving its name out is completely intuitive and not a bizarre remnant of Obj-C -- and yet they kept function simple as in C.
       
      Just behind that is having types come after the rest of variable/constant/function/method declarations. It's one of those things that I suspect comes from the scripting world, where distinguishing the type of code to follow is important so script-kids can keep their files hideously disorganized.

    8. Re:Who designed this, and what drugs were they on? by jbolden · · Score: 1

      Good catch! They are super explicit about this though in their documentation: https://developer.apple.com/li...

      They have a neat operator unshare (i.e. b.unshare()) which means that b's copy is unique.

    9. Re:Who designed this, and what drugs were they on? by ndykman · · Score: 1

      Proving again that language design is just plain hard. It's fine to make decisions and compromises if they are really well thought out ones.

    10. Re:Who designed this, and what drugs were they on? by Anonymous Coward · · Score: 0

      If an array is just a list of pointers to memory addresses, then so long as you aren't changing the memory addresses it is immuted.

    11. Re:Who designed this, and what drugs were they on? by harperska · · Score: 1

      I wonder if including the first argument's variable name is an option, and just done in the silly style in the examples because the developer guide was written by ObjC developers who are just used to doing it that way.

      I have often wished that somehow including the variable names in method calls was an option in Java, etc.

      object.methodThatDoesSomething("blah", 42, true);

      gives no hint as to what "blah", 42, and true actually mean in context, so you are dependent on the documentation being up to date to know what the arguments do.

      object.methodThatDoesSomething(printString: "blah", waitSeconds: 42, crashAfterExecution: true);

      makes it much more obvious at a glance what the code is doing.

    12. Re:Who designed this, and what drugs were they on? by Anonymous Coward · · Score: 0

      Luckily the end goal of language design was already achieved in Haskell.

    13. Re:Who designed this, and what drugs were they on? by Anonymous Coward · · Score: 0

      I think they should all be optional. I personally have always liked the Obj-C self-documenting calls, while I know other people hate the inevitable wordiness involved. If function calls aren't ever self-documenting, why are method calls forced to be -- but not fully? It's bizarre and seems like it's not been thought through, which is scary considering how visible of an issue it is.
      (Same AC as above.)

    14. Re:Who designed this, and what drugs were they on? by shutdown+-p+now · · Score: 1

      My gripe is not about mutable arrays per se. It's about this strange duality whereby the length of the array is somehow disconnected from its contents.

    15. Re:Who designed this, and what drugs were they on? by shutdown+-p+now · · Score: 1

      I don't see what this has to do with the described behavior. For one thing, theirs is the reverse - if you change the elements (i.e. the pointers in your example), it's considered not mutated, but the moment you add a new pointer or remove one it is. For another, their arrays aren't arrays of pointers when they hold value types.

    16. Re:Who designed this, and what drugs were they on? by shutdown+-p+now · · Score: 2

      VS has allowed for the worst programmers to get away with egregious stupidity for a long time because the preprocessor would "fix" garbage code

      I don't know what your definition of "preprocessor" is, but it clearly isn't the common one because no matter how I try to parse the above, it makes zero sense.

      Of course, the fact that VS is not a language, whereas Swift is, is also kinda telling.

    17. Re:Who designed this, and what drugs were they on? by shutdown+-p+now · · Score: 1

      Well yes, naturally, PL design is still an actively developing field. And I would understand the quirks if they were actually designing a bleeding edge language; but they're not, that's the saddest part. If you look closely at what they have to offer, it's pretty close to Kotlin or the upcoming C# 6. There's nothing innovative neither about the semantics nor syntax, it's all stuff that has already been tried in other experimental languages for the last decade, and in other mainstream languages for half that. That's why it's so surprising that they go out of their way to deliberately mess up something that's already reasonably well designed in other languages and time-tested.

    18. Re:Who designed this, and what drugs were they on? by shutdown+-p+now · · Score: 2

      No, it is not consistent with Java. In Java, you can't change the size of the array, period. If you want a dynamically resizable collection, you use an ArrayList. Here, they have conflated the two together, and then added strange copy-on-write semantics that is triggered by operations that are unique to ArrayList, but not by those that are shared between it and array. There's nothing even remotely similar to that in Java - arrays are just passed by reference, and so are ArrayLists, and if you can mutate it, that mutation is seen by the caller.

    19. Re:Who designed this, and what drugs were they on? by shutdown+-p+now · · Score: 2

      That part of it kinda sorta makes sense for someone coming from ML background, I suppose. I've seen other languages do similar.

      Though I think that Scala really did arrive at the clearest concise syntax for this distinction: "var" is a (mutable) variable; "val" is an (immutable) value. They're also similar enough that it's clear that the concepts are closely related in practice.

    20. Re:Who designed this, and what drugs were they on? by shutdown+-p+now · · Score: 1

      I wonder if including the first argument's variable name is an option, and just done in the silly style in the examples because the developer guide was written by ObjC developers who are just used to doing it that way.

      It's not an option unless you intentionally change your method declaration to allow for that.

      They have this concept called "external parameter name", which, when specified, requires the parameter to be explicitly named when calling. This is actually distinct from the name of the variable to which the passed value is bound inside the function, although there's syntactic sugar to combine the two. Now, for functions, all this stuff is explicit - there's no external parameter name unless you specify one (except for default parameters, which automatically get one). For methods, however, only the first parameter is like that, and all others get implicit external names. So if you define a method like:

      func incrementBy(amount: Int, numberOfTimes: Int)

      then "amount" has no external name, but "numberOfTimes" does, and hence the call must look like:

      o.incrementBy(x, numberOfTimes: y)

      If you want to require the name for the first one, you use the same syntax as for regular functions, prepending a hash to the name to auto-generate an identical external name:

      func incrementBy(#amount: Int, numberOfTimes: Int)

      If you want to omit the name for the second one, you can suppress it with the explicit external naming syntax:

      func incrementBy(amount: Int, _ numberOfTimes: Int)

      Here "_" is the external name. It's also the magic identifier that seems to denote "no name" in the language in various contexts, so here it basically suppresses the # that would otherwise be implied.

      And yes, their rationale for this is basically to match behavior with Obj-C:

      Methods in Swift are very similar to their counterparts in Objective-C. As in Objective-C, the name of a method in Swift typically refers to the method’s first parameter using a preposition such as with, for, or by, as seen in the incrementBy method from the preceding Counter class example. The use of a preposition enables the method to be read as a sentence when it is called. Swift makes this established method naming convention easy to write by using a different default approach for method parameters than it uses for function parameters.

      Specifically, Swift gives the first parameter name in a method a local parameter name by default, and gives the second and subsequent parameter names both local and external parameter names by default. This convention matches the typical naming and calling convention you will be familiar with from writing Objective-C methods, and makes for expressive method calls without the need to qualify your parameter names. ...

      The default behavior described above mean that method definitions in Swift are written with the same grammatical style as Objective-C, and are called in a natural, expressive way.

    21. Re:Who designed this, and what drugs were they on? by The+Snowman · · Score: 1

      If you declare a Java array as final, you can still modify its contents. You just cannot change its size regardless.

      --
      24 beers in a case, 24 hours in a day. Coincidence? I think not!
    22. Re:Who designed this, and what drugs were they on? by shutdown+-p+now · · Score: 2

      Java array is a reference type, so you're not declaring the array as final - you're declaring the reference to that array as final. Here, they're claiming that their arrays are value types.

      And there's still nothing equivalent to copy-on-write behavior that they do for arrays when they're copied. Again, in Java, if you copy a value of array type, you just copied a reference - any changes to the actual array object will be seen through either reference. Ditto with ArrayList. In Swift, though, if you copy an array, it will behave as a reference copy, right up until the moment where you resize it somehow (by e.g. adding an element) - and then it is implicitly copied, and now you have two separate arrays where no mutations are observable through the other one.

    23. Re:Who designed this, and what drugs were they on? by Anonymous Coward · · Score: 0

      Well, that's going to be a debugging disaster for coders from Japan.

    24. Re:Who designed this, and what drugs were they on? by AuMatar · · Score: 1

      Making it two keywords with one letter difference between them is completely braindead and sure to make more errors than the feature saves. Imagine if we all used types numf numd numi numl nums for float double int long and short. It would be really easy to miss a 1 letter difference slip in. Its harder to confuse long with short. Now making a new keyword like "immutable" that means no fields of the object can change at all- that might make some sense.

      --
      I still have more fans than freaks. WTF is wrong with you people?
    25. Re:Who designed this, and what drugs were they on? by shutdown+-p+now · · Score: 1

      Well, you definitely don't want the keyword to be "immutable", since you generally do want to encourage immutability by default. Something like "mutable" (or maybe even shortened to "mut", like Rust does) is better.

    26. Re:Who designed this, and what drugs were they on? by Tom · · Score: 2

      I completely fail to see what your problem is.

      Immutable arrays are defined exactly the same in several other languages. If you want an array of constants, you need to defined its contents as constants, not just the array itself. It's good behaviour to give you this choice.

      Same for collections passed by reference. Again, several other programming languages do it exactly this way, implicitly passing collections by reference because collections can become large and implicitly copying them every time you touch them would be a performance nightmare. If you want a copy, clone or whatever it's called in your favorite language, you simply tell the language so and you're good.

      --
      Assorted stuff I do sometimes: Lemuria.org
    27. Re:Who designed this, and what drugs were they on? by shutdown+-p+now · · Score: 3, Informative

      You completely miss the point.

      Regarding immutability, it's not about an array of constants. It's about an immutable array - as in, an array which has its content defined once, and not changed afterwards. They actually do use the term "immutable" for this, and this is what it means in any other language. It's also what it means in Swift - for example, an immutable dictionary cannot be mutated at all, neither by adding or removing elements to it, nor by changing a value associated with some existing key. The only special type here is array, for which immutability is effectively redefined to mean "immutable length, mutable contents" - which is a very weird and counter-intuitive definition when the word "immutable" is involved (e.g. in Java you also can change elements of an array but cannot add new ones - but this is the rule for all arrays in Java, and it doesn't call that "immutable"). The fact that there's no way to have a truly immutable array is just icing on the cake.

      And they don't pass collections by reference. They say that value types are passed by value (duh), and that both dictionaries and arrays are value types (unusual, but ok). But then they completely redefine what copying an array means, with a very strange copy-on-write semantics whereby they do implicitly copy them if you touch them "in the wrong way" (e.g. by appending an element), but not if you touch them in the "right way" (e.g. by mutating an existing element). Again, this magic is utterly specific to arrays - for dictionaries, they behave like true value types at all type, and use full-fledged copy-on-write under the hood to avoid unnecessary copies - so if you "touch" a dictionary in a way that mutates it, it makes a copy, and it doesn't matter how you do so - by inserting a new key-value pair or by changing a value for an existing key. Not only this is very much non-orthogonal (why make copying of arrays and dictionaries so different?), the behavior that's defined for arrays just doesn't make any sense in distinguishing between various ways to mutate them.

    28. Re:Who designed this, and what drugs were they on? by Anonymous Coward · · Score: 0

      Anyone who uses scheme just facepalmed.

    29. Re:Who designed this, and what drugs were they on? by Anonymous Coward · · Score: 0

      Luckily the end goal of language design was already achieved in Haskell.

      And then they went and ruined it all by naming it after that kid nobody liked in Leave It To Beaver.

    30. Re:Who designed this, and what drugs were they on? by Anonymous Coward · · Score: 0

      Yes, yes it is. That is exactly what it means in math. If you say "Let Z be the group of integers under addition", then you bloody well shouldn't let it be anything else at a later point.

    31. Re:Who designed this, and what drugs were they on? by Anonymous Coward · · Score: 0

      i.e. Swift arrays that are "immutable" actually aren't

      Sounds pretty much like java or c# or eleventy dozen other non-functional languages. Suck is life.

    32. Re:Who designed this, and what drugs were they on? by gnupun · · Score: 1

      "Immutability has a slightly different meaning for arrays, however. You are still not allowed to perform any action that has the potential to change the size of an immutable array, but you are allowed to set a new value for an existing index in the array. This enables Swiftâ(TM)s Array type to provide optimal performance for array operations when the size of an array is fixed."

      Maybe the reference to the array is immutable, but its contents are mutable. What's the syntax for immutable reference and immutable contents?

    33. Re:Who designed this, and what drugs were they on? by Anonymous Coward · · Score: 0

      It is also consistent with C.

    34. Re:Who designed this, and what drugs were they on? by Anonymous Coward · · Score: 0

      I disagree. The overhead is probably closer to 10, but if a language normally exposes immutable types, having one (even claiming to be immutable) differ is a recipe for disaster as the GP pointed out. There's no reason you can't have both (Standard ML has vector/array, Java has String/StringBuffer) when one needs added performance. And iPhones/iPads are not traditionally used for numerical computing.

    35. Re:Who designed this, and what drugs were they on? by Tom · · Score: 1

      Maybe I'm just to used to pointers and stuff, but I still fail to see what the fuss is all about. The behavior you describe is the exact behavior I would expect. To me, all of this is totally intuitive.

      --
      Assorted stuff I do sometimes: Lemuria.org
    36. Re:Who designed this, and what drugs were they on? by shutdown+-p+now · · Score: 1

      Arrays are claimed to be value types (see the quoted paragraph again), so there's not supposed to be a reference.

      And even if there were, it still doesn't explain this logic. Appending an element should then similarly mutate the array object while leaving the reference untouched - it shouldn't be any different from changing an existing element (note that append is actually a method on the array).

    37. Re:Who designed this, and what drugs were they on? by shutdown+-p+now · · Score: 1

      Neither Java nor C# has immutable arrays in the first place.

    38. Re:Who designed this, and what drugs were they on? by shutdown+-p+now · · Score: 1

      I'm also used to pointers and stuff, which is why I don't want any magic. If it's a reference type, fine, call it a reference type and require explicit copying. If it's a value type, then it should behave like one. It shouldn't behave like value type if you do this, and like a reference type if you do that, and silently (! didn't you just object to that a post above) copy the data on some writes but not others.

      I don't know any other language that does it that way.

    39. Re:Who designed this, and what drugs were they on? by Anonymous Coward · · Score: 0

      The end goal is to be useful so, no, haskell failed it.

    40. Re:Who designed this, and what drugs were they on? by shutdown+-p+now · · Score: 2

      By the way, it might be the case where showing how it behaves explains the strangeness better than trying to describe it. Have a look, and note how changes either are or aren't reflected across "copies".

    41. Re:Who designed this, and what drugs were they on? by ahabswhale · · Score: 2

      I don't see what the big deal is. If you modify the size of an array, regardless context, you get a different array. Not exactly a brain buster.

      --
      Are agnostics skeptical of unicorns too?
    42. Re:Who designed this, and what drugs were they on? by shutdown+-p+now · · Score: 1

      What is the purpose of such semantics? Why is modifying the size of the array a special action that triggers COW, but modifying an element is not?

      The brain buster is that no other language does it that way.

    43. Re:Who designed this, and what drugs were they on? by ahabswhale · · Score: 1

      So they're only allowed to do things that other languages have done? Also, given that there's literally thousands of languages, you can be certain that at least one other language has done this.

      As for CoW semantics, there's no such thing as a mutable array. Even languages that offer such a construct (like Ruby) are just hiding the mechanics they use to reallocate memory. Swift is essentially exposing this to the developer. I agree it's a bit odd but not the end of the world. There are a millions worse things in languages that are very popular.

      --
      Are agnostics skeptical of unicorns too?
    44. Re:Who designed this, and what drugs were they on? by AuMatar · · Score: 1

      Hugely disagree with this. Only those objects that need to be immutable should be- forcing creation of new objects is highly inefficient. Yes, it can help around threads, but not as much as its proponents tout, and multithreading isn't necessary for the vast majority of programs. So the default should definitely be mutable.

      --
      I still have more fans than freaks. WTF is wrong with you people?
    45. Re:Who designed this, and what drugs were they on? by ndykman · · Score: 1

      Agree completely. What wasn't clear from my comment is that I don't think Apple really thought out some of these decisions to the level needed and ended up with weirdness that doesn't need to be there.

    46. Re:Who designed this, and what drugs were they on? by shutdown+-p+now · · Score: 1

      So they're only allowed to do things that other languages have done?

      No, of course not. But they shouldn't change the well-established semantics of something for no good reason. Especially when the new semantics makes zero sense and is likely to result in hard-to-track bugs.

      As for CoW semantics, there's no such thing as a mutable array. Even languages that offer such a construct (like Ruby) are just hiding the mechanics they use to reallocate memory.

      Um, what?

      int x[3]; // mutable array
      x[0] = 123; // mutate it

      What you said makes some sense if by "mutable" you only mean appending elements (which doesn't make sense in and of itself, but okay). However, there is a well-established treatment of this. Either the language simply doesn't let you do that to an array, and then offers a separate type for dynamically resizable arrays (like e.g. Java), or it does let you do that and handles everything transparently and with no surprises. Swift seems to be trying to sit on both chairs at once, and does it equally bad: they conflate the size-immutable and size-mutable arrays into a single type, which does have the complete set of operations for a size-mutable array, but the moment you start actually using them, it basically changes the semantics to a true value type - not just for this operation, but for all future mutating operations on an array.

      And yes, it is really, really bad. The problem is that a simple change in the body of the function, from assigning to an existing element to adding a new one, completely changes the behavior of all other operations through the same array "reference" (because now it's no longer shared with the caller, even the non-mutating operations will behave differently since they'll no longer reflect any changes to the original array). What's worse is that this change of behavior is silent and non-fatal - your code won't stop working, it will just work differently. This is a recipe for easy to make but hard to diagnose bugs. Doing this in the most frequently used collection type in the language is disastrous.

    47. Re:Who designed this, and what drugs were they on? by shutdown+-p+now · · Score: 1

      I would argue that most locals, and most fields of objects in OO code, are "immutable in practice" (i.e. only assigned once and never change). Note that this was about variables, not about objects per se - in a language with implicit references, like Java, it would mean that references are immutable rather than objects.

    48. Re:Who designed this, and what drugs were they on? by ahabswhale · · Score: 1

      Sorry, I should have been more clear. I meant mutability in the sense that while the values in an array can change, the structure cannot.

      As for how bad it is, I'm not that concerned. If you're using functional paradigms regarding values, this just isn't an issue at all. Functions shouldn't be modifying passed in structures in the first place. That's just a horrible, albeit common, coding practice.

      --
      Are agnostics skeptical of unicorns too?
    49. Re:Who designed this, and what drugs were they on? by shutdown+-p+now · · Score: 1

      Well, if you're using functional paradigms, then a language where the single most common collection type is mutable (and cannot be made fully immutable even by explicitly declaring it as immutable) is clearly a bad choice, and you need something like Haskell or F#, where collections are designed around immutability (and hence e.g. insert on a list actually returns a new list). Here, your code might not mutate it, but some other code might.

    50. Re:Who designed this, and what drugs were they on? by ahabswhale · · Score: 1

      One doesn't always get to choose their language. I spend most of my time in Java but it doesn't mean I don't apply functional paradigms where I can.

      --
      Are agnostics skeptical of unicorns too?
    51. Re:Who designed this, and what drugs were they on? by geekoid · · Score: 1

      Oh, we're Sooooo sorry you don't know how to engineer and need code that holds your hand.
      Here, maybe this is your speed:
      http://office.microsoft.com/en...

      and set a new value for an existing index of an array doesn't mean the arrays state will change. hence immutable.

      --
      The Kruger Dunning explains most post on /. http://en.wikipedia.org/wiki/Dunning%E2%80%93Kruger_effect
    52. Re:Who designed this, and what drugs were they on? by geekoid · · Score: 1

      Eer aptal

      Intuitive isn't it? it's almost like you have to learn the language.

      --
      The Kruger Dunning explains most post on /. http://en.wikipedia.org/wiki/Dunning%E2%80%93Kruger_effect
    53. Re:Who designed this, and what drugs were they on? by geekoid · · Score: 1

      immutable is about state change from an external point of view.

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

      --
      The Kruger Dunning explains most post on /. http://en.wikipedia.org/wiki/Dunning%E2%80%93Kruger_effect
    54. Re:Who designed this, and what drugs were they on? by shutdown+-p+now · · Score: 1

      Oh, we're Sooooo sorry you don't know how to engineer and need code that holds your hand.

      I don't need a language that holds my hand. But if it does that, then it should at least do that right.

      and set a new value for an existing index of an array doesn't mean the arrays state will change

      Care to explain your definition of "state" then? By any one that I know of, the state of the array includes its elements. Indeed, since the array is just an aggregate of elements, by definition, what else could the state of the array possibly be?

    55. Re:Who designed this, and what drugs were they on? by Anonymous Coward · · Score: 0

      Copy on Write. COW.

      This involves good multi-threaded design an implementation. Since you are a Java developer I don't expect you to understand what that is.

    56. Re:Who designed this, and what drugs were they on? by shutdown+-p+now · · Score: 1

      Sure, and the external view of the array includes its elements - if the array couldn't have its elements inspected by the code outside of the array type, it wouldn't be a particularly useful array class, would it?

      Note also that Swift reinforces the notion that elements are the state of the array by e.g. defining array equality in terms of element equality (so a==b will actually do an element-by-element comparison). If equality of value objects doesn't include their state, that's a pretty weird definition of either equality or state...

    57. Re:Who designed this, and what drugs were they on? by shutdown+-p+now · · Score: 1

      I know what copy-on-write is. That's why I also know that a[i]=x is a write, and therefore should trigger a copy in any sane COW implementation - which is not what we have here.

      And no, I'm not a Java developer.

    58. Re:Who designed this, and what drugs were they on? by phantomfive · · Score: 1

      Well in that case, Objective-C is just as intuitive

      --
      "First they came for the slanderers and i said nothing."
    59. Re:Who designed this, and what drugs were they on? by AuMatar · · Score: 1

      I'm not certain I agree with your argument that most of those a write once, but let's ignore that and pick apart the individual points here/

      Locals- maybe, but as those tend to be stack objects making them immutable doesn't matter. Immutability is only a benefit if you're accessing it through 2 threads, which rules out locals.

      References- if the object the reference points to isn't immutable, the entire point of doing it to begin with is pretty much lost. Immutable references to mutable objects won't fix any threading issues, so there's no reason to do it.

      --
      I still have more fans than freaks. WTF is wrong with you people?
    60. Re:Who designed this, and what drugs were they on? by shutdown+-p+now · · Score: 1

      I'm not certain I agree with your argument that most of those a write once

      I'm not claiming to have any hard data on this. Then again, this might be just the kind of project to dip my toes into Roslyn - scan C# code on GitHub and see how many locals & fields could be declared readonly without any change in the meaning of the code.

      Locals- maybe, but as those tend to be stack objects making them immutable doesn't matter. Immutability is only a benefit if you're accessing it through 2 threads, which rules out locals.

      While multithreading and other forms of concurrency gain the most from immutability, there are benefits to be had elsewhere, as well. In case of locals, their unnecessary reuse hampers readability, especially in longer methods. Also, people tend to do things like declare an object of a given type, and use it for completely unrelated things, and because of that its name has nothing to do with how it's used. When locals default to immutable, it encourages introducing a new local for a new value even when there was another one of the same type in scope, and naming that new local in accordance with what it actually represents - which, in my experience, leads to more readable code.

      References- if the object the reference points to isn't immutable, the entire point of doing it to begin with is pretty much lost. Immutable references to mutable objects won't fix any threading issues, so there's no reason to do it.

      Immutable references obviously don't fix any issues with immutability of objects that they reference, but they do fix issues with the mutation of references themselves. Again, I often find it useful to look at a declaration of the field, see "readonly" followed by an initializer, and know that this is always the same object, never substituted for another - it makes it easier to reason about the possible states of that object. In the simplest case, an immutable field with an initializer that is "new ..." is never going to be null.

    61. Re:Who designed this, and what drugs were they on? by Anonymous Coward · · Score: 0

      In the latter there's "readonly", which is pretty much useless for arrays for this reason.

    62. Re:Who designed this, and what drugs were they on? by shutdown+-p+now · · Score: 1

      It's useless for any reference types (so all collections), since it makes just the reference itself readonly.

      But .NET does have true immutable collections with functional updates these days.

    63. Re:Who designed this, and what drugs were they on? by Anonymous Coward · · Score: 0

      It should be intuitive to anyone who has ever come in contact with mathematics. Let i = 5 in mathematics means that i is equal to 5 now and forever, and wherever you see i you can change to 5. It's called referential transparency. I think it's quite intuitive for 10 year olds which never had contact with (imperative) programming.

    64. Re:Who designed this, and what drugs were they on? by BasilBrush · · Score: 1

      Chris Lattner, the guy who developed LLVM and Clang developed this language, starting 4 years ago, and it's since been kicked around by the developer tools team at Apple.

      I'm pretty sure those people over 4 years thought it out better than you and the other guy did in a day.

      I don't know what the reason for the decision is either, as like everyone else I'm just coming to grips with the language. But for sure there will be a reason. It won't be lack of knowledge or experience of the language designers.

    65. Re:Who designed this, and what drugs were they on? by BasilBrush · · Score: 1

      Arrays are part of the standard library, not the language.
      Swift is in Beta.
      Apple isn't promising source code compatibility during the beta phase.

      So the peculiarities of array mutability may well be fixed before a real v1.0 release.

    66. Re:Who designed this, and what drugs were they on? by shutdown+-p+now · · Score: 1

      Arrays are part of the standard library, not the language.

      The immutability semantics is part of the language ("var" vs "let"), which is what is relevant here.

    67. Re:Who designed this, and what drugs were they on? by BasilBrush · · Score: 1

      Let works rationally with other standard library values, so it seems more likely the issue is with the implementation of arrays.

  8. Yet another C variant? by mikein08 · · Score: 2, Insightful

    Just what we need! Better compilers is what we really need, but that apparently is too difficult.

    1. Re:Yet another C variant? by Anonymous Coward · · Score: 1

      'Swift seems to get rid of Objective C's reliance on defined pointers; instead, the compiler infers the variable type, just as many scripting languages do.

      Just what we don't need, an easier way to write buggy code.

    2. Re:Yet another C variant? by Shag · · Score: 3, Informative

      They've already got LLVM and Clang, no? Or did you mean better than those?

      --
      Village idiot in some extremely smart villages.
    3. Re:Yet another C variant? by camperdave · · Score: 2

      Just what we don't need, an easier way to write buggy code.

      Exactly! Who, besides the Amish, need buugy code? What we need is self driving automobile code.

      --
      When our name is on the back of your car, we're behind you all the way!
    4. Re:Yet another C variant? by Anonymous Coward · · Score: 0

      No, Apple already did that –that's why we have clang.

    5. Re:Yet another C variant? by Anonymous Coward · · Score: 0

      LLVM has (or rather, had, gcc caught up) better diagnostics, but code generation is still atrocious in any compiler.
      In fact LLVM is miles and miles behind gcc if you compile for anything other than x86 (and maybe it finally started producing acceptable code for ARM, but beyond that it's a joke).

    6. Re:Yet another C variant? by Anonymous Coward · · Score: 0

      There's different ways of inferring typing: static and dynamic. With static automatic typing, the types is inferred and checked. Variables cannot change type This can be very powerful. You don't have any (except the simplest) automatic conversions. It's most likely what they do, as this language smells very much like an at least semi-functional language. The focus on constant values reinforces this.

      Scripting languages don't; they just convert the types of values and variables can change type during an execution.

  9. Swift Programmers Wanted by the+eric+conspiracy · · Score: 4, Funny

    Must have 5 years experience.

    1. Re:Swift Programmers Wanted by AnontheDestroyer · · Score: 1

      And XML, how many years do you have with that?

    2. Re:Swift Programmers Wanted by HornWumpus · · Score: 3, Funny

      Good news; I've got over 20 years experience. (bullshitting my way into positions with languages I don't know. Then learning fast.)

      Guaranteed results...'I can guarantee anything you want.' Bender

      --
      John McAfee 'It was like that time I hired that Bangkok prostitute; to do my taxes, while I fucked my accountant'
    3. Re:Swift Programmers Wanted by Anonymous Coward · · Score: 0

      too bad,
      Time to catch up!!

    4. Re:Swift Programmers Wanted by bunratty · · Score: 2

      Good news, everyone!

      --
      What a fool believes, he sees, no wise man has the power to reason away.
    5. Re:Swift Programmers Wanted by scheme · · Score: 1

      Given that Swift was released in 2007, 5 years experience is very possible.

      --
      "When you sit with a nice girl for two hours, it seems like two minutes. When you sit on a hot stove for two minutes, it
    6. Re:Swift Programmers Wanted by Anonymous Coward · · Score: 0

      but no more than 7 years 'cause we don't want to pay for senior programmers that are specialized in this language. :P

    7. Re:Swift Programmers Wanted by the+eric+conspiracy · · Score: 2

      The parallel scripting language described at swift-lang.org is NOT the swift language referred to by this article.

      So no, you cannot have 5 years experience in this.

    8. Re:Swift Programmers Wanted by canadiannomad · · Score: 2

      I'm sure in a month, some teams of 60 people will claim to have 5 years combined experience in swift....

      --
      Hmm, the humour and sarcasm seem to have been be lost on you.
    9. Re:Swift Programmers Wanted by Bazman · · Score: 1

      I think the poster knew that, and I also think Apple should have looked a bit harder to see if there was a similar thing with a similar name before naming their language. However I doubt the original swift-lang people are too keen on getting into a legal dispute with Apple.

    10. Re:Swift Programmers Wanted by scheme · · Score: 2

      Apple was aware of swift and gave the project leaders a heads up before WWDC.

      --
      "When you sit with a nice girl for two hours, it seems like two minutes. When you sit on a hot stove for two minutes, it
    11. Re:Swift Programmers Wanted by scheme · · Score: 1

      I'm pretty aware of that since I know most of the developers and project leaders for swift. That sound you heard was the whoosh of the joke going above your head.

      --
      "When you sit with a nice girl for two hours, it seems like two minutes. When you sit on a hot stove for two minutes, it
    12. Re:Swift Programmers Wanted by the+eric+conspiracy · · Score: 1

      You didn't get any Funny mod points for your 'joke'.

      Sounds and looks more like a face plant to me.

  10. Re:and it needs an new OS the mess up other apps by Anonymous Coward · · Score: 5, Funny

    and the comment grammar no sense slashdot article read.

    captcha: verbally. Seriously?

  11. SWIFT programmers by msobkow · · Score: 4, Interesting

    They could have chosen a name other than that of the international banking protocols. Asking for SWIFT programmers is going to get them a bevy of COBOL coders who know the protocol.

    --
    I do not fail; I succeed at finding out what does not work.
    1. Re:SWIFT programmers by Plouf · · Score: 1

      Hey! SWIFT developer here... We are doing all sorts of crazy stuff, but I can tell you COBOL is none of them. We're mostly a Java/C++ shop.

    2. Re:SWIFT programmers by Anonymous Coward · · Score: 0

      Could you maybe use deterministic languages with my money? I know, you can fix it all later, but really?

    3. Re:SWIFT programmers by Anonymous Coward · · Score: 0

      Apple don't care about prior usage, they invent (or copy) things for their own world, and are big enough to get away with it. Get used to it.

    4. Re:SWIFT programmers by unixisc · · Score: 1

      Yeah, now when people ask for SWIFT programmers, don't be surprised if people working in the financial sector turn up w/ their resumes

  12. Designed for safety & performance by bradrum · · Score: 3, Interesting

    I find these two aspects interesting and wonder what the trade off is. Longer compiler times?

    "Designed for Safety
    Swift eliminates entire classes of unsafe code. Variables are always initialized before use, arrays and integers are checked for overflow, and memory is managed automatically. Syntax is tuned to make it easy to define your intent — for example, simple three-character keywords define a variable (var) or constant (let)."

    " Swift code is transformed into optimized native code, "

    1. Re:Designed for safety & performance by Mr+Z · · Score: 1

      Oy, is that how they're selling it? As if none of these features existed before Apple did it?

      Swift code is transformed into optimized native code

      As is any other language that passes through an optimizing compiler that outputs native code. They crowed about a 30% speedup above, which in my experience is sometimes achievable just by tweaking your compiler flags.

    2. Re:Designed for safety & performance by IamTheRealMike · · Score: 1

      Ref counting can be extremely expensive in multi-threaded programs because refcount incs/decs must always be atomic, and they happen a lot. You really don't want to be doing a bus assert every few method calls if you care about speed.

    3. Re:Designed for safety & performance by iluvcapra · · Score: 1

      The Apple people do some significant jiggery-pokery to keep the atomic retainCount mutations down to a minimum in the Objective-C runtime.

      ARC makes a lot of deallocations deterministic and static, I'm not sure of the usage stats but the biggest graphs people have in running applications are usually either their UI View tree or their model object graph, the retain/release calls for the former generally reduces to a malloc/free after static analysis, and the latter lives almost solely in autorelease pools.

      --
      Don't blame me, I voted for Baltar.
    4. Re:Designed for safety & performance by gnasher719 · · Score: 1

      Ref counting can be extremely expensive in multi-threaded programs because refcount incs/decs must always be atomic, and they happen a lot. You really don't want to be doing a bus assert every few method calls if you care about speed.

      Well, Apple has a few years experience with reference counting. An essential part of ARC is to optimise reference counting away when its not needed. And new Intel processors have added some tricks so that an atomic increment/decrement doesn't actually need any bus access when it isn't contented.

  13. Re:and it needs an new OS the mess up other apps by DeathElk · · Score: 1

    It took you 3 minutes to type THAT badly?

  14. Swift Programmers Wanted by Anonymous Coward · · Score: 0

    10 years professional development experience preferable.

  15. None of the baggage of C? by elwinc · · Score: 1, Interesting

    Many sites are reporting Swift as having "none of the baggage of C."

    However, they also report that "Swift code can still be mixed with standard C and Objective C code in the same project."

    Seems to me that if you can call C routines, C can happily malloc() and free() the heap and leave stale pointers into freed heap. Likewise, C can happily point into the stack and leave pointers into stale stack frames, and point past the end of arrays, etc.. I don't think they can get rid of the "baggage of C" withoud building all kinds of performance killiing safety checks into the C code. If I'm wrong about this, please don't hesitate to let me know!

    --
    --- Often in error; never in doubt!
    1. Re:None of the baggage of C? by Anonymous Coward · · Score: 3, Informative

      Yes, Swift itself does not have the baggage of C just like Python does not have the baggage of C. The fact that both languages can interoperate with C does not change that.

    2. Re:None of the baggage of C? by Lunix+Nutcase · · Score: 2

      The statement is talking about if you only write pure Swift. What you describe is really no different than using C code with Java through JNI. But that does not mean Java itself has any C baggage.

    3. Re:None of the baggage of C? by maccodemonkey · · Score: 2

      From what I can tell (I just got out of WWDC and am reading through the docs) it can be bridged to, but not directly called. You can directly call Obj-C methods through the bridge, but not C methods. You'd have to bridge to the Obj-C methods which then call C methods.

      I don't know what happens when that Obj-C method calls malloc and returns some memory for leak-tastic behavior. I still haven't read if or how Swift handles raw memory buffers.

    4. Re:None of the baggage of C? by linearz69 · · Score: 2

      "instead, the compiler infers the variable type, just as many scripting languages do."

      Its safe to say that the baggage will be inferred as well.

    5. Re:None of the baggage of C? by Anonymous Coward · · Score: 0

      Seems to me that if you can call C routines, C can happily malloc() and free() the heap and leave stale pointers into freed heap. Likewise, C can happily point into the stack and leave pointers into stale stack frames, and point past the end of arrays, etc.. I don't think they can get rid of the "baggage of C" withoud building all kinds of performance killiing safety checks into the C code. If I'm wrong about this, please don't hesitate to let me know!

      If you want complete safety, don't link in C code.

      Java, C# and Common Lisp can link to C code. Do you believe those languages have the same level of memory safety as C?

    6. Re:None of the baggage of C? by shutdown+-p+now · · Score: 1

      FWIW, it's not memory safe even when dealing with its own objects. It uses reference counting with explicit weak and "unowned" references to break the cycles. And an unowned reference is basically a weak (i.e. non-refcounted) reference that does not get nulled out when the object dies. So it looks like it's pretty easy to get a dangling reference there.

    7. Re:None of the baggage of C? by elwinc · · Score: 1

      According to https://developer.apple.com/li... Swift includes several C pointer types.

      C Syntax ---- Swift Syntax

      void * ------ COpaquePointer
      Type * ------ UnsafePointer
      Type ** ----- AutoreleasingUnsafePointer

      There are several more C pointer types on that page, but you get the flavor. You can take that C baggage into your room, unpack it, and make it all home-like.

      --
      --- Often in error; never in doubt!
    8. Re:None of the baggage of C? by BasilBrush · · Score: 1

      It's not "the baggage of C" when there is no need to use those UNLESS you are interoperating with C.

  16. Good bye source compatibility by Anonymous Coward · · Score: 1

    It's supplementing the existing Obj-C and C API's, not replacing them.

    I would imagine already existing code will continue to function just fine.

  17. Re:POLUS 4, tROLL) by Anonymous Coward · · Score: 0

    Yeah, I agree. What he said.

  18. Re:and it needs an new OS the mess up other apps by Anonymous Coward · · Score: 4, Funny

    *that poorly.

  19. Whoa 1.3x by Anonymous Coward · · Score: 0

    You know how high level language advocates like to claim that being high level means it can actually be optimized better than a low level language since the compiler knows what you're doing? And you know how it's never actually true? It finally happened.

  20. You think that is the problem? by Ecuador · · Score: 4, Informative

    I mean, there is already a swift programming language. Yes, it is not popular, but when you decide on a name for your language don't you at least google it first? Is "swift" so unbelievably cool that a name collision (even with a "small" entity) does not matter? But, yeah, it is Apple we are talking about, they probably invented the word "swift" which people and companies like SUZUKI have been copying for other uses here and there...

    --
    Violence is the last refuge of the incompetent. Polar Scope Align for iOS
    1. Re:You think that is the problem? by msobkow · · Score: 2

      I just look forward to the organization behind the SWIFT protocols suing Apple into the ground for trying to appropriate a name that already has a well-established meaning in computing. They've certainly got the budget to do it... :)

      --
      I do not fail; I succeed at finding out what does not work.
    2. Re:You think that is the problem? by Anonymous Coward · · Score: 0

      Swift is small, but look at the backers.

    3. Re:You think that is the problem? by toejam13 · · Score: 2

      Google released the Go programming language five years after the Go! programming language was first documented.

      It seems as if large companies only care about intellectual property when it is their own. Imagine that.

    4. Re:You think that is the problem? by Anonymous Coward · · Score: 0

      Bottom of the page: https://developer.apple.com/swift/

      Looking for the Swift parallel scripting language? Please visit http://swift-lang.org

    5. Re:You think that is the problem? by nblender · · Score: 1

      Google is Apple's competitor so obviously they didn't 'google it'...

      They 'Bing'd it.

    6. Re:You think that is the problem? by mrjimorg · · Score: 4, Funny

      No, they Siri'd it. And Siri told them that there was no restaurants in the immediate area with the name swift so they figured they were ok

    7. Re:You think that is the problem? by Anonymous Coward · · Score: 0

      Is "swift" so unbelievably cool that a name collision (even with a "small" entity) does not matter?

      I'm fairly confident in guessing that they don't care 'bout no steenkin' name collisions. When you are the 800 lb gorilla in the cage, are you really going to care about the mouse in the corner objecting that he was here first?

    8. Re:You think that is the problem? by pubwvj · · Score: 1

      Before making comments I would suggest actually going and reading Apple's web page on Swift which links to the other Swift programming language.

    9. Re:You think that is the problem? by BasilBrush · · Score: 1

      If language developers want to have a name that they can keep for themselves, they should invent one, not find a common word from the dictionary.

      Or are we suddenly supposed to have sympathy for Microsoft wanting to adopt the word Windows as their own property.

  21. Dice job postings... by jddeluxe · · Score: 1

    ...with "5 years experience Swift programming" coming from the recruiters in 3, 2, 1...

  22. Somebody post a SWIFT example PLEASE! by Proudrooster · · Score: 2

    I wanted to write apps and tried to learn Objective-C, but as a coder that started with C and then moved on to C++ and PERL (the swiss army chainsaw), the language syntax hurt my ability to read it. In case you don't know what I am talking about, here are some of my learning notes

            myObject.someMethod(); // old school
            [myObject someMethod]; // send a message or call a method

            result = myObject.someMethod(); // old school
            result = [myObject someMethod]; // method returns a result

            result = myObject.someMethod(arg); // old school
            result = [myObject someMethod:arg]; // pass an argument

    You can see the Old School syntax above (which works in Objective-C) and the Objective-C standard syntax below. The square brackets [ ] and colons : just hurt my mental debugger... [ ] and yes I know Objective-C is a Superset of C, so they had to steer clear of the C-Syntax but it just looks wrong. Further, I know that I could write my own style of Objective-C but I wouldn't be able to read the code of others. Apple had to start somewhere and Steve had the NeXT languages ready to go but to me the syntax is ugly and offensive. However, I am ready for a better Apple language.

    I can't wait to see a SWIFT code example, if it gets rid of the NeXT Objective-C Superset Syntax, I might be coding for iPad and Mac sooner than I thought. If anyone has a code example, please share it, I would like to see what a function, method, or message call looks like. Hoping for parenthesis and a Standford iTunesU class. Guardedly excited!

    1. Re:Somebody post a SWIFT example PLEASE! by Proudrooster · · Score: 4, Informative

      Ok, you guys are too slow, I RTFA and downloaded the iBook. So far, I am very much liking the SYNTAX, especially OBJECTS and FUNCTIONS, they even brought the LET keyword in from BASIC. SWIFT will make programming Apple products much easier for the C loving syntax crowd, from what I can see. Ahhh... what a breath of fresh air. Code snippet below of creating an object and exercising it. I feel bad for those that suffered through Objective-C.


      “class Square: NamedShape {
              var sideLength: Double

              init(sideLength: Double, name: String) {
                      self.sideLength = sideLength
                      super.init(name: name)
                      numberOfSides = 4
              }

              func area() -> Double {
                      return sideLength * sideLength
              }

              override func simpleDescription() -> String {
                      return "A square with sides of length \(sideLength)."
              }
      }
      let test = Square(sideLength: 5.2, name: "my test square")
      test.area()
      test.simpleDescription()”

      Excerpt From: Apple Inc. “The Swift Programming Language.” iBooks. https://itun.es/us/jEUH0.l

    2. Re:Somebody post a SWIFT example PLEASE! by jbolden · · Score: 1

      There are code examples in their online documentation plenty: https://developer.apple.com/li...

    3. Re:Somebody post a SWIFT example PLEASE! by GrahamCox · · Score: 0
      The square brackets [ ] and colons : just hurt my mental debugger

      Your example doesn't get to the point and power of Obj-C syntax, which is clarity of intent. Source code is for humans, so make it bloody obvious what you mean.

      C/C++: someObject->setColor(0.4,0.3,1.0,0.5);

      Obj-C: [someObject setColorRed:0.4 green:0.3 blue:1.0 alpha:0.5];

      In the C code, what the hell are all those parameters, what do they mean? I need to look up some external reference to find out. In the Obj-C case, it's obvious, the parameter names are part of the name of the function, so when writing and reading code, the intent is clear. The square brackets are really not an issue once you've used the language for more than 5 minutes, and actually these days they're not even needed for simple properties - you can use the familiar dot notation if you want. Looks like Swift retains the explicit parameter naming, albeit within round brackets, so it's a bit of a hybrid. I'd hate to see named parameters disappear, they really are an invaluable aid to productivity and above all, understanding of a piece of code.

    4. Re:Somebody post a SWIFT example PLEASE! by spitzak · · Score: 2

      Oh come on. It is pretty obvious that you can add named parameters to a C-like syntax without having this weird square bracket stuff:

            someObject->setColor(red:0.4, green:0.3, blue:1.0, alpha:0.5);

      The square brackets are there because the original Objective-C compilier was very primitive. It basically looked for the square brackets, did some manipulation of the text, and passed everything to the C compiler. Pretty much it turned this:

          [someObject method:x]

      into this:

          callMethod(someObject, "method", x)

      Yes they were copied from smalltalk, but in smalltalk all functions used the same syntax. In this case the unnecessary differences in syntax were to make this compiler simple to implement.

    5. Re:Somebody post a SWIFT example PLEASE! by maccodemonkey · · Score: 3, Insightful

      Ok, you guys are too slow, I RTFA and downloaded the iBook. So far, I am very much liking the SYNTAX, especially OBJECTS and FUNCTIONS, they even brought the LET keyword in from BASIC. SWIFT will make programming Apple products much easier for the C loving syntax crowd, from what I can see. Ahhh... what a breath of fresh air. Code snippet below of creating an object and exercising it. I feel bad for those that suffered through Objective-C.

      To be honest, while this snippet is a few lines shorter, it's arguably more complicated than the corresponding Obj-C. It drops returning self in the init, and drops a few lines that would have had to go in to the class definition, but you gain a few unsightly keywords like "override", having to add the keyword "func" to every function, and you gain some more syntactical mess like "->".

      It's not horrible, but I'm not sure this sample is more readable than Obj-C. As others have noted, Swift has the habit of taking the important parts of a function (like what it's named and what it returns, or what name a class is and what it subclasses) and shoving them off to entirely different sides of the function declaration.

    6. Re:Somebody post a SWIFT example PLEASE! by bondsbw · · Score: 1

      As someone who has developed in C# for over a decade, and otherwise mostly programmed in Javascript, Java, Ruby, etc. while only doing very little in Objective-C...

      I don't understand all the hatred for brackets. If anything, it makes the intention clearer as it's much easier to spot message passing vs. function calls than it is to do the equivalent in most mainstream languages.

      There are other reasons I dislike Objective-C, but brackets isn't one of them.

      --
      All my liberal friends think I'm a conservative, all my conservative friends think I'm a liberal.
    7. Re:Somebody post a SWIFT example PLEASE! by drkstr1 · · Score: 2

      I usually just hover my mouse over a function name when I want to see the parameters, and just click into the tooltip to see any additional docs. Writing all those parameter names every time I call a function would drive me bonkers! I get paid to solve problems, not write code.

      --
      Fanboy Status: Apache Flex, C#, Eclipse, KDE, Pirate Party, Ron Paul, Slackware, Windows 7
    8. Re:Somebody post a SWIFT example PLEASE! by Anonymous Coward · · Score: 0

      Fuck me, it's a cross between JavaScript and C++, but with just enough differences to make it not intuitive.
      Oh joy!!!...another pointless language to learn!!!! Because the 100+ existing languages just don't cut the mustard!!!!!
      Fuck you IT!!!!!!

    9. Re:Somebody post a SWIFT example PLEASE! by rdnetto · · Score: 1

      Quite frankly, it looks like a poor man's C#, with some Haskellisms (tuples, -> syntax) thrown in for good measure. I'm sure it's better than Objective C, but it's nowhere near competitive with any of the other recent languages. e.g. Rust*

      * I think Rust is a long way from perfect and has a myopic focus on low-level coding where manual memory management matters, but at least they're doing something interesting.

      --
      Most human behaviour can be explained in terms of identity.
    10. Re:Somebody post a SWIFT example PLEASE! by mfearby · · Score: 2

      It may not measure up to whatever fly-by-night languages to which you might compare it, but it's a MAJOR and LONG OVERDUE replacement for Objective-C, which is the only language any serious Mac developer has had to put up with. I for one welcome our new Swift overlords.

    11. Re:Somebody post a SWIFT example PLEASE! by rdnetto · · Score: 1

      C# is now 14 years old - I highly doubt it can be considered fly-by-night at this point. Not to mention Swift doesn't even achieve feature parity with it - it lacks C#'s variant generics and list comprehensions (which seem to be combined with lazy evaluation and called LINQ in C#).

      My underlying point is, why create a new language? It's justifiable if you're actually trying to add new features or paradigms (e.g. Rust was created so that memory safety could be enforced at compile-time), but otherwise it's just change for the sake of change. It would make more sense to adopt the syntax of an existing language (e.g. Java, C#, C++, etc.) so as to leverage existing users of those languages, rather than requiring them to relearn the semantics. If you need to replace Objective-C, why create a whole new language when there are plenty of perfectly good ones already?

      --
      Most human behaviour can be explained in terms of identity.
    12. Re:Somebody post a SWIFT example PLEASE! by Anonymous Coward · · Score: 0

      You don't write them every time, you type a letter or two, smash enter to pick the autocomplete suggestion (the method you want is almost always the first or second option) and then use tab to jump to the next parameter value to enter.

      In this case, increased verbosity means less rote memorisation and more grokking of the general gist of API patterns so you really can focus more on solving the problem at hand rather than bashing out code.

    13. Re:Somebody post a SWIFT example PLEASE! by gnasher719 · · Score: 2

      To be honest, while this snippet is a few lines shorter, it's arguably more complicated than the corresponding Obj-C. It drops returning self in the init, and drops a few lines that would have had to go in to the class definition, but you gain a few unsightly keywords like "override", having to add the keyword "func" to every function, and you gain some more syntactical mess like "->".

      "override" is a _massive_ improvement. It means you cannot override a superclass method by accident. And you can't try to override a non-existing superclass method by accident.

    14. Re:Somebody post a SWIFT example PLEASE! by gnupun · · Score: 1

      Just two languages? I see Java, C#, Python, ocaml, Pascal, Ada, etc. They've cherry picked a lot of syntax and semantics from a number of languages. I don't see much Javascript in there except for the 'var' declaration.

    15. Re:Somebody post a SWIFT example PLEASE! by countach · · Score: 2, Insightful

      I haven't checked, but its a great idea to have override as a mandatory descriptor (If it is). Java now has @Override, but code quality suffers from it not being compulsory, leading later to subtle bugs. As for func and let, I imagine it makes it easier to make a scripting language to have less ambiguity about what you are trying to declare up front. I mean, without func, would the line "area()" be the start of a declaration, or a call to a function? Sure, you could wait for a semi-colon to finalise the decision, but then you've got to have semi-colons.

    16. Re:Somebody post a SWIFT example PLEASE! by countach · · Score: 1

      I'm sure the design parameters required it to be basically an enhanced Objective-C. Otherwise the entire Cocoa stack and all the libraries would need re-writing from scratch, and that ain't easy. So yeah, it's a bit pointless to compare it to other stuff.

    17. Re:Somebody post a SWIFT example PLEASE! by countach · · Score: 1

      The reason why to create a new language is that the basic model of Objective-C needed to be retained for backwards compatibility. They tried to bolt garbage collection onto Objective-C, and I actually thought it was OK, but I gather they had a lot of problems, and it was buggy. Similarly, Objective-C assumes a lot of things about how objects work and stuff that you can't map precisely to any other language. A compromise, yes. But its never been easy for an OS to support any and every programming language. OSes and their native language tend to be pretty tightly integrated, unfortunately. But if you think the problems are so easy to overcome, feel free to integrate your favourite language on top. I think it won't be easy.

    18. Re:Somebody post a SWIFT example PLEASE! by countach · · Score: 1

      I think there is a bit more to it than merely compiler expediency. Objective-C is very Smalltalk like, and no doubt the designers were inspired. In any case, the compiler can't be too stupid, because square brackets have meaning in C as well.

    19. Re:Somebody post a SWIFT example PLEASE! by angel'o'sphere · · Score: 1

      why create a whole new language when there are plenty of perfectly good ones already?
      That some languages are mainstream does not make them "good".

      Creating new languages is fun, it is in fact a very interesting work (I created about 20 languages).

      Imho the only "good" language(es) out there are SmallTalk (and Prolog). But I say that only because my experience with ML, Miranda, Cml/OCml, Haskell etc. is very limited (and Scala is just PERL for me ... unreadable code). And I find Lisp unreadable/unmaintainable.

      Anyway with modern IDEs I really like Groovy at the moment (but it is to slow for real work ... for my real work). We use it intensively together with Spock for unit testing.

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    20. Re:Somebody post a SWIFT example PLEASE! by Anonymous Coward · · Score: 0

      why create a whole new language when there are plenty of perfectly good ones already?

      Because there aren't that many with good implementations and they aren't going to use Java or C# for incredibly obvious reasons. Rust is the only one that might have made sense but it's not going to be ready for at least another year and it's too low level for what they want anyways.

    21. Re:Somebody post a SWIFT example PLEASE! by countach · · Score: 1

      Errm, as far as I know, in Apple's version of Objective-C you are never supposed to call myObject.someMethod() unless it is an accessor. i.e. it returns a value and has no arguments. In that case, and only in that case it is equivalent to [myObject someMethod]. Your notes look wrong to me.

    22. Re:Somebody post a SWIFT example PLEASE! by Anonymous Coward · · Score: 0

      C#? More like the bastard child of VB and JavaScript.

    23. Re:Somebody post a SWIFT example PLEASE! by RealTime · · Score: 1

      That code looks like the bastard child of Dart and Go.

      --

      Yesterday it worked; today it is not working; Windows is like that...

    24. Re:Somebody post a SWIFT example PLEASE! by shutdown+-p+now · · Score: 1

      So far as I can see, the main reason why this is a new language is because they're trying to preserve their existing memory model, with reference counting as opposed to tracing GCs that most similar new languages use these days. It's a fairly fundamental distinction that manifests itself on all levels, so you can't easily reuse an existing language for that - you'd need to fork it.

    25. Re:Somebody post a SWIFT example PLEASE! by shutdown+-p+now · · Score: 1

      Square brackets actually weren't copied from Smalltalk. The method call syntax was, but in Smalltalk everything was called that way, so special separators weren't needed. Square brackets define a block (i.e. a lambda) in Smalltalk.

    26. Re:Somebody post a SWIFT example PLEASE! by shutdown+-p+now · · Score: 1

      it makes the intention clearer as it's much easier to spot message passing vs. function calls than it is to do the equivalent in most mainstream languages.

      Why do you need to spot that difference? Why not just consider any function call a "passed message", and relegate the rest to implementation detail?

    27. Re:Somebody post a SWIFT example PLEASE! by shutdown+-p+now · · Score: 1

      C#:

      someObject->setColor(red: 0.4, green: 0.3, blue: 1.0, alpha: 0.5);

      You were saying?

    28. Re:Somebody post a SWIFT example PLEASE! by bondsbw · · Score: 1

      Why have any type of source code organization? Why pretend there are such things as functions/methods/messages, objects, arrays, strings, etc. and instead work directly with memory and registers using primitive operations?

      --
      All my liberal friends think I'm a conservative, all my conservative friends think I'm a liberal.
    29. Re:Somebody post a SWIFT example PLEASE! by shutdown+-p+now · · Score: 1

      Faulty argument. If you want to categorize function calls and message passing differently, you need to clearly show the differences between them, and why one cannot be reduced to another (and note that I was proposing to interpret function calls in terms of message passing, not the other way around - that's interpreting a lower-level construct in terms of a higher-level one).

    30. Re:Somebody post a SWIFT example PLEASE! by bondsbw · · Score: 1

      Sure you can implement one in terms of the other. I can implement a string in terms of an array of bytes, or in terms of a pointer to an address in memory, or in terms of a linked list, or in terms of a Huffman tree. Just because something is reducible to something else doesn't mean there aren't cases where each mechanism is preferred.

      Messages are preferred for working with an object, as well as its encapsulated behaviors and state, e.g. [blogPost addRating:4 byMember: memberName]. Functions tend to be preferred for static/stateless invocation of common mechanisms, such as ConvertFeetToMeters(13.5).

      --
      All my liberal friends think I'm a conservative, all my conservative friends think I'm a liberal.
    31. Re:Somebody post a SWIFT example PLEASE! by spitzak · · Score: 1

      You are correct that it had to detect whether there was a value before the left square bracket. I worked on very early NeXT (when it ran on a Sun workstation as the hardware was not available yet), and I did try to fool it with gibberish. It appeared to depend on the last non-blank character: if it was any punctuation other than ')' or ']' then it was a method call. Comments could break it, "array/*comment*/[10]" would produce syntax errors.

      What was really annoying is that it did not detect typos until run-time, since it simply put the message name in quotes and looked it up in a hash table when the call was done. I guess this is familiar to people using python today, but then it was a pretty annoying concept. I believe this was fixed by Apple, but it was true of every version of NeXT I used.

    32. Re:Somebody post a SWIFT example PLEASE! by shutdown+-p+now · · Score: 1

      Your example sort of proves my point: a "message" looks exactly like a function call, except that it has a receiver. This implies that a special syntax is needed for the receiver part (which is already fairly distinct), but the syntax and semantics of the rest of it can clearly be shared - as, indeed, most languages do in practice.

    33. Re:Somebody post a SWIFT example PLEASE! by bondsbw · · Score: 1

      I'm not claiming this syntax is helpful for everyone or every situation, but it certainly has a purpose and that purpose is to highlight that you are passing a message to a stateful object that encapsulates its members.

      It's somewhat like in C where there's a difference between dot (.) and arrow (->) operators. foo->bar is syntactic sugar for (*foo).bar, so why would we need the arrow? And for that matter, C could have been originally designed with just the dot operator as many other languages have been. Still, there are reasons different developers prefer each syntax over the other, and for many people it comes down to clarity and readability and the fact that each language has been designed based on at least one specific focus and to have certain strengths.

      --
      All my liberal friends think I'm a conservative, all my conservative friends think I'm a liberal.
    34. Re:Somebody post a SWIFT example PLEASE! by shutdown+-p+now · · Score: 1

      I'm not claiming this syntax is helpful for everyone or every situation, but it certainly has a purpose and that purpose is to highlight that you are passing a message to a stateful object that encapsulates its members.

      Right - that's exactly what I meant by "the difference is that it has a receiver". And, usually, the receiver syntax is fairly distinct in its own right. One could argue that, with the traditional dot-syntax for the receiver, there is confusion between accessing a field or property of function type and calling that, and calling a method, and it's a valid complaint. Some languages address that by using a different character there - e.g. in OCaml, you use object#method vs record.field. But there's no reasonable justification to make the syntax for the rest of the call different, especially when it deals with identical entities and notions (parameters, return value etc), which it is in Obj-C. All the benefits that are usually cited for that different syntax (such as improved readability) are equally applicable to regular calls.

      With respect to square brackets in particular, the reason why they are inconvenient is because they make method chaining - a very common operation in OO code - awkward to both read and write.

    35. Re:Somebody post a SWIFT example PLEASE! by quax · · Score: 1

      Find this very readable as well. So far from what I've seen I like the language.

    36. Re:Somebody post a SWIFT example PLEASE! by bondsbw · · Score: 1

      But there's no reasonable justification to make the syntax for the rest of the call different

      There is no "the rest of the call". The brackets are part of the messaging syntax by design. The design of the language makes it clear that message passing is considered completely different, even if you can reduce it in your head to being semantically similar.

      Again, another example would be indexers. You could easily argue that myObject.1 should be used instead of myObject[1], and many languages don't allow names to begin with numbers so there wouldn't be a conflict. Yet we often see the two different syntaxes for something that you could reason were the same operation (except a minor detail).

      --
      All my liberal friends think I'm a conservative, all my conservative friends think I'm a liberal.
    37. Re:Somebody post a SWIFT example PLEASE! by shutdown+-p+now · · Score: 1

      There is no "the rest of the call". The brackets are part of the messaging syntax by design. The design of the language makes it clear that message passing is considered completely different, even if you can reduce it in your head to being semantically similar.

      It was probably unclear, but I was referring to the invocation syntax in general there, not specifically to brackets. The brackets themselves are orthogonal to this, as they could have just as well being used with the regular syntax to denote a message dispatch, e.g. [receiver f(arg1, arg2)] or something like that.

      My only concern regarding brackets per se is that they're a poor choice for this kind of thing because they end up being nested heavily in chained calls, making the whole thing less readable than an infix operator like the traditional dot or OCaml-style hash; i.e.:

      foo.bar(....#baz(...).blah

      vs

      [[[foo bar ...] baz ...] blah]

      This sort of chaining is most common with properties. Interestingly enough, Apple has recognized it, and allows you to access properties using dot syntax rather than brackets since Obj-C 2.0 - despite the fact that a property access is still a message (so, really, Obj-C is not particularly consistent in that regard, and square bracket syntax for message passing is not uniformly used).

      Again, another example would be indexers. You could easily argue that myObject.1 should be used instead of myObject[1], and many languages don't allow names to begin with numbers so there wouldn't be a conflict. Yet we often see the two different syntaxes for something that you could reason were the same operation (except a minor detail).

      The difference here is actually more prominent. In something like "a.b", "b" is the identifier, but it is not an expression. OTOH, with indexer, the right side of the operator is an expression. So if your indexing syntax is also a dot, the situation whether the right side of the operator is an identifier naming a member, or an expression naming a variable in scope, is ambiguous (i.e. whether "a.b" means what it usually means, or whether it is "a[b]"). A non-ambiguous syntax would be something like a.(b), and I wouldn't really have a problem with that - we use brackets mainly because it is traditional.

      On the other hand, since indexers usually establish a mapping and have no side effects, they arguably are a form of function, and so should just use the function call syntax - i.e. a(b). Quite a few languages do just that, from BASIC to Scala, though Scala is the only one that I know of that extends this fully, rather than just providing identical syntax (i.e. you can pass an array where a function value is expected, type checks say that it's a function etc).

    38. Re:Somebody post a SWIFT example PLEASE! by farble1670 · · Score: 1

      http://www.captaindebug.com/20...

      telescoping constructors are an anti-pattern, and having named parameters, while more verbose, eliminates the confusion.

    39. Re:Somebody post a SWIFT example PLEASE! by bondsbw · · Score: 1

      My only concern regarding brackets per se is that they're a poor choice for this kind of thing because they end up being nested heavily in chained calls, making the whole thing less readable than an infix operator like the traditional dot or OCaml-style hash; i.e.:

      Actually the second of the two seems much easier to read.

      (so, really, Obj-C is not particularly consistent in that regard, and square bracket syntax for message passing is not uniformly used)

      Agreed. But I only concede that the inconsistency is bad... not the bracket syntax.

      --
      All my liberal friends think I'm a conservative, all my conservative friends think I'm a liberal.
    40. Re:Somebody post a SWIFT example PLEASE! by Glock27 · · Score: 1

      Quite frankly, it looks like a poor man's C#, with some Haskellisms (tuples, -> syntax) thrown in for good measure.

      For many applications, and most interactive applications, it will kick C# all over the parking lot...

      • - It's AOT compiled to highly optimized native code using LLVM. (I see that Mono allows this to some extent...)
      • - It uses ARC instead of GC. That also allows deterministic timing, no semi-random GC pauses and more efficient memory use.

      It'll be interesting seeing some Xamarin versus Swift benchmarks...

      --
      Galileo: "The Earth revolves around the Sun!"
      Score: -1 100% Flamebait
    41. Re:Somebody post a SWIFT example PLEASE! by Anonymous Coward · · Score: 0

      Actually I think Standard ML affected Swift more than BASIC. The 'let'...'in' comes from SML if I am not mistaken. Also the function signature syntax (e.g. (Int, Int) -> Int).

    42. Re:Somebody post a SWIFT example PLEASE! by Anonymous Coward · · Score: 0

      The Objective-C syntax is great for writing expressive and readable code. For example, if I want to set a button's target and the action, Objective-C most closely expresses that intent:

      myButton.targetForAction("tappedButton:", withSender: self) // Swift
      [myButton setTarget:self forAction:@selector(tappedButton:)] // Objective-C

      Why try to shoehorn everything in to a function? I'm definitely not looking forward to writing Swift code.

    43. Re:Somebody post a SWIFT example PLEASE! by drkstr1 · · Score: 1

      You don't write them every time, you type a letter or two, smash enter to pick the autocomplete suggestion (the method you want is almost always the first or second option) and then use tab to jump to the next parameter value to enter.

      In this case, increased verbosity means less rote memorisation and more grokking of the general gist of API patterns so you really can focus more on solving the problem at hand rather than bashing out code.

      Using my own argument against me... touché AC.

      --
      Fanboy Status: Apache Flex, C#, Eclipse, KDE, Pirate Party, Ron Paul, Slackware, Windows 7
  23. Swift by Anonymous Coward · · Score: 0

    Just kids re-inventing the wheel again.

  24. Just what we need, another C++ clone by funky_vibes · · Score: 2

    I'm sure everyone was thinking, we don't have enough languages that are basically a badly implemented subset of C++. We need to make another one.
    Let's see if Android will respond by creating an even less compatible C++ clone than Java.

    1. Re:Just what we need, another C++ clone by Anonymous Coward · · Score: 0

      Thankfully, having had a read through the book, this one seems to be a well implemented subset of C++, with ADTs, and a more consistent type system, so it's basically what C++ should have been in the first place.

    2. Re:Just what we need, another C++ clone by mark-t · · Score: 5, Funny

      ... a badly implemented subset of C++

      You mean like C++?

    3. Re:Just what we need, another C++ clone by funky_vibes · · Score: 1

      I think you like recursive solutions.

    4. Re:Just what we need, another C++ clone by Savage-Rabbit · · Score: 1

      I'm sure everyone was thinking, we don't have enough languages that are basically a badly implemented subset of C++. We need to make another one.
      Let's see if Android will respond by creating an even less compatible C++ clone than Java.

      Eh? Subset of C++? C++ is a (almost) a superset of C as long as you respect a few rules such as the fact that you can define variables like:

      int class = 0;

      in C but not in C++. The above snippet will (obviously) give you a compiler error in C++ since class is a reserved word in C++ but GCC for example has no trouble with that declaration (so C++ is not a strict superset of C++). There are quite a few other things that exist in both languages but work differently in C++ which make C++ programs unacceptable to C compilers even if you only use stuff in your code that is common to both languages. Objective C is claimed to be a strict a superset of C. I've never tested that claim but I imagine you'd get a compiler error if you did this in Objective C (I don't have a compiler handy):

      void id() {}

      you can, however, do this in C without any complaint.

      --
      Only to idiots, are orders laws.
      -- Henning von Tresckow
    5. Re:Just what we need, another C++ clone by funky_vibes · · Score: 1

      In terms of features and overall syntax.
      Details are unimportant when most new languages arguably are doing the same things as languages from 20-30 years ago.

      I'm actually vehemently against using multiple languages, especially languages with large runtime requirements.
      We already have too much fragmentation of incompatible code libraries getting written in 300 different scripting languages.
      It's especially pointless when you realize there really is nothing new under the sun.

      A language isn't just a tool. The situation is the equivalent of people writing down technical literature in Esperanto and everyone else picking their own language.

    6. Re:Just what we need, another C++ clone by elwinc · · Score: 1

      ... a badly implemented subset of C++

      You mean like C++?

      Not exactly. I have no particular objections to the implementations of C++ I've encountered.

      Nope, it's the design of C++ that makes me want to scream...

      --
      --- Often in error; never in doubt!
    7. Re:Just what we need, another C++ clone by BasilBrush · · Score: 1

      If you're not currently programming using Obj-C, this language isn't for you and doesn't affect you. Just as well if you can't differentiate it from C++.

      If you do currently program in Obj-C, this language will be very interesting indeed.

  25. What took them so long? by istartedi · · Score: 1

    Apple is the king of vertical integration and proprietary standards. The only thing that surprises me is that it took them this long. MS beat them with C# by how many years? Google has two of these things (Go and Dart) AFAIK.

    Now I just need to finish my universal cross-compiler that never quite takes advantage of all the features in these languages because it's too damn difficult and they are moving targets.

    That's it. We need a language called "Target" that's constantly moving.

    --
    For all intensive purposes, "whom" is no longer a word. That begs the question, "who cares"?
    1. Re:What took them so long? by Proudrooster · · Score: 2

      Really, it is not the fault of MS, Google, or Apple but of academia. In the CS curriculum they still teach the "compiler" class and as long as you keep teaching kids how to write compilers, they will keep writing languages. SWIFT is definitely a variation on a C theme, but much better than the Objective-C (superset of C) syntax, at least at first glance.

    2. Re:What took them so long? by angel'o'sphere · · Score: 1

      Apple developped Dylan and later NewtenScript long long before MS had its 'own' language.

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    3. Re:What took them so long? by narcc · · Score: 1

      Interesting qualifier, though I should probably note that Microsoft has been in the programming language game since before they were even called 'Microsoft'.

    4. Re:What took them so long? by countach · · Score: 1

      Yeah but MS hadn't redesigned their windows programming framework since the early 90s. They had to improve on a win32 C API that was truly awful. Apple on the other hand had its NeXT inspired gui framework which people actually LIKED. Nobody was really falling over themselves to throw it away, because it was pretty nice, even with all its faults.

    5. Re:What took them so long? by Number42 · · Score: 1

      proprietary standards

      Swift compiles with LLVM/Clang, which is open source. So I wouldn't call the standard proprietary, as anyone can fork it.

    6. Re:What took them so long? by istartedi · · Score: 1

      Proprietary was the best word I could find to describe these corporate languages. True, they are often Open Source, and thus not proprietary in the usual sense. OTOH, they are defined (initially at least) by their corporate implementation which is owned by the corporation. Compare and contrast with languages that have a standards organization. Corporations may hold seats with such an organization, but when it's a healthy org, no one firm has full control.

      OK, this got me curious about Java, which definitely started as this kind of language... turns out it has the "Java Community Process" which was established in 1998, 3 years after the first public release of Java in 1995. OTOH, you don't hear much about it--people don't seem to discuss Java standards the way they discuss C standards. I haven't heard people say things like, "Java '12" whereas "C99" is something people say all the time.

      Anyway, so if "proprietary" isn't the right word, I don't know what is. You see what I'm driving at here?

      There's nothing to stop a corporate language from becoming standards-driven of course; I'd look at it as part of the maturity process. OK, maybe "corporate" would be a better word than "proprietary", but it may still not be the best way to describe it since "corporate" is a bit vague...

      --
      For all intensive purposes, "whom" is no longer a word. That begs the question, "who cares"?
    7. Re:What took them so long? by Number42 · · Score: 1

      Swift is still new, it might become more community-oriented as it matures. I think the term you're looking for here is "open source with one upstream contributor."

    8. Re:What took them so long? by Anonymous Coward · · Score: 0

      Oh, kids these days. Don't they remember HyperTalk, the direct ancestor of AppleScript?

  26. I remember seeing job listings for Java... by Anonymous Coward · · Score: 0

    ...5 years experience, and you pretty much would have had to have written the language to have that much...

    1. Re:I remember seeing job listings for Java... by master_kaos · · Score: 1

      so then reply saying you have 10 years experience. When they call you out on yours call them out on theirs.

  27. Using SWIFT in a contract with the US Navy... by rla3rd · · Score: 0

    Do you get Swift Boating? http://en.wikipedia.org/wiki/S...

  28. Who designed this, and what drugs were they on? by Anonymous Coward · · Score: 0

    Strange, because immutable arrays are possible and (asymptocically) efficient. Standard ML, the predecesor of OCaml and F#, has it it http://webcache.googleusercontent.com/search?q=cache:7nopWhLOQjwJ:www.standardml.org/Basis/vector.html+&cd=1&hl=en&ct=clnk&gl=nl&client=safari (Google cache as they seem to be moving servers).

  29. Colour me skeptical... by ChunderDownunder · · Score: 3, Insightful

    Apple had a fine language 20 years ago. It was said to influence the design of Ruby and Python. They butchered it into an Algol-like syntax because 'real programmers' can't grok s-expressions. Then they abandoned Dylan.

    Next, they created a language for mobile devices. Its programming model was said influence the design of JavaScript. Then they abandoned NewtonScript.

    1. Re:Colour me skeptical... by Anonymous Coward · · Score: 0

      Well story with Dylan was Matt sued Apple because of the name.

      Lets see if Taylor will do the same.

      Will it be the first time slashdot links to tmz.com?

    2. Re:Colour me skeptical... by Anonymous Coward · · Score: 0

      Oops I meant Bob. Sorry, Matt.

      Story with Dylan was Bob sued Apple because of the name.

      Lets see if Taylor will do the same this time.

      Will it be the first time slashdot links to tmz.com?

    3. Re:Colour me skeptical... by Anonymous Coward · · Score: 0

      You are griping about things they did 20 years ago?

    4. Re:Colour me skeptical... by Anonymous Coward · · Score: 0

      Story with Dylan was Bob sued Apple because of the name.

      He did not. Shut up. Seriously. He did? No way. What a tool, if he did. Did Apple's trademark lawyers carve his lawyers a new a-hole? Because use of the name "Dylan" as a programming language in no way infringes upon Bob Dylan's name in music.

    5. Re:Colour me skeptical... by Anonymous Coward · · Score: 0

      Swift looks to be rather heavily influenced by Dylan to me. The LISP-ness peeks through in the Language Reference Manual in lots of places.

    6. Re:Colour me skeptical... by Anonymous Coward · · Score: 0

      Yes, serious. Says they settled.

    7. Re:Colour me skeptical... by Anonymous Coward · · Score: 0
    8. Re:Colour me skeptical... by Anonymous Coward · · Score: 0

      Dylan was in the days when Apple couldn't bring itself to finish anything, including their next-generation OS; and NewtonScript got thrown out along with Newton when Apple was teetering on the brink of bankruptcy. Apple of 2014 is a very different company. Not that Swift's success is assured--for all we know, this could end up as another Java-Cocoa or MacRuby--but it seems to be getting more top-level attention than any new Apple language since HyperTalk.

  30. Re:and it needs an new OS the mess up other apps by Anonymous Coward · · Score: 0

    Score: -1, FUD

    It uses objective-c's runtime, Apple's implementation is compatible with iOS 7 and 8, and OS X Mavericks and Yosemite. I'm sure plenty of 3rd party implementations will appear too, much like they have done for obj-c.

  31. Who designed this, and what drugs were they on? by phantomfive · · Score: 1, Funny

    My favorite part of immutability is 'let.'
    If you write:

    let i = 5;
    You have just declared 'i' to be immutable. Intuitive, isn't it?

    --
    "First they came for the slanderers and i said nothing."
  32. iPhone announcement by TrollstonButterbeans · · Score: 2

    When Steve Jobs announced the iPhone, Cisco owned the trademark to iPhone as I recall. And he didn't care.

    Apple has enough $$$ to payoff for virtually any name they set their mind to, just like what they did with the iPhone.

    http://www.idownloadblog.com/2012/01/27/apple-cisco-iphone-trademark/

    --
    Priest: "Universe from nothing, no laws of physics, sped up time"+ huge discrepancies. Creationism? No. Big Bang Theory
    1. Re:iPhone announcement by Anonymous Coward · · Score: 0

      cisco owned (as in past tense) and had abandoned it due to non-use.

    2. Re:iPhone announcement by phizi0n · · Score: 2

      Actually Cisco was actively using the brand at the time that Apple released their's and Cisco sued but settled out of court without releasing any of the details other than both companies would use the brand.

    3. Re:iPhone announcement by Anonymous Coward · · Score: 0

      > Cisco owned the trademark to iPhone as I recall

      And, ironically also the name of the OS. cisco IOS was the most popular router OS for nearly twenty years before the iPhone was released. Apple screwed-up on both the product and OS names, and they had to license both from cisco.

    4. Re:iPhone announcement by BasilBrush · · Score: 1

      Cisco wasn't currently selling any product using the name iPhone, and falsified some photos to make it seem like they were.

  33. Exceptions by phantomfive · · Score: 1

    The language doesn't have exceptions.
    It has strong emphasis on assertions though, so feel free to use those as a substitute.

    --
    "First they came for the slanderers and i said nothing."
    1. Re:Exceptions by gnasher719 · · Score: 1

      The language doesn't have exceptions.
      It has strong emphasis on assertions though, so feel free to use those as a substitute.

      In Objective-C, you should only throw exceptions on programming errors. And there's no need to catch them, because you ought to fix the code. Swift just makes it a bit stronger. No exceptions.

    2. Re:Exceptions by shutdown+-p+now · · Score: 1

      The language has proper optionals, though. And ADTs with pattern matching. For most cases, this is sufficient to communicate errors to the caller in a way that requires him to handle them (or explicitly suppress them, or pass them through).

    3. Re:Exceptions by flargleblarg · · Score: 1

      In Objective-C, you should only throw exceptions on programming errors. And there's no need to catch them, because you ought to fix the code.

      Nonsense. That is what assertions are for. Assertions are not meant to be caught, and should be used to throw an (uncaught) exception upon detection of a programming error, i.e., an internal consistency check. Regular exceptions, on the other hand, are for handling exceptional cases encountered in the process of execution (such as file-not-found or unsupported-format).

      Swift just makes it a bit stronger. No exceptions.

      They will probably add exceptions in 1.1 or 2.0. They're pretty imporant.

    4. Re:Exceptions by gnasher719 · · Score: 1

      Nonsense. That is what assertions are for. Assertions are not meant to be caught, and should be used to throw an (uncaught) exception upon detection of a programming error, i.e., an internal consistency check. Regular exceptions, on the other hand, are for handling exceptional cases encountered in the process of execution (such as file-not-found or unsupported-format).

      That's typically how you identify Java and C# programmers who try to write Objective-C code. They throw and catch exceptions all over the place instead of using NSError**.

    5. Re:Exceptions by phantomfive · · Score: 1

      The language has proper optionals, though.

      Yeah, I was wondering about that. I haven't figured out yet if objects are nullable by default or if you have to explicitly mark them as nullable.

      --
      "First they came for the slanderers and i said nothing."
    6. Re:Exceptions by shutdown+-p+now · · Score: 1

      So far as I can see, the default is non-nullable. They actually had to add some hacks to the language to enable this while also allowing for circular dependencies between objects that must be defined during initialization (the syntax Foo! is same as Foo?, but allows to treat the value as if it were non-optional, with a runtime exception when it's nil - basically the standard behavior for Java/C#/Obj-C).

    7. Re:Exceptions by phantomfive · · Score: 1

      How do you feel about the language overall? I'm really interested in your opinion because, although I've disagreed with you about details of languages in the past, at a minimum you've always had an informed and thought-out opinion.

      --
      "First they came for the slanderers and i said nothing."
    8. Re:Exceptions by shutdown+-p+now · · Score: 1

      Ignoring the issue with "immutable" arrays (which I think is something that will keep tripping both newbies and people switching from other languages), it's pretty decent for a mainstream language with no pretense for any particular innovation. Looks and feels a lot like the other similar languages with same design goals - Kotlin, C# 6.0 (the not-yet-released one that's currently in design) sans legacy cruft, etc. The only sticking point is automatic reference counting over GC, but given Apple's background on the issue, it's not surprising (though based on experience with such in C++/CX, this will also bite them once coders start actively using lambdas for event callbacks).

      Definitely much better than Objective-C, which was a hack of a language in too many respects - trying to bolt Smalltalk onto C by forcibly fitting square pegs into round holes with little attempt to reconcile the fundamental differences in design philosophy would inevitably end up like that, though.

      It seems that Apple has recognized that Obj-C is both dated and looks and feels very alien to people from practically any other camp, and so they have decided to tackle that to make their platform more attractive to both new developers and people switching from other platforms. If that is indeed the intended goal, they have reached it for sure.

    9. Re:Exceptions by BasilBrush · · Score: 1

      The language doesn't have exceptions.

      Neither does Obj-C. Hasn't provided a hurdle to app development yet.

      C++ has exceptions, and because you are allowed to mix C, C++ and Obj-C in the same source, some misguided people have mixed exceptions in with Obj-C code. But they are C++ or Java people doing it out of ignorance, rather than being the right thing to do in Obj-C.

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

      Nope, Objective-C treats exceptions very differently than other popular languages and passes NSErrors around for what other languages use exceptions for.

      For example. Try to write to a file and don't have permissions? You get an NSError parameter.

      Try to access an array with an out-of-bounds index? You get an exception.

  34. Designed for safety & performance by Anonymous Coward · · Score: 2, Informative

    There's not really a trade-off. It's just newer. Variable types can be inferred statically using unification (which is fast and actually more expressive than manually typed languages). Standard ML has done it for many years.

    Same with forcibly initialized values. Means you don't need to check pointers ever. Basically the same as references in C++.

    Bounds checking is rarely needed. Again, I point to Standard ML; here, instead pattern matching and higher order functions are used. This is basically what Swift does with closures and the map operation. If you look at the fold operations of all Standard ML types (that's basically the inspiration for the map-reduce paradigm), it is obvious that no bounds-checking is necessary, and iterating over an entire structure is almost always what you do with a data-structure (aside from initialization), and the only operation where you access the structure many times and would have an overhead for bounds-checking.

    Memory seems to be managed using ref-counting, which is similar to auto_ptr in C++. Barely any overhead (a zero-check on deallocation, which can even be biased towards branch-predicting that no deallocation needs to take place).

  35. Swift by phantomfive · · Score: 2

    I knew that Swift was trouble when it walked in, trouble trouble trouble

    --
    "First they came for the slanderers and i said nothing."
  36. looks decent by stenvar · · Score: 1

    Apple definitely needed to do something because Objective-C was really getting long in the tooth. As far as new languages go, at first glance, this looks nicer than what the other players have to offer (Java, C#, Go).

    However, proprietary languages don't tend to fare particularly well. If this gets an open source implementation and isn't patent encumbered, however, it might also be a good thing for Linux.

    1. Re:looks decent by Proudrooster · · Score: 1

      Agreed, It looks decent and both readable and writable. Hope it catches on.

    2. Re:looks decent by Anonymous Coward · · Score: 0

      Apple definitely needed to do something because Objective-C was really getting long in the tooth. As far as new languages go, at first glance, this looks nicer than what the other players have to offer (Java, C#, Go).

      However, proprietary languages don't tend to fare particularly well. If this gets an open source implementation and isn't patent encumbered, however, it might also be a good thing for Linux.

      Programming languages don't go stale as long as they (properly) support the latest hardware features. Newer often means unknown bugs and bottlenecks.

    3. Re:looks decent by SuperKendall · · Score: 1

      However, proprietary languages don't tend to fare particularly well

      Except ObjC, which leads one to think Swift might do really well also.

      --
      "There is more worth loving than we have strength to love." - Brian Jay Stanley
    4. Re:looks decent by NJRoadfan · · Score: 2

      Objective-C is freely available in gcc, hopefully Apple doesn't make this one OS X/iOS specific. Open languages have a shot at being cross platform friendly.

    5. Re:looks decent by stenvar · · Score: 1

      Except ObjC, which leads one to think Swift might do really well also.

      Objective-C is not proprietary. Neither Apple nor NeXT invented it, they didn't develop the core libraries, and there are multiple implementations. Of course, Objective-C hasn't done all that well: outside Apple, hardly anybody uses it anymore, for the simple reason that it's been obsolete for a long time.

    6. Re:looks decent by SuperKendall · · Score: 1

      Objective-C is not proprietary.

      The ObjC everyone uses is.

      it's been obsolete for a long time.

      That was never true, it just fell out of disfavor. It was not really any more obsolete than C++ or C or Java for that matter, all of which thrive today.

      --
      "There is more worth loving than we have strength to love." - Brian Jay Stanley
    7. Re:looks decent by countach · · Score: 1

      Define proprietary. Java is pretty much proprietary, even though its been copied by now. C# is proprietary, but its been copied too. Actually, I'd have to dispute your claim that proprietary languages don't do well.

    8. Re:looks decent by WillAdams · · Score: 1

      Yes, but GNUstep is still waiting in the wings --- curious to see how this plays out long-term and if it becomes necessary for the GNUstep folks to implement a version of this, and if it does, if this results in the jump start that project needs.

      --
      Sphinx of black quartz, judge my vow.
    9. Re:looks decent by stenvar · · Score: 1

      Define proprietary

      "Proprietary" means someone owns it and can control who does and doesn't use it. Languages are proprietary because of patents, copyrights, or trade secrets. Neither Java nor C# are proprietary (although legal uncertainty surrounds both).

      Actually, I'd have to dispute your claim that proprietary languages don't do well.

      Well, examples?

    10. Re:looks decent by Anonymous Coward · · Score: 0

      The ObjC everyone uses is.

      In what way is it "proprietary"? I.e., in what way does Apple own it and can prevent others from using it?

      It was not really any more obsolete than C++ or C or Java for that matter, all of which thrive today.

      Objective-C inherits some bad features of pre-ANSI C, like lack of type safety. Its memory management (reference counting, ARC) is also obsolete. It started off ahead of the curve but failed to evolve.

    11. Re:looks decent by Number42 · · Score: 1

      It's not really a proprietary language (and neither is Objective-C, for the same reason) because it compiles using LLVM/Clang, which is open source.

    12. Re:looks decent by SuperKendall · · Score: 1

      In what way is it "proprietary"? I.e., in what way does Apple own it and can prevent others from using it?

      Apple is driving ObjC the language, and the foundations everyone knows and makes wide use of are largely proprietary.

      How many Objective-C developers today could code without UIKit or NSWindow handy? I would wager it's a vanishingly small number.

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

      JavaScript had already taken over the Web when it became non-proprietary. Java didn't even pretend to be non-proprietary before 1.4, by which time it was a major language. ActionScript (Flash) is still commonly used on the Web in spite of being effectively a one-vendor solution (has gnash ever reached usable stage?). PostScript remains the dominant language for high end laser printers, yet it still isn't an open standard (third-party rasterizers like GhostScript are unauthorized). The proprietary Microsoft Visual Basic for Applications, arguably the most popular application scripting language in computing history, bears no resemblence to standard BASIC; it is a bastard mix of ALGOL descendants. If you want to do computing in higher mathematics, the de facto standard is the very expensive and proprietary Mathematica.

      I came up with that much in 10 minutes. Should I go on?

    14. Re:looks decent by BasilBrush · · Score: 1

      We don't really know what it's status will be until it's out of beta and properly released. It's possible they will open source it under the BSD license like LLVM and Clang. Which will mean others can fork it under another name.

      But the more important issue is probably the standards that define the language. And Apple certainly won't be delegating those to a standards body. They will want to be able to make changes as and when they decide, not suggest them and then wait years for approval.

  37. Re: Since when does Qt "work" with OS X? by Anonymous Coward · · Score: 0

    Maya , modo .. Google these apps

  38. Write once by Anonymous Coward · · Score: 0

    For Apple, then once for everybody else! Too much time on my hands! Said Tommy Shaw!

  39. Re:Since when does Qt "work" with OS X? by Kesha · · Score: 5, Informative

    There is VLC
    There is CMake
    There is my project -- https://sourceforge.net/projec...
    There is Sorenson Squeeze -- http://www.sorensonmedia.com/s...
    I am sure there are others

  40. Re:Since when does Qt "work" with OS X? by Guy+Harris · · Score: 4, Informative

    No this is NOT a troll, please read.

    A claim of cross-platform is one thing. But in practice I know of no significant apps using Qt that exist in the wild that work on OS X.

    Please provide a link to any mainstream working application for Mac OS X that uses Qt.

    $ otool -L /Applications/Google\ Earth.app//Contents//MacOS//Google\ Earth
    /Applications/Google Earth.app//Contents//MacOS//Google Earth:
    @rpath/libgoogleearth_free.dylib (compatibility version 0.0.0, current version 0.0.0)
    /System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa (compatibility version 1.0.0, current version 19.0.0)
    /System/Library/Frameworks/Carbon.framework/Versions/A/Carbon (compatibility version 2.0.0, current version 155.0.0)
    @rpath/QtCore.framework/Versions/4/QtCore (compatibility version 4.7.0, current version 4.7.4)
    @rpath/QtGui.framework/Versions/4/QtGui (compatibility version 4.7.0, current version 4.7.4)
    @rpath/QtWebKit.framework/Versions/4/QtWebKit (compatibility version 4.7.0, current version 4.7.4)
    @rpath/QtNetwork.framework/Versions/4/QtNetwork (compatibility version 4.7.0, current version 4.7.4)

    ...

    I don't know of a single one because Qt's support for XCode is incredibly poor.

    Do you have to use Xcode, the IDE, to develop OS X apps? Or by "Xcode" do you mean "Xcode the IDE, plus the command-line tools"?

  41. the inevitable... by roc97007 · · Score: 1

    "I can code faster than ever!" Tom said swiftly.

    Too soon?

    --
    Oliver's law of assumed responsibility: If you're seen fixing it, you will be blamed for breaking it.
    1. Re:the inevitable... by painandgreed · · Score: 1

      "I can code faster than ever!" Tom said swiftly.

      I thought Tom just did hardware.

  42. Typing by Anonymous Coward · · Score: 0

    > the compiler infers the variable type, just as many scripting languages do

    Someone doesn't seem to understand the difference between dynamic typing (which is what "scripting" languages use) and static typing with type inference (which is what Swift uses).

    1. Re:Typing by Anonymous Coward · · Score: 0

      Thanks.
      I was taught a language with static typing and type inference, Caml. It makes C look like a scripting language. Mixing chars, ints and floats? It will bomb instantly. Caml will coldly tell you that the '+' operator is reserved for ints. you'll have to use '+.' to add up floats and as for adding chars together, er, sorry that doesn't make sense! Get lost.

      On the other hand, if you write a function and the infered type for an argument is "type anything" (noted 'a, and 'b for "any type but not necessarily the same as 'a") then you get instant polymorphism. Common beginner things are functions that work with lists, elements all have the same type but that type can be any.

  43. Re:Since when does Qt "work" with OS X? by angel'o'sphere · · Score: 3, Insightful

    Then compile your code with Eclipse or from the command line.
    What has XCode to do with developing Qt?

    --
    Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
  44. So When Will We See The First Job Posting... by Anonymous Coward · · Score: 0

    requiring 5 years of experience with Swift on iOS?

    1. Re:So When Will We See The First Job Posting... by Anonymous Coward · · Score: 0

      requiring 5 years of experience with Swift on iOS?

      Hey Buddy, are you a bit slow??? The first HR joke was there an hour before your posting...

  45. Clearly his team needs it. Don't question why. by Anonymous Coward · · Score: 3, Insightful

    My god, it's like I'm at Stack Overflow, reading the typical stupid and cocky "WHY ARE YOU DOING IT THAT WAY?!?#?!?@?!@?!?" responses that are so prevalent over there.

    His team probably has its reasons for using or requiring GDB. And you know what? They're probably pretty damn legitimate reasons, too.

    I'm sure they know about LLDB. But it's probably not what they need, and thus they do not use it.

    If they need GDB, then that's what they need. It's that simple.

    What we don't need is somebody like you questioning the validity of their very real need.

    1. Re:Clearly his team needs it. Don't question why. by Anonymous Coward · · Score: 3, Informative

      So then install GDB. There is no reason to stop supporting Mavericks because it doesn't come with GDB preinstalled.

    2. Re:Clearly his team needs it. Don't question why. by davester666 · · Score: 1

      Obviously, they inherited their coding tools from some programming gods, who all quit, and the only ones left just know how to use these existing tools to keep doing what they are doing.

      They would have to hire an outside contractor to figure out how to get gdb working.

      --
      Sleep your way to a whiter smile...date a dentist!
    3. Re:Clearly his team needs it. Don't question why. by Anonymous Coward · · Score: 0

      They're probably pretty damn legitimate reasons, too.

      That's cute. It's far more likely that their "team" is just a bunch of fucking idiots.

    4. Re:Clearly his team needs it. Don't question why. by Anonymous Coward · · Score: 2

      They're probably pretty damn legitimate reasons, too.

      You clearly haven't been a professional software developer for very long.

      My team has already stopped supporting Mavericks

      And neither has he.

      Oh what a wonderful world it would be if I could just drop support for key user platforms because they're hard to deal with. And when I say "hard" I mean "dev tools from the 80s, bug-filled operating systems and even hardware bugs", not "waaah I can't use my favourite debugger any more".

    5. Re:Clearly his team needs it. Don't question why. by Anonymous Coward · · Score: 0

      Stack Overflow and other help sites are different than a discussion on SD. On help sites, people are asking others to spend time and effort helping them. It is perfectly reasonable for the answerers to probe and make sure they are taking the right approach in the first place so as not to waste everyone's time.

      When someone is asking a question that doesn't have an answer on the internet yet, I have seen that they are often taking a misguided approach to the problem.

      If you are going to ask for help, you need to be willing to explain why you are doing it that way, if someone thinks that might be relevant, Don't get frustrated by this, it is quite possible they could point out a problem you didn't even consider.

    6. Re:Clearly his team needs it. Don't question why. by BasilBrush · · Score: 1

      His team probably has its reasons for using or requiring GDB. And you know what? They're probably pretty damn legitimate reasons, too.

      Probably, probably eh? That's a really convincing argument right there.

    7. Re:Clearly his team needs it. Don't question why. by BasilBrush · · Score: 1

      My god, it's like I'm at Stack Overflow, reading the typical stupid and cocky "WHY ARE YOU DOING IT THAT WAY?!?#?!?@?!@?!?" responses that are so prevalent over there.

      Those comments are usually right. The initial question that newbs ask on StackOverflow very often reveals a basic misunderstanding. One often needs to realise what it is they really need to know rather than what they are asking.

  46. Multi-platform matters by Midnight+Thunder · · Score: 1

    I haven't yet decided whether this is yet another programming language we needed, but I will be interested to see whether Apple release the Swift support in LLVM as open source. One thing that I dislike more than new programming language for the sake of doing so, are single-platform languages.

    --
    Jumpstart the tartan drive.
    1. Re:Multi-platform matters by Number42 · · Score: 1

      Seeing as Apple has been pretty consistent with LLVM/Clang being open source, I wouldn't see why they wouldn't open source it.

  47. Re:Since when does Qt "work" with OS X? by Anonymous Coward · · Score: 0

    I'm a developer at MakerBot. Our entire UI is built in Qt specifically for cross platform capabilities. It runs on OSX just fine.

  48. Scala-- by corporate+zombie · · Score: 1

    It's Scala. They left out pattern matching and didn't drive the monadic nature of common programming collections through the collection classes. You can leave out the monads (although the first time you want to convert the contents of an Optional value via a function returning an Option you'll wish they hadn't) but leaving out pattern matching was a plain and simple misstep.

    1. Re:Scala-- by shutdown+-p+now · · Score: 1

      They do seem to have some limited pattern matching there, for tuples and enums. This is basically as expressive as ML, and I don't recall anyone complaining about ML not being good enough at that.

  49. Re:Swift another scripting lanugage by Anonymous Coward · · Score: 0

    Not really, there's also Dart, an actually forward-looking systems language with a lot of real thought behind it. But nobody pays attention to that, because it's not by Apple or Google. Far better to keep favoring whatever Google's current ga-ga for, or Apple's latest pre-alpha press release of a language.

  50. Good bye source compatibility by Anonymous Coward · · Score: 0

    "Funny how the world works."

    No it isn't. You're probably one of the very people that was against the proliferation of Java, or cross platform generally. What did you think was going to happen? C would be cross platform?? Get real..

  51. Re:Since when does Qt "work" with OS X? by spitzak · · Score: 1

    Nuke and a lot of other software used for computer graphics.

  52. No they are not by SuperKendall · · Score: 1, Insightful

    I'm sure they know about LLDB. But it's probably not what they need, and thus they do not use it.

    Whatever they NEED gdb for, they would be better off using LLDB at this point.

    I was a huge fan of GDB in the past. But that time has gone.

    --
    "There is more worth loving than we have strength to love." - Brian Jay Stanley
  53. Re:and it needs an new OS the mess up other apps by craigminah · · Score: 2

    Tarzan? Is that you? Totally unintelligible gibberish...derka derka.

  54. If you care about Windows Phone or Windows RT by tepples · · Score: 4, Informative

    It doesn't use Metro's libraries.

    Anything that doesn't use the Windows Runtime API (what you call "Metro's libraries") will not be approved for the Windows Store and will not run on Windows RT tablets or Windows Phone 8 smartphones.

    1. Re:If you care about Windows Phone or Windows RT by Anonymous Coward · · Score: 0

      Clearly you don't know what you're talking about, since Digia has already done exactly that with Qt.

      http://blog.qt.digia.com/blog/2014/05/20/qt-weekly-11-getting-started-with-winrt-2/?utm_source=rss&utm_medium=rss&utm_campaign=qt-weekly-11-getting-started-with-winrt-2

    2. Re:If you care about Windows Phone or Windows RT by Anonymous Coward · · Score: 0

      Oh noes. Without access to the successful Windows Store, Microsoft will be able to shut out the entire industry and set its direction for years to come.

      No wait, the other thing.

    3. Re:If you care about Windows Phone or Windows RT by Anonymous Coward · · Score: 2

      I'm sure all 5 users of those products will be particularly upset by this.

    4. Re:If you care about Windows Phone or Windows RT by AmiMoJo · · Score: 1

      Anything that doesn't use the Windows Runtime API (what you call "Metro's libraries") will not be approved for the Windows Store and will not run on Windows RT tablets or Windows Phone 8 smartphones.

      Yeah but who cares about those five users?

      --
      const int one = 65536; (Silvermoon, Texture.cs)
      SJW, n: "Someone I don't like, and by the way I'm a fuckwit" - AC
    5. Re:If you care about Windows Phone or Windows RT by Anonymous Coward · · Score: 0

      and... nobody cares... at all.
      I mean, yes all 5 Windows Phone users and all 10 RT tablet users maybe.
      Seriously, though, this discussion was about PC operating systems.

    6. Re:If you care about Windows Phone or Windows RT by jthill · · Score: 1

      And you think this will cripple anything _but_ the Windows Store? The Windows Store is a joke. Microsoft themselves treat it as a joke, offering a $100 bounty for uploading shovelware. As with Microsoft bribing people to use Bing, Microsoft couldn't say "we can't compete on value" any louder.

      --
      As always, all IMO. Insert "I think" everywhere grammatically possible.
    7. Re:If you care about Windows Phone or Windows RT by linearz69 · · Score: 1

      Sorry, but Metro is not the same as Windows Runtime API. If they were, then Windows would be fucked. Even the boneheads at Microsoft realize this.

    8. Re:If you care about Windows Phone or Windows RT by linearz69 · · Score: 1

      And you think this will cripple anything _but_ the Windows Store? The Windows Store is a joke.

      I think its safe to say that the "Windows Store" Desktop app strategy has failed. Nobody cares. Windows Store solves no problems for desktop users. The store may work for handheld devices and Xbox. Problem for Microsoft is that few want windows on their phone or tablet when Android and Apple are out there.

    9. Re:If you care about Windows Phone or Windows RT by tepples · · Score: 1

      Sorry, but Metro is not the same as Windows Runtime API.

      True, the Modern UI design language (formerly Metro) is a look and feel, and WinRT is an API. But they are strongly correlated: programs that use the latter API will have the former look and feel by default, and the Windows Store review process is supposed to enforce this.

    10. Re:If you care about Windows Phone or Windows RT by darkgrayknight · · Score: 0

      There are more users of WinRT than there are users of Mac OS X.

  55. Swift : Objective-C :: Groovy : Java by flargleblarg · · Score: 1

    Looks like a decent language, actually.

  56. Windows Phone and RT do not require C# by tepples · · Score: 5, Informative

    I was under impression that all new windows "apps" had to be written in C# against a new SDK that has neither binary nor source compatibility with Win32/posix/C/C++. I'd be glad to be wrong, but that's what I've seen so far.

    Only Windows Phone 7 and Xbox Live Indie Games required C#.* C++ works on Windows Phone 8 and Windows RT, though they do require use of the Windows Runtime API. For actual Windows on x86, you can continue developing desktop applications without having to deal with Windows Runtime (the "Metro" crap).

    * In theory, they required verifiably type-safe CIL compatible with the .NET Compact Framework. In practice, they required C#, as standard C++ is not verifiably type-safe, and DLR languages require functionality not in .NET CF.

    1. Re:Windows Phone and RT do not require C# by SQLGuru · · Score: 1

      For that matter, you can write native "Metro" apps using Javascript (link: http://msdn.microsoft.com/en-u...)

      There is no requirement to use C#.

    2. Re:Windows Phone and RT do not require C# by ugen · · Score: 1

      Ok, so that's what I meant - it may be C++, but WinRT is not compatible with posix/libc-ish API (in fact, because of its event-based nature I don't see even an indirect mapping to the way things were done in the other ones). While it's nice to think Win32 is still alive, clearly it's on the way out and so is source compatibility.

    3. Re:Windows Phone and RT do not require C# by tepples · · Score: 1

      While it's nice to think Win32 is still alive, clearly it's on the way out and so is source compatibility.

      When Visual Studio is ported to WinRT, I'll believe you.

    4. Re:Windows Phone and RT do not require C# by Anonymous Coward · · Score: 0

      That would be the day. I'm STILL waiting on them to add the ribbon to Visual Studio....

    5. Re:Windows Phone and RT do not require C# by _Shad0w_ · · Score: 1

      I'm guessing dogfooding doesn't apply to shitty UI elements :)

      --

      Yeah, I had a sig once; I got bored of it.

    6. Re:Windows Phone and RT do not require C# by kiddygrinder · · Score: 1

      my guess is (yes it is a guess, as if anyone can do more) is that RT will die and some metro support will be required if you want to be a first class citizen on windows tablets, which people seem to like so it might be worth it if the market continues to grow.

      --
      This is a joke. I am joking. Joke joke joke.
    7. Re:Windows Phone and RT do not require C# by Anonymous Coward · · Score: 0

      There's a time and a place for each UI paradigm.

      The Ribbon works best when there's a select subset of commands that are executed frequently, and thus works well in LOB apps or Office. Visual Studio, and other professional/technical tools (photoshop, etc), however, need too many UI elements available on the screen at any given time to make the Ribbon a useful interface.

      Think about it this way: You wouldn't use a fully automatic interface on a racecar, would you? Does that mean automatic interfaces are crap? Not at all; sometimes you need the added complexity of a manual. Most of the time you do not.

    8. Re:Windows Phone and RT do not require C# by shutdown+-p+now · · Score: 1

      The question of "compatibility" of WinRT with other stuff doesn't really arise. WinRT is a set of class/interface-based APIs for UI and other things. It does not replace or subsume the C++ standard library, and the latter is available in full to any "Metro" app. A subset of Win32 is available as well (though that isn't really relevant to the whole portability debate).

  57. Compatibility is no problem, before or after swift by perpenso · · Score: 5, Informative

    Good bye source compatibility. We hardly knew ye.

    I have absolutely no compatibility problems. I strictly use objective-c for only user interface code. The core functional application code is written in c/c++. I have multiple iOS/Android apps whose core code is shared and can even be compiled with a console app under Mac OS X or Linux, I use this for regression testing and fuzzing. A headless Linux box in the closet exercises this core code. Similar story for Mac OS X and Windows.

    Swift code can replace objective-c code and it matters little to me. Has zero impact on other platforms I target.

    Admittedly I've ported other people's code between Windows, Mac and Linux for years and written my own code for Windows, Mac and Linux for years and as a result I am extremely aggressive about separating UI code from functional code.

    For those people using some sort of cross-platform wrapper for their project, if it supports Mac OS X objective-c it will probably support Swift. Even if it takes time for the wrapper developers so what, the use of Swift is entirely optional.

  58. Translation: I work for an incompetent team by Anonymous Coward · · Score: 0, Flamebait

    Apparently your "team" is too stupid to install GDB and too incompetent to write a string to select a font.

  59. Re:Since when does Qt "work" with OS X? by ldephil · · Score: 2

    Autodesk Maya

  60. Fabricated Demo by Anonymous Coward · · Score: 0

    I'm NOT going to ditch 30-years of code base just for one FABRICATED DEMO !

    Fuck Apple.

    PS
    Good for Apple that I am not piloting a B-52H with a Mk-41 just to dig a hole where the Apple
    campus in Cupertino now exists.

    Bye bye Cupertino and Apple.

    Happy zombie day
    Ha ha

  61. Re:Since when does Qt "work" with OS X? by Anonymous Coward · · Score: 1

    There is this little program called "Google Earth". Its Qt and on the Mac. I guess it was a troll.

  62. Viva Eco by fulldecent · · Score: 4, Insightful

    Ok, so now you'll be developing software using Apple's frameworks and Apple's language to run on Apple's runtime, after passing Apple's compiler (i.e. LLVM) for download using Apple's store (after finding your product with Apple's iAD) directly onto Apple's products built with Apple's custom processors, after you register as an Apple Developer. If your app needs to do something outside this environment, you can use said APIs now to reach out to Apple's Could and Apple's Database servers. And if your app is really successful as measured by Apple Crash Reporting and Apple Usage statistics or Apple's iTunes Connect, then they'll just straight out fucking copy you.

    Something about the new "language" is what makes that summary start sounding ridiculous.

    --

    -- I was raised on the command line, bitch

    1. Re:Viva Eco by Primate+Pete · · Score: 1

      But you don't understand... Apple has an ecosystem. In an ecosystem, someone has to be the prey...

  63. Re:Since when does Qt "work" with OS X? by Anonymous Coward · · Score: 0

    Qt has its own cross platform IDE. It uses the Xcode command line tools behind the scenes. It has very good Qt support.

  64. Poaching by tepples · · Score: 1

    and you pretty much would have had to have written the language to have that much

    Exactly. It sounds like someone who constructs such a job posting is looking to poach the language's designer.

  65. Re:Since when does Qt "work" with OS X? by eapache · · Score: 2

    Wireshark is currently rewriting their UI in Qt explicitly because it provides a much better OSX interface than the existing version.

    https://blog.wireshark.org/2013/10/switching-to-qt/

  66. Method naming convention with parameters by tepples · · Score: 1

    In the Obj-C case, it's obvious, the parameter names are part of the name of the function

    Such a convention can also be done in C++: someObject->setColorRGBA(0.4,0.3,1.0,0.5);
    Or in JavaScript: document.getElementById('main') and element.appendChild(another)

  67. Re:Swift another scripting lanugage by styrotech · · Score: 1

    Not really, there's also Dart, an actually forward-looking systems language with a lot of real thought behind it. But nobody pays attention to that, because it's not by Apple or Google. Far better to keep favoring whatever Google's current ga-ga for

    Dart is a Javascript replacement and is by Google. Maybe you meant Rust or something else?

  68. Jonathan by tepples · · Score: 1

    Dang right. I imagined connections to the famous satirist behind A Modest Proposal and Travels into Several Remote Nations. Is this a satire, or is it the real thing?

    1. Re:Jonathan by phantomfive · · Score: 1

      If the Swift language is satire, then Apple just pulled off the best troll of the century

      --
      "First they came for the slanderers and i said nothing."
  69. Re:Since when does Qt "work" with OS X? by Anonymous Coward · · Score: 0

    They are switching from GTK+ to QT. That completely sideways move. There shit user interface will still be a piece of shit.

  70. Bjarne Stroustrup by phantomfive · · Score: 4, Interesting

    Bjarne Stroustrup once gave some ideas on what requirement should be met before he would consider designing a new programming language. This was his list:

    * What problem would the new language solve?
    * Who would it solve problems for?
    * What dramatically new could be provided (compared to every existing language)?
    * Could the new language be effectively deployed (n a world with many well-supported languages)?
    * Would designing a new language simply be a pleasant distraction from the hard work of helping people build better real-world tools and systems?

    Apple can definitely deploy the new language effectively, but I'm not sure it solves any problems.

    --
    "First they came for the slanderers and i said nothing."
    1. Re:Bjarne Stroustrup by WankersRevenge · · Score: 2, Interesting

      It solves a problem ... not your problem, but Apple's problem. I think Apple created Swift to be a common language throughout all their frameworks. I believe Python was originally filling this role, but Apple doesn't control Python. I believe they intend to use this in the server as well, that way, you have one language used throughout the entire stack - app, server, and even in the debugger.

    2. Re:Bjarne Stroustrup by phantomfive · · Score: 1

      I think Apple created Swift to be a common language throughout all their frameworks.

      I'm not sure what you mean by 'a common language throughout all their frameworks.' Which frameworks exactly are you referring to?

      --
      "First they came for the slanderers and i said nothing."
    3. Re:Bjarne Stroustrup by Anonymous Coward · · Score: 0

      * What problem would the new language solve?

      That's easy: it doesn't suck as badly as C++.

    4. Re:Bjarne Stroustrup by Anonymous Coward · · Score: 0

      Bjarne Stroustrup once gave some ideas

      Sure that's who you want to be your role model for programming language design?

    5. Re:Bjarne Stroustrup by Tom · · Score: 1

      This.

      Wake me when I can ditch PHP for Swift. Using the same programming language for both server and client code is a massive advantage that cannot be overstated.

      --
      Assorted stuff I do sometimes: Lemuria.org
    6. Re:Bjarne Stroustrup by Anonymous Coward · · Score: 0

      *Who would it solve problems for?
      -Apple

    7. Re:Bjarne Stroustrup by phantomfive · · Score: 1

      Bjarne Stroustrup once gave some ideas

      Sure that's who you want to be your role model for programming language design?

      Who cares about role model? If what he says is correct and succinct, I will quote him.

      --
      "First they came for the slanderers and i said nothing."
    8. Re:Bjarne Stroustrup by Luke+Wilson · · Score: 2
      Also see http://lambda-the-ultimate.org...
      1. What problem does this language solve? How can I make it precise?
      2. How can I show it solves this problem? How can I make it precise?
      3. Is there another solution? Do other languages solve this problem? How? What are the advantages of my solution? of their solution? What are the disadvantages of my solution? of their solution?
      4. How can I show that my solution cannot be expressed in some other language? That is, what is the unique property of my language which is lacking in others which enables a solution?
      5. What parts of my language are essential to that unique property?
    9. Re:Bjarne Stroustrup by Anonymous Coward · · Score: 0

      If it makes programming easier than with ObjectiveC without performance penalties then a problem is solved.
      So far I checked the language manual and I liked what I saw.

    10. Re:Bjarne Stroustrup by countach · · Score: 1

      Which frameworks? Cocoa in particular, but basically their entire OS-X stack.

      The problem it solves is that Objective-C has its peculiarities: no garbage collection, named parameters, etc etc, and there aren't any other languages I can think of that are modern, full featured, and have those peculiarities. Without those peculiarities they'd have to rewrite Cocoa, and all their apps, and it wouldn't be easy for developers to make a slow transition.

    11. Re:Bjarne Stroustrup by mrxak · · Score: 2

      It gives Apple complete control over their own destiny, which is something Apple likes to have (not exactly news). They now have a language they can tinker with to their hearts' content and no external group or standards body can restrict what they do with it. They've made it very clear they intend to listen to developer feedback and tinker with it, at least in the near future. Certainly even if they do eventually open it up, they'll still be able to extend it however they like and whenever they like in the future, as well.

      They had to pull off some pretty crazy stuff just to make Objective-C usable all this time, and it shows. That's the problem Swift solves. It solves it for Apple. It's dramatically new because Apple controls it completely. Apple can and is obviously deploying it. It's not a distraction since developers can still use Objective-C as much as they want, and will only switch to Swift if it offers significant advantages.

    12. Re:Bjarne Stroustrup by Anonymous Coward · · Score: 0

      I hope this checklist was created in hindsight after realizing what kind of mess C++ became.

    13. Re:Bjarne Stroustrup by Anonymous Coward · · Score: 0

      Despite the walled garden they live in, now they're coding themselves into a corner.

      If their entire platform doesn't want to play nice with mainstream standards and supporting from a software side requires a whole other language, I want nothing to do with it. You might say, 'well now you're missing out on the market', but at what cost? Someone else dictating the tools required to use for an app. At least with Android there's some leeway with languages.

      If I want to develop a mobile app, across all platforms, and I'm forced to use swift to launch on the Apple market place, you've just segregated all potential designers who aren't wholly Apple dev's. I don't own a Mac, and yet now I'm required to use their language, rather than a cross-platform compatible lang, to enter their market place? Get bent!

      I'll stick to Android market place despite the chaos that live. Besides. Despite the hardware in the newest iPhones, every IOS release seems to be 2 steps backwards in UI feel. My 3GS felt snappy compared to what IOS on an iPhone 5 feels like today!

    14. Re:Bjarne Stroustrup by Godai · · Score: 1

      It's not a distraction since developers can still use Objective-C as much as they want, and will only switch to Swift if it offers significant advantages.

      I'm sure that's how it will start, but they'll lose patience eventually, and probably not all that far down the road. Our Objective-C guy here is already reading up on SWIFT despite our large Objective-C codebase, not because he thinks it'll let him improve anything but because he'll need to know it when they deep six Objective-C in a couple of years. To be fair, anyone who writes Apple software should be used to that at this point, so Apple probably knows that any of their developers with an ounce of common sense will start coming up with a plan on how to move all their stuff to SWIFT over the next few years.

      --
      Wood Shavings!
      - Godai
    15. Re:Bjarne Stroustrup by Anonymous Coward · · Score: 0

      I'm looking at this as a reason to up the rate at which I've been converting Obj-C code to C -- i.e., get Obj-C out of everything that's not strictly UI/app delegate code. That way if we're right and Apple foists Swift on as the mandatory language, it'll ease the transition to other platforms.

    16. Re:Bjarne Stroustrup by Anonymous Coward · · Score: 0

      Source?

    17. Re:Bjarne Stroustrup by lhunath · · Score: 1

      If the world ever advanced when it came face-to-face with a problem it could not solve with current models we wouldn't have reached much of anything.

      Obviously the "it doesn't solve any problems" statement is utterly false. It solves all the same problems Objective-C solved.

      So why a new programming language? First of all, new programming languages allow you to express the abstract concepts you're trying to convey in a more optimal fashion. Each time we improve a programming language, we have an opportunity to further close the hole of cognitive dissonance between what we want to do and how we describe that intent to a computer. We have an opportunity to remove whole classes of bugs that were possible in the previous generation languages. We have the opportunity to learn from what we don't like about our current situation and make it more comfortable for ourselves.

      The less we need to worry about how to do the things, the more we can focus on what things we could do.

      Don't be so conservative.

      --
      ``OK, so ten out of ten for style, but minus several million for good thinking, yeah?''
    18. Re:Bjarne Stroustrup by flargleblarg · · Score: 1

      Apple can definitely deploy the new language effectively, but I'm not sure it solves any problems.

      The problem it solves is Objective-C having a steep learning curve and, more importantly, people having a kneejerk reaction to its odd syntax.

      In other words, Swift will have a wider appeal to people than Objective-C. And that means more developers for iOS, which in turns means more money for Apple.

    19. Re:Bjarne Stroustrup by phantomfive · · Score: 1

      The problem it solves is Objective-C having a steep learning curve and, more importantly, people having a kneejerk reaction to its odd syntax.

      I don't think either of those are true. Have you seen the syntax? My favorite example (so far) is the abbreviated functions, can you guess what the following function returns?

      <

      --
      "First they came for the slanderers and i said nothing."
    20. Re:Bjarne Stroustrup by phantomfive · · Score: 1

      Yeah, that's a beautiful theory but in some cases, a new language is just pushing around dirt.
      Swift is just pushing around dirt.

      --
      "First they came for the slanderers and i said nothing."
    21. Re:Bjarne Stroustrup by phantomfive · · Score: 1

      Masterminds of Programming, by Federico Biancuzzi and Shane Warden. Chapter 1.

      --
      "First they came for the slanderers and i said nothing."
    22. Re:Bjarne Stroustrup by taharvey · · Score: 1

      I think you are missing the real point. It isn't about control, it is about next generation systems languages.

      Python isn't a systems language, nor is ruby. They cannot compete with C, C++, or objC. I've got a project right now that I'd love to use a more modern language, but performance, RAM footprint, flexibility... I just can't get out of using C. Complex problems are 200 times slower in python. But what if you have a python-ruby like language that was C performance and footprint... and real time JIT as you write the code in a live-box. Its a pretty important problem to solve.

    23. Re:Bjarne Stroustrup by Anonymous Coward · · Score: 0

      Most of OS X is written in Objective-C, you know. They can't Swift all that in two years. Look at past history--it took them until 10.6 to rewrite the frigging Finder in Cocoa! This is going to be a long term transition.

      Besides, Swift is not ready to replace Objective-C--among other things, it cannot interface with C++ without using Objective-C as wrapper, which is a showstopper for cross platform development.

    24. Re:Bjarne Stroustrup by knarf · · Score: 1

      Another important 'advantage' for Apple is that anything written in this language is locked to their platform, at least for now. The same goes for anything written to the new 'Metal' graphics api. Seen in that light, Swift-the-language and Metal-the-api are comparable to C#-the-language and Direct3D-the-api.

      A bit like that quote Jobs 'stole' from a well-known artist: Good Artists Copy; Great Artists Steal.

      --
      --frank[at]unternet.org
    25. Re:Bjarne Stroustrup by Glock27 · · Score: 1

      The problem it solves is that Objective-C has its peculiarities: no garbage collection, named parameters, etc etc, and there aren't any other languages I can think of that are modern, full featured, and have those peculiarities.

      Your comment is poorly phrased (at first I thought you meant that Swift has GC where ObjC doesn't).

      At any rate, the "peculiarity" of no GC is a feature not a bug. GC based languages have yet to solve the deterministic timing problem, and it's significant for a wide range of applications. GC is also wasteful of memory. ARC provides much the same painless experience, while avoiding the shortcomings.

      Apple provided optional GC for ObjC code for a while, but has now deprecated it.

      --
      Galileo: "The Earth revolves around the Sun!"
      Score: -1 100% Flamebait
    26. Re:Bjarne Stroustrup by pubwvj · · Score: 1

      Sure, let's stick to Fortran.

    27. Re:Bjarne Stroustrup by BasilBrush · · Score: 1

      * What problem would the new language solve?

      It will replace the aging language of Obj-C, that has all the disdvantages of C, and plenty more on top. Allowing for greater safety and more power. Most of the common security bugs cannot happen in Swift. e.g. Neither the recent bug in Apple SSL nor in GnuTLS could happen in Swift code. Nor could any of the buffer overrun bugs.

      * Who would it solve problems for?

      Everyone who currently develops iOS or OSX apps in Obj-C. Both internally at Apple and third parties.

      * What dramatically new could be provided (compared to every existing language)?

      Many features of other modern languages, but retaining interoperability with existing Obj-C software, libraries and memory model.

      * Could the new language be effectively deployed (n a world with many well-supported languages)?

      Absolutely. Every iOS and OSX developer will have it as it comes with new version of the official IDE.

      * Would designing a new language simply be a pleasant distraction from the hard work of helping people build better real-world tools and systems?

      It came from Chris Lattner who was lead developer on LLVM and Clang. He's not simply kicking his heels for lack of work on other tools and systems to help developers.

    28. Re:Bjarne Stroustrup by phantomfive · · Score: 1

      Would you prefer that your statement be categorized as a false dilemma, or a strawman? Because it qualifies as both.

      --
      "First they came for the slanderers and i said nothing."
    29. Re:Bjarne Stroustrup by phantomfive · · Score: 1

      Right, so in all your posts, you defend every new feature in Swift, and any time someone points out a feature that isn't in Swift, you explain why it's not needed. Is there anything you don't like about the language?

      --
      "First they came for the slanderers and i said nothing."
    30. Re:Bjarne Stroustrup by BasilBrush · · Score: 1

      I rather like new modern languages. I similarly defended Python (for being easy, quick and fun to use) and Go (for it's concurrency support). Python caught on despite not meeting all of Strouptrups conditions, and Go didn't.

      Also, unlike many here, I find the limitations and bad design of C annoying.

      So it's hardly surprising I speak in favour of a new language that is meant to improve the very programming platform on which I work, which has one of it's goals as removing all the common design defects of C.

      Anything I don't like? The use of the keyword "in" for closures, and the "if let" construct both seem awkward. But they are the kind of idioms that will become second nature regardless.

    31. Re:Bjarne Stroustrup by phantomfive · · Score: 1

      Anything I don't like? The use of the keyword "in" for closures, and the "if let" construct both seem awkward. But they are the kind of idioms that will become second nature regardless.

      At least you're not a complete fanboy. So good job for that.

      --
      "First they came for the slanderers and i said nothing."
    32. Re:Bjarne Stroustrup by BasilBrush · · Score: 1

      can you guess what the following function returns?

      <

      A syntax error. Of course with 2 parameters, it returns whether one parameter is less than another like in any other language.

      My guess is that you are making a reference to it's use in a closure for sort, from the manual. Which if you give the full line, you have to admit is the one of the clearest and concise and beautiful instructions to sort a collection in any language!

      sorted = sort(names, <)

    33. Re:Bjarne Stroustrup by phantomfive · · Score: 1

      Concise, sure; beautiful, sure (beauty is in the eye of the beholder, but I like it).....clearest? It's clear in the same way COBOL is clear.

      Furthermore, you know that kind of construct is going to be abused to make unreadable code. Perl is clear.....if you write it that way.

      --
      "First they came for the slanderers and i said nothing."
    34. Re:Bjarne Stroustrup by BasilBrush · · Score: 1

      Strange to compare it with COBOL. Cobol is particularly verbose, and stresses defining everything exactly up front. Whereas Swift is concise, and always tries to avoid the need to explicitly state things where they are already fixed by context. Of which this sort line is a great example.

      Any language can be abused to create unreadable code. For C they even have the Obfuscated C contest. It's part of a programmer's job to make his code readable and beautiful. And the examples of Swift suggest that's easy for that language.

      Try to enforce readability on a computer language and you end up with something like Applescript. Which is not much use for heavyweight programming.

    35. Re:Bjarne Stroustrup by phantomfive · · Score: 1

      Strange to compare it with COBOL. Cobol is particularly verbose, and stresses defining everything exactly up front.

      Yeap, but it was explicitly designed to be readable, even by non-programmers.

      Whereas Swift is concise, and always tries to avoid the need to explicitly state things where they are already fixed by context.

      Just like Perl.

      Any language can be abused to create unreadable code. For C they even have the Obfuscated C contest. It's part of a programmer's job to make his code readable and beautiful.

      Yes. Once you realize that the language doesn't matter, the programmers matter, then you have reached wisdom. Every language is crappy.

      --
      "First they came for the slanderers and i said nothing."
    36. Re:Bjarne Stroustrup by BasilBrush · · Score: 1

      Yes. Once you realize that the language doesn't matter, the programmers matter, then you have reached wisdom. Every language is crappy.

      They both matter. You're much more able to construct a readable program with Python than Perl. With Objective-C than C++. With C than assembler.

    37. Re:Bjarne Stroustrup by phantomfive · · Score: 1

      You're much more able to construct a readable program with Python than Perl.

      No.

      With Objective-C than C++

      No.

      With C than assembler

      No.

      All you are saying here is that you suck in Perl, C++, and assembler. Sorry, bro.

      --
      "First they came for the slanderers and i said nothing."
    38. Re:Bjarne Stroustrup by BasilBrush · · Score: 1

      I'm afraid it means you don't know what you're talking about. Both with regards to the languages, and who you're talking to.

      bro.

    39. Re:Bjarne Stroustrup by phantomfive · · Score: 1

      The only people I've met who said you can't write readable assembly haven't much assembly.

      The people who have, know that you can. If you search, you'll find some.

      --
      "First they came for the slanderers and i said nothing."
    40. Re:Bjarne Stroustrup by BasilBrush · · Score: 1

      The only people I've met who said you can't write readable assembly haven't much assembly.

      You make a mistake. I didn't say you can't write readable assembly. I said you're much more able to construct a readable program with C than assembler. Together with a couple of other similar comparisons.

      And every one is true.

      Just as it's true that you are much more able to speak beautifully in French than German, and it's much easier to write a pop song in English than French, and iambic pentameter works much better as a metre in English than Japanese.

      That's not to say it's impossible to do any of these things in any of the languages. Just that they are easier in some than others.

  71. Since when does Qt by RobertJ1729 · · Score: 2

    It's like you forgot that Google exists. http://qt.digia.com/Qt-in-Use/

  72. Yet another C by Animats · · Score: 1

    This looks bad:

    Swift uses string interpolation to include the name of a constant or variable as a placeholder in a longer string, and to prompt Swift to replace it with the current value of that constant or variable. Wrap the name in parentheses and escape it with a backslash before the opening parenthesis:
    println("The current value of friendlyWelcome is \(friendlyWelcome)")
    // prints "The current value of friendlyWelcome is Bonjour!"

    I hope they locked that feature down to constant strings. What could possibly go wrong with a language feature which lets you access arbitrary variables by name at run time by string interpolation?

    (Hey, let's use an email address of "\(SitePrivateEncryptionKey)" and see what happens!)

    1. Re:Yet another C by Brett+Buck · · Score: 1

      If the code can't modify itself, what good is it?

    2. Re:Yet another C by Viol8 · · Score: 1

      You can't use C variable names at run time in C unless you write the program to parse any debugging info that may have been included its the program text. Hardly a trivial task. So I've no idea what you're getting at here. If you mean [some generic security risk] then perhaps you should read up about what C was designed to do - and it wasn't to hand hold novice coders. It was for people who had a clue who needed to write to-the-metal code and drivers for operating systems and it still excels at that task.

    3. Re:Yet another C by countach · · Score: 1

      Well, um, Objective-C is very dynamic by nature. This is useful when you want to do dynamic linking to new versions of libraries, or plugin style libraries with known interfaces, and so forth. It's a feature, and its pretty useful. I never heard of anyone saying it was a security issue.

    4. Re:Yet another C by larry+bagina · · Score: 1

      Are you high? Not even php is retarded enough to do that. It's a compiled language. String interpolation happens at compile time.

      --
      Do you even lift?

      These aren't the 'roids you're looking for.

    5. Re:Yet another C by Animats · · Score: 1

      If you mean [some generic security risk] then perhaps you should read up about what C was designed to do - and it wasn't to hand hold novice coders. It was for people who had a clue who needed to write to-the-metal code and drivers for operating systems and it still excels at that task.

      Here's today's buffer overflow story. C strikes out again. The "I'm so good I don't need subscript checking" crowd of programmers is the problem, not the solution. Low level languages don't have to be as bad as C. (It's sad that Modula died with DEC. We were, briefly, on a path to reliable code.)

    6. Re:Yet another C by Carewolf · · Score: 1

      Yeah, but it hasn't had PHP/Perl style string injection before. That can get nasty. though I am sure this feature is compiletime only considering the "security" focus of the language. If not it could be a serious problem (think PHP SQL-injections).

    7. Re:Yet another C by Viol8 · · Score: 1

      Perhaps you don't understand the concept of a low level language - guess what - it has to be able to access ALL available memory and its not up to the compiler to prevent that. There's probably a damn good reason C prospered and Modula didn't. Also probably most of the base infrastructure of the internet and the cores of most operating systems are written in C so it obviously does the job.

    8. Re:Yet another C by BasilBrush · · Score: 1

      It doesn't happen at run time. It happens at compile time. This code:

      let foo = 2
      var s2 = "a is \(" + "foo" + ")"

      fails to compile with the error: Unexpected '"' character in string interpolation.

      It's simply a very much nicer and less buggy syntax for sprintf.

    9. Re:Yet another C by BasilBrush · · Score: 1

      The GnuTLS category of bug is impossible in Swift. Everything is bounds checked. And your concerns about string interpolation happening at run time are incorrect.

      What you raise are actually strengths of Swift, not problems.

  73. Coming soon... by agapeton · · Score: 1

    ...their IDE named Taylor.

  74. Re:Compatibility is no problem, before or after sw by Moridineas · · Score: 1

    Do you know of any examples of open source iOS/OS X software that demonstrates this separation of writing the user interface in objective-c and the guts in something different (e.g., c++)? I'm a total objective-c novice, but would be curious to see how it's done.

  75. Calling WinRT via middleware is calling WinRT by tepples · · Score: 1

    Anything that doesn't use the Windows Runtime API [...] will not be approved for the Windows Store and will not run on Windows RT

    Digia has already done exactly that with Qt. [See "Getting started with WinRT".]

    If your application runs on "Qt for WinRT", which in turn runs on Windows Runtime, then for the purposes of the Windows Store, your application runs on Windows Runtime.

  76. Re:Since when does Qt "work" with OS X? by Anonymous Coward · · Score: 2, Informative

    http://en.wikipedia.org/wiki/Category:Software_that_uses_Qt

    Wasn't a hard search. Adobe Photoshop Album is in there, Google Earth is in there too.

    From a more personal experience I helped create the windows port of Scrivener (very popular mac program written in Objective-C). The windows-port work was done in Qt/C++ and I did 90% of my development on a mac. And unless you were familiar with the program you would have a hard time picking which was the objective C version and which was the Qt version when they ran side by side on a mac.

    I'm not sure what the problem with XCode support is because I didn't use XCode. I didn't need to. I didn't want to. But then over the last ten years I've worked almost equally over the three major operating systems with a weighting to Linux.

  77. Sandals by Anonymous Coward · · Score: 0

    Sandals wow~~~beauty~~

  78. Re:Since when does Qt "work" with OS X? by 93+Escort+Wagon · · Score: 1

    Runs just fine except for the GUI looking like a complete piece of shit.

    But it does so equally across all platforms!

    --
    #DeleteChrome
  79. Re:Since when does Qt "work" with OS X? by R3d+M3rcury · · Score: 5, Insightful

    There are plenty of apps that use QT--probably the most mainstream one is Google Earth.

    Now, look at me with a straight face and say, "And Google Earth has a great UI!"

    To me, this is the problem with cross-platform UI. It starts from a mistaken premise: Windows and Mac or iOS and Android have the same basic UI. There's even a grain of truth to it. But it doesn't really work.

    The example I love to use is French and English. They are, basically, the same language, right? They both have words, sentences, and paragraphs. They both have nouns, verbs, and adjectives. So if you just translate the words and move around the adjectives, you've got a French/English translator! It's that simple!

    No, not really. If it's 100 degrees outside and you've just come from the outside and remark to a pretty girl "Je suis chaud" (literally, I am hot), she might very well slap your face. Because you've just said that you are hot as in, "Oh, baby, you make me so hot."

    And those are the silly mistakes that cross-platform UIs make.

    Take a simple one from Mac versus Windows: On the Mac, in a dialog box, the default button is always the right-most button. So you have a dialog box that says, "Are you sure you want to do this?" and the right-most button would say, "OK" and the button to the left of it would say, "Cancel." On Windows, the default "OK" button would be on the left with the "Cancel" button the right of it.

    Alignment, again, is a question. I'm not sure there's a standard on Windows--I've seen things centered and I've seen them aligned right. On Mac OS X, there's a standard. Which means when Windows aligns them on the right like on the Mac, I'm always pressing the Cancel button.

    So, yeah, you can use QT to have a cross platform application and it will work fine. And it's great, if you have an application like Google Earth, which has lots of great GIS capabilities so that the result is worth the pain. But, frankly, if Microsoft did an equivalent to Google Earth but made a Mac application that was "correct," I'd use it in a heartbeat. Because, all else being equal, I'd rather have an application that "speaks my language" to one that only sort of does.

    Have you ever spoken to a tech support person from another country with a thick accent? That's the equivalent of using Google Earth on a Mac.

  80. Re:Since when does Qt "work" with OS X? by Anonymous Coward · · Score: 1

    Whatevs, yo. Google Earth is pretty damned mainsteam. If it's not by you metric, then it's your metric that's unscientific.

  81. Re:Since when does Qt "work" with OS X? by garote · · Score: 1

    Whatevs, yo. Google Earth is pretty damned mainsteam. I run it in my browser FFS. If it's not by your metric, then it's your metric that's wrong, not the OP.

  82. Re:Since when does Qt "work" with OS X? by penguinboy · · Score: 1

    Parallels Desktop (virtualization software).

  83. Explicit Nulls by ocirs · · Score: 1

    Apple's decision to enforce explicit nullability via the type system is very interesting/bold. http://deanzchen.com/the-best-...

  84. Re:Since when does Qt "work" with OS X? by sxpert · · Score: 2

    you haven't heard of Google Earth or VLC ?

  85. Re:QT is OK .... by Blaskowicz · · Score: 0

    The Gnome developers are taking care of that.

  86. Re:Since when does Qt "work" with OS X? by macs4all · · Score: 1

    Please provide a link to any mainstream working application for Mac OS X that uses Qt. I don't know of a single one because Qt's support for XCode is incredibly poor.

    Ok, I know for a fact (by having several email volleys with the Developer) that Eagle PCB/Schematic Capture, etc. CAD/CAE suite uses Qt on OS X.

    http://www.cadsoftusa.com/

    And I'm sure there are some others on this list. In fact, about 1/2 of the Qt-based engineering apps listed at the bottom of the page list OS X as a Target OS:

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

    And if you want Proprietary software with OS X versions that use Qt, here's a list. I'm sure you'll recognize most of these apps:

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

    Now, having said all that, Qt is horrible. But not unpopular...

  87. Re:Since when does Qt "work" with OS X? by K.+S.+Kyosuke · · Score: 2

    The scientific method is providing proof --- rhetoric and hot air is great, but science is providing evidence

    Huh? So which one is it, proof, or evidence? Surely the two of them are not the same. Also, scientific evidence is quantitative and statistical in nature, and you're asking for an anecdote. Please stop pulling the term "scientific" into places it doesn't belong; we're not formulating theories of software here.

    --
    Ezekiel 23:20
  88. Don't forget Hypercard by rsborg · · Score: 1

    Apple developped Dylan and later NewtenScript long long before MS had its 'own' language.

    Real apps were written in HyperCard. It was VB before VB existed.

    --
    Make sure everyone's vote counts: Verified Voting
    1. Re:Don't forget Hypercard by angel'o'sphere · · Score: 1

      Hypercard is far beyond what VB ever was.

      Btw. there is a nice project called StackSmith, a port of Hypercard with modern extensions. AFAIK it even runs old stacks.

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    2. Re:Don't forget Hypercard by david_thornley · · Score: 1

      Nitpick: Hypercard was the system. Hypertalk was the language. The first Myst game was a Hypercard stack.

      It really annoyed me when Apple basically dropped Hypercard. It looked to me like one of the better things around for non-programmers who wanted to do simple apps.

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
  89. Let us hope.. by Gumpu · · Score: 1

    .. it is swiftly forgotten.

  90. Incrementing NSNumber in ObjC is UGLY! by mfearby · · Score: 1

    I had to figure out how to increment an NSNumber over the weekend. It's not pretty:

    NSNumber *num = [NSNumber numberWithInt:[num intValue] + 1];

    1. Re:Incrementing NSNumber in ObjC is UGLY! by Anonymous Coward · · Score: 0

      Or there's the modern way:

      num = @([num integerValue]++)

      But really, you shouldn't be using NSNumber objects for trivial arithmetic like that when you still have scalar primitives.

    2. Re:Incrementing NSNumber in ObjC is UGLY! by Anonymous Coward · · Score: 0

      It's been a while since I've touched Objective-C, but "num = @([num intValue] + 1);" should work just as well. NSNumber is also a class that is clearly not designed for arithmetic; if you're using a NSNumber for loop counter or something, you're Doing It Wrong.

    3. Re:Incrementing NSNumber in ObjC is UGLY! by mfearby · · Score: 1

      I was receiving a pointer to an NSNumber in a recursive function and wanted to increment it so that the ultimate caller eventually would have the value. I guess I could use an int internally then set the pointer to the NSNumber to the final result of the int, but that seemed like just as much work. Anyway, I'm ditching Objective-C now that Swift is here, so it's no longer an issue

    4. Re:Incrementing NSNumber in ObjC is UGLY! by BasilBrush · · Score: 1

      In the mean time, this is a more modern and shorter version of your Obj-C code.

      num = @(num.intValue+1);

  91. It's Apple. Who gives a fuck? by Anonymous Coward · · Score: 0

    Seriously. Unless you're some foofy artiste, nobody gives a shit about Crapple.

    Their entire business model has shifted to the assumption that they are the center of all creativity and innovation in the world.

    And now they're going to sue everyone for using their creativity and innovation without paying some obscene licensing fee so nobody there has to every actually do anything.

    Fuck Apple. I wish someone would nuke Cupertino so I didn't ever have to hear from those turtlenecking douchebags again.

  92. Re:Compatibility is no problem, before or after sw by perpenso · · Score: 4, Informative

    Here is a Mac OS X GUI app with a window and a button implemented in objective-c (main.h, AppDelegate.h and AppDelegate.m). The button handler calls C code (Work.h and Work.c) to do some work. Note that if C++ code had been used then AppDelegate.m would have been renamed to .mm so that Xcode would compile it as Objective-C++, necessary to link properly against the C++ code it uses.

    //  main.m
    #import <Cocoa/Cocoa.h>
    int main(int argc, const char * argv[]){
        return NSApplicationMain(argc, argv);
    }

    //  AppDelegate.h
    #import <Cocoa/Cocoa.h>
    @interface AppDelegate : NSObject <NSApplicationDelegate>
    @property (assign) IBOutlet NSWindow *window;
    @end

    //  AppDelegate.m
    #import "AppDelegate.h"
    #include "Work.h"
    @implementation AppDelegate
    - (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
    }
    - (IBAction)buttonPressed:(id)sender {
        some_work();
    }
    @end

    //  Work.h
    void some_work(void);

    //  Work.c
    #include <stdio.h>
    #include "Work.h"
    void some_work(void) {
        FILE *fp = fopen("/tmp/work.txt", "w");
        if (fp != NULL) {
            fprintf(fp, "Hello World\n");
            fclose(fp);
        }
    }

  93. Many Things by SuperKendall · · Score: 1

    Do you know of any examples of open source iOS/OS X software that demonstrates this separation of writing the user interface in objective-c and the guts in something different (e.g., c++)?

    The biggest example would be anything based on OpenCL, where you would do exactly that.

    Also a number of games, use a shell of IOS framework stuff for things like game menus and leaderboards, but the actual game engines are C++ (and I'm not even talking about apps that use third party libraries like Unity).

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

    They've invented FreePascal with a new name and constant definition, 'let' or is that from Basic?

  95. Re:Since when does Qt "work" with OS X? by HuguesT · · Score: 1

    Dear Troll,

    You are wrong and you know it, but please continue.

  96. I have a new language too by Anonymous Coward · · Score: 0

    I have created a brand new language too: Common Routine Acceleration Package. It autovectorizes common control structures to that multi-processing can be applied automatically to every program just by compiling it (and it automagically includes all thread libraries). Its just that some people have complained about the name.

  97. Not impressed... by ventriloquistw · · Score: 1

    I'm personally not impressed with swift... it seems rushed and not well done.

    1. Re:Not impressed... by BostonPilot · · Score: 1

      From what I've read so far, I have to agree. Like lots of people I first went to swift-lang.org and started reading and got really excited. Wow.. Apple has taken this dataflow language and adapted it as a programming language. What a cool way to keep all those cores busy! Finally, a parallel programming language adopted by the mainstream.

      Then I realized my mistake. Now I'm pretty let down. Seems kind of lame, from what I've read so far. Also, I think I prefer the elegant way of handling nil in the runtime versus spreading ?'s all over my code

    2. Re:Not impressed... by BasilBrush · · Score: 1

      Also, I think I prefer the elegant way of handling nil in the runtime versus spreading ?'s all over my code

      The problem is with C like languages you always have to check for nil, because there's never a language guarantee that a value can't be nil. With swift you make the choice. A value (any value, not just pointers) either may have nils or it may not. So if you define it as one that may not you never need to check it.

      As to when you are using nils

      if (ptr) {
      }

      is significantly more heavyweight than using ? on a value.

      Your complaint comes down to fear of something different but better.

    3. Re:Not impressed... by BostonPilot · · Score: 1

      I was talking about the Objective-C runtime making it safe to send messages through a nil pointer, i.e.:

      MyFavoriteClass *mightBeAnObject = nil;

      [mightBeAnObject pleaseDoSomething]; // effectively a noop

      I think that's more elegant than mightBeAnObject?(args)

    4. Re:Not impressed... by BasilBrush · · Score: 1

      It's allowing the same thing, whilst making it clear that the programmer has considered the possibility that the pointer/reference might be nil.

  98. macports by Parafilmus · · Score: 1

    My team has already stopped supporting Mavericks because it apparently does not support GDB.

    You can get GDB (and pretty much every other open source dev tool) from https://www.macports.org/

    https://stackoverflow.com/ques...

  99. Re:Since when does Qt "work" with OS X? by Carewolf · · Score: 4, Informative

    Take a simple one from Mac versus Windows: On the Mac, in a dialog box, the default button is always the right-most button. So you have a dialog box that says, "Are you sure you want to do this?" and the right-most button would say, "OK" and the button to the left of it would say, "Cancel." On Windows, the default "OK" button would be on the left with the "Cancel" button the right of it.

    Oh, stop trolling. You have obviously never used Qt, it will automatically fix the order of the dialog buttons for you. You can even launch the same application under GNOME and get one order, and under KDE and get another. It is controlled by the widget-style it uses. And it does more than that, it also matches the reading direction of the language you are using so that it reverses for Hebrew, Arabic or other right-to-left languages.

    There are things that you need to handle yourself in a crossplatform application, but that is not one of them.

  100. Somebody post a SWIFT example PLEASE! by Anonymous Coward · · Score: 0

    I've been developing iOS Apps professionally for a while now. There are issues with Objective-C, but the function call syntax is hardly one. I'd actually even consider it a benefit. The messages tend to read like sentences. Each parameter gets a name (they're not quite named parameters, as you cannot refer to them by the 'name' inside the method body).

    Consider:
     
    hwnd = CreateWindowEx(WS_EX_LAYERED, TEXT("Hello"), TEXT("World"), WS_OVERLAPPEDWINDOW, 10, 10, 400, 400, NULL, NULL, hInstance, NULL);

    vs.

    hwnd = [SomeClass createWindowExWithExtentedStyle:WS_EX_LAYERED className:TEXT("Hello") windowName:TEXT("World") style:WS_OVERLAPPEDWINDOW x:10 y:10 width:400 height:400 parent:NULL menu:NULL instance:hInstance param:NULL];

    This is a win32 method. And it's a bit of an extreme example. But you should see how the syntax allows for some "self documenting" code. How is this possibly "offensive"? I see code where method And I can't imagine this syntax being a barrier for any one outside of a beginner; any professional should have no problem adapting to this.

    Objective-C is a pretty simple addition to C. Far far simpler than C++.

  101. Re:Since when does Qt "work" with OS X? by Xest · · Score: 1

    I think you've hit the nail on the head, the promise of developing a UI once and having it just work right everywhere is one that's never been realised.

    I think anyone looking for this is probably asking the wrong question when they say "So how do I write a cross platform UI now?".

    I think the best solution for the problem is to write your data and logic libraries in a portable manner and, write the UI that consumes them in a platform specific technology. In practice that probably means write your libraries in C++ and then consume them with a platform specific UI technology like say WPF in Windows.

    So the real question you should be asking is "Can this new technology interoperate with my existing C++ libraries?". If it can't, then just do not bother supporting that platform. This is something Microsoft learnt the hard way and hence why they started supporting exactly this with Windows Phone 8 - they were coming from a low point in the market anyway so why would anyone waste time developing for Windows when they couldn't even carry their shared iOS/Android libraries across?

    The battle is already lost on a technology for good cross platform UI development as it was never practical when we have so many divergent UIs. The battle instead is about making sure code that is platform neutral can be carried between platforms and consumed by platform specific technologies.

  102. Object Oriented Programming by StripedCow · · Score: 1
    --
    If Pandora's box is destined to be opened, *I* want to be the one to open it.
    1. Re:Object Oriented Programming by StripedCow · · Score: 1

      From: http://harmful.cat-v.org/softw...

      “Object-oriented programming is an exceptionally bad idea which could only have originated in California.” — Edsger Dijkstra

      “object-oriented design is the roman numerals of computing.” — Rob Pike

      “The phrase "object-oriented” means a lot of things. Half are obvious, and the other half are mistakes.“ — Paul Graham

      “Implementation inheritance causes the same intertwining and brittleness that have been observed when goto statements are overused. As a result, OO systems often suffer from complexity and lack of reuse.” — John Ousterhout Scripting, IEEE Computer, March 1998

      “90% of the shit that is popular right now wants to rub its object-oriented nutsack all over my code” — kfx

      “Sometimes, the elegant implementation is just a function. Not a method. Not a class. Not a framework. Just a function.” — John Carmack

      “The problem with object-oriented languages is they’ve got all this implicit environment that they carry around with them. You wanted a banana but what you got was a gorilla holding the banana and the entire jungle.” — Joe Armstrong

      “I used to be enamored of object-oriented programming. I’m now finding myself leaning toward believing that it is a plot designed to destroy joy.” — Eric Allman

      OO is the “structured programming” snake oil of the 90' Useful at times, but hardly the “end all” programing paradigm some like to make out of it.

      And, at least in it’s most popular forms, it’s can be extremely harmful and dramatically increase complexity.

      Inheritance is more trouble than it’s worth. Under the doubtful disguise of the holy “code reuse” an insane amount of gratuitous complexity is added to our environment, which makes necessary industrial quantities of syntactical sugar to make the ensuing mess minimally manageable.

      --
      If Pandora's box is destined to be opened, *I* want to be the one to open it.
    2. Re:Object Oriented Programming by Anonymous Coward · · Score: 0

      Wow. Those people (most of them) really don't get it.
      Poor fools.
      Carmack speaks the truth, though. Occasionally a plain old function is the most elegant way.

  103. In related news... by surfcow · · Score: 4, Funny

    ... HR departments began advertising for programmers with 3+ years of Swift programming experience.

    1. Re:In related news... by lhunath · · Score: 1

      Sounds like they're looking for Chris Lattner.

      --
      ``OK, so ten out of ten for style, but minus several million for good thinking, yeah?''
  104. Huh? by sensei+moreh · · Score: 1

    Swift also makes extensive use of variables whose values cannot be changed. These are known as constants

    What am I missing here?

    --
    Geology - it's not rocket science; it's rock science
    1. Re:Huh? by ThePhilips · · Score: 1

      My impression is that they are talking about making immutable objects part of the language.

      I have no details, but in modern languages, const-ness is a context feature, meaning that the same object in different contexts might be both const and non-const. Adding a language-level feature to "freeze" an object and prevent its future modifications would be a welcome addition. For one, it would make it possible for the same class to serve as both mutable and immutable.

      --
      All hope abandon ye who enter here.
    2. Re:Huh? by Anonymous Coward · · Score: 0

      That's nonsense. Modern languages can already do that.

    3. Re:Huh? by ThePhilips · · Score: 1

      For example? C/C++/Java/Perl/Python cannot do it.

      --
      All hope abandon ye who enter here.
  105. /. crasp by Anonymous Coward · · Score: 0

    Boy /. Has gone down the toilet ...where's that site some built to replace it?

  106. Couple of cases? by Anonymous Coward · · Score: 0

    Apple showed off a couple of cases where implementing the same algorithm in Swift provided a speedup

    Only a couple? You can do that in just about any language. Systemic improvements ... I guess they tried but failed or they would be announcing it.

  107. Re:Since when does Qt "work" with OS X? by angel'o'sphere · · Score: 1

    I think you've hit the nail on the head, the promise of developing a UI once and having it just work right everywhere is one that's never been realised.
    All Swing (Java) Applications I worked on are just fine under the targeted platforms (Mac Os X, Linux, Windows).
    Regarding Qt my experience is limited but IMHO the demand for "exact" platform look and feel is overrated.
    Considering that Windows 7 versus Windows 8 is a considerable change as well as Mac Os X 10.8 versus 10.9 is.
    Bottom line I really wonder "who cares"? I never met one who actually cared.

    "Can this new technology ..." ... then just do not bother supporting that platform It is neither a new technology nor a new platform: it is a simple programming language. Targeted for iOS and Mac OS X and you can bet an iOS App written with that language wont run on Mac OS X and vice verse.

    --
    Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
  108. Re:Since when does Qt "work" with OS X? by Kjella · · Score: 1

    Oh, stop trolling. You have obviously never used Qt, it will automatically fix the order of the dialog buttons for you.

    It will do that if you use QDialogButtonBox with buttons from the StandardButton enum, but if you just drag a few QPushButtons on your form in Qt Designer it won't so it does depend on the application developer doing cross-platform right.

    --
    Live today, because you never know what tomorrow brings
  109. What happened to industry standards? by Anonymous Coward · · Score: 0

    Every corporation has their own language for their walled garden environment now. What happened to industry standards and portability of skills?

  110. Re:Compatibility is no problem, before or after sw by countach · · Score: 1

    There's nothing mysterious about it. The Apple compiler I think even lets you mix C++ and Objective-C in the one source file. You just write your business logic in C or C++ and call it from your gui code in objective-C. As long as your business logic is easily callable from a C interface, it isn't hard. Of course, mixing languages is always painful to some extent.

  111. Re:Since when does Qt "work" with OS X? by jo_ham · · Score: 1
  112. Re:Since when does Qt "work" with OS X? by Anonymous Coward · · Score: 0

    The problem with those apps is that they have their own interfaces. They don't look or behave like native applications.

  113. Re:Compatibility is no problem, before or after sw by TheSunborn · · Score: 1

    Don't this code have the problem that you call some_work from the gui thread, and thus will block all updates of the graphics userinterface while some_work is running?

    That problem can be solved, but it is always things such as long running tasks, and async callbacks which causes problems. Especially if you need to populate the gui with the work from some_work, while some_work is still doing its work.

  114. Re:Since when does Qt "work" with OS X? by Xest · · Score: 1

    "All Swing (Java) Applications I worked on are just fine under the targeted platforms (Mac Os X, Linux, Windows)."

    To you yes, but for the end user it's a different story. They like the familiarity of their standard UI elements and Swing doesn't offer that.

    "Bottom line I really wonder "who cares"? I never met one who actually cared."

    Lots of people, if you have interaction with end users you'll see it, it's prolific. Many of them are horrified by even slight differences from the norm let alone when differences result in requirement of slightly different usage patterns.

    If you're doing internal work you can normally get away with slightly crap UIs (though even there it'll raise eyelids), but if you're selling a product it's just tacky to give someone a half-arsed UI because you couldn't be bothered to make something that fits the platform. It's what makes your software lose out against the competition.

    "It is neither a new technology nor a new platform: it is a simple programming language. Targeted for iOS and Mac OS X and you can bet an iOS App written with that language wont run on Mac OS X and vice verse."

    A programming language is a technology so it doesn't make sense to say it's a new programming language but not a new technology, and how are iOS and MacOS X not platforms? I didn't say they were new. I just made the point that if a platform decides to go down the route of rejecting portability of all your code (as Windows Phone 7 did) then just don't waste your time with it. Focus on platforms where you can carry across the bulk of the code that makes up most applications that tends to be platform agnostic, they'll soon change their way to cater to portability of at least some of your code, just like Microsoft had to with Windows Phone 8.

  115. LLVM auto-vectorisation by Misagon · · Score: 1

    Isn't auto-vectorization done in the back-end of LLVM anyway? So it shouldn't matter which programming language was used in the front end.

    --
    "We mustn't be caught by surprise by our own advancing technology" -- Aldous Huxley
    1. Re:LLVM auto-vectorisation by godrik · · Score: 1

      also auto-vectorization is a dream. You can only vectorize code if the memory is properly layed out. Every compilers knows how to vectorize automatically. The quetion is only, is the memory layed out in a way that enables vectorization. And from what I saw, there is nothing smart in Swift to enable that.

      What you need is to teach developpers about the vectorizatino problem. Most developpers do not know or care about it. The most basic point is whether you should use Structure of Array or Array of Structure (SoA or AoS). And most don't know what that means.

  116. Yeah! Especially on the iPhone by Kludge · · Score: 1

    You can still use all the same languages you did before.

    Yeah! We can program in standard C++ on the iPhone like we've always been able to do!

    1. Re:Yeah! Especially on the iPhone by BasilBrush · · Score: 1

      You can program in standard C++ on the iPhone if that's what you want to do. The entry point for an app is the usual C int main(int argc, char * argv[]) {}

      You can do what you like from there. Most people start up Cocoa from there and use Obj-C. But you don't have to.

  117. You are why most software sucks by Anonymous Coward · · Score: 0

    Look, almost all software is an interface between a human and a machine. When you arrogantly decide to ignore half of your implicit interface, your software is going to suck. My project became wildly successful when I pissed off all of my programmers by promoting the human factors guy to management; all of the sudden we had usable software instead of "my module is sexier than yours" competitions that ignored the end product.

  118. Of course by Anonymous Coward · · Score: 0

    The tools and compiler for developing in this language will be available for OSX 10.10 only.

  119. Re:Since when does Qt "work" with OS X? by sh00z · · Score: 1

    Please provide a link to any mainstream working application for Mac OS X that uses Qt. I don't know of a single one because Qt's support for XCode is incredibly poor.

    calibre. Extremely popular in the ebook community. And I have never used the language, but I imagine that you're correct about the issues. Qt on MacOS must be a real PITA, because I've had to submit bug reports for problems that I could have avoided using just Applescript.

  120. This took way to long to happen by Anonymous Coward · · Score: 0

    But I'm glad it finally did. And I love the way it feels very javascripty! :)

  121. Re:Since when does Qt "work" with OS X? by Anonymous Coward · · Score: 0

    But, frankly, if Microsoft did an equivalent to Google Earth but made a Mac application that was "correct," I'd use it in a heartbeat.

    Maps, from Apple.

  122. "Windows RT PCs" --M$ by tepples · · Score: 1

    Seriously, though, this discussion was about PC operating systems.

    Yet Microsoft is trying to confuse the public by calling Windows RT devices "PCs". (Source)

  123. Re:Since when does Qt "work" with OS X? by Altus · · Score: 1

    Avid Media composer.... I know this, because I wrote parts of it myself, in QT.

    --

    "In America, first you get the sugar, then you get the power, then you get the women..." -H. Simpson

  124. Re:Since when does Qt "work" with OS X? by angel'o'sphere · · Score: 1

    To you yes, but for the end user it's a different story. They like the familiarity of their standard UI elements and Swing doesn't offer that.
    HÃ? Why should swing not offer that? Ofc it does, that's the point of it.

    Focus on platforms where you can carry across the bulk of the code that makes up most applications that tends to be platform agnostic That is impossible in the iOS versus OS X case anyway so even more my point: Swift isa new language and not a platform.

    --
    Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
  125. Re:Since when does Qt "work" with OS X? by Anonymous Coward · · Score: 0

    No, not really. If it's 100 degrees outside and you've just come from the outside and remark to a pretty girl "Je suis chaud" (literally, I am hot), she might very well slap your face. Because you've just said that you are hot as in, "Oh, baby, you make me so hot."

    not to nitpick but in french you say "J'ai chaud" which translates to "I'm warm". If you say "Je suis chaud" in Quebec it translates to "I'm drunk"! :-)

  126. Too many things named swift by Anonymous Coward · · Score: 0

    Name's taken apple try harder or are you just going to go around suing everyone who used it before you.

  127. Re:Compatibility is no problem, before or after sw by Altus · · Score: 1

    You are right, but the question is, where do you deal with that threading.... in some cases you would want it dealt with in work.c because you want it to be multi threaded on all platforms... if a task called is going to take a long time and block the UI on one platform it will do it on another.

    Alternatively you could make that decision in the UI code but that would mean handling it on every platform.... now on the mac its pretty easy in Obj-C to dispatch a task to a thread, its probably easier than in C++ so maybe that makes it easiest to handle but then you have to turn around and do the same thing on every other platform you wish to support. I think that if you are supporting multiple platforms you would want your threading code to be in the shared code.... but its a design decision and it really does depend on your project and your needs.

    --

    "In America, first you get the sugar, then you get the power, then you get the women..." -H. Simpson

  128. Re:Since when does Qt "work" with OS X? by Xest · · Score: 1

    "HÃf? Why should swing not offer that? Ofc it does, that's the point of it."

    No it doesn't. It tries, but some of the components are quite different to their standard counterparts. Maybe you're getting confused with SWT?

    "That is impossible in the iOS versus OS X case anyway so even more my point: Swift isa new language and not a platform."

    Incorrect. Both platforms support C++. You can easily write C++ code that's platform agnostic and compiles on either platform.

    Your home page says you're an OO mentor, how can you mentor in OO and not grasp the basic concepts of code separation and reusable code?

    And yes, I know Swift is a new language and not a platform, are you having a discussion with yourself or something as I didn't say otherwise. I said iOS and MacOS are platforms, I said Swift is a technology. A new one.

  129. I sure hope the cre- by Gallefray · · Score: 1

    I sure hope the creators of http://www.swift-lang.org/ have got the trademark/IP. If not, they'd better prepare for an incoming lawsuit.

  130. I would be a punch card programmer by Anonymous Coward · · Score: 0

    I'm glad the industry is run by people trying to advance programming languages and tools otherwise I would be writing my programs by punching cards.
    It's already much faster and easier to deploy quality apps on IOS than Android, It looks like is going to get even easier and faster with this new language.

  131. Re:Since when does Qt "work" with OS X? by R3d+M3rcury · · Score: 1

    Yeah, I'll wait for 10.10 for that. OS X 10.9 is way too flaky.

    Also, Maps doesn't have nearly the features of Google Earth.

  132. Re:Since when does Qt "work" with OS X? by Anonymous Coward · · Score: 0

    I love the "no true scotsman" argument. It's so useful.

  133. Re:Since when does Qt "work" with OS X? by R3d+M3rcury · · Score: 1

    This was always the joke in 7th grade French class, saying "Je suis chaud" instead of "J'ai chaud." That's what I meant when I said "literally", as "Je" is "I", "suis" is "am", and "chaud" is "hot." So if you just translate the words, you get the wrong answer. "J'ai Faim" (I am hungry) has a similar issue,

    As for the Quebecois, well... :^D

  134. Re:Since when does Qt "work" with OS X? by angel'o'sphere · · Score: 1

    Incorrect. Both platforms support C++. You can easily write C++ code that's platform agnostic and compiles on either platform.

    We are talking about UIs, not code for the data model. Hence the term "platform". For non UI C++/Swift code the question of the platform is of nearly no concern (except the size of int etc.)
    And your terminology is wrong again, swift is not a technology, it is a programming language.

    No I'm not mixing Swing with SWT. I doubt you can point out any Swing failure on any supported platform, perhaps you could ten years ago. SWT isa rguable meanwhile not anymore aiming for true platform conform look and feel. Basicaly where every you see a SWT application you imediatly notice: oh this is a SWT application.

    --
    Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
  135. Second Life by anyaristow · · Score: 1

    Please provide a link to any mainstream working application for Mac OS X that uses Qt. I don't know of a single one because Qt's support for XCode is incredibly poor.

    Second Life. They still make regular releases for the Mac (and Linux). It's open source, so you can grab a copy and see how they do it. Xcode not required.

  136. Re:Since when does Qt "work" with OS X? by shutdown+-p+now · · Score: 1

    I can assure you that every time I see a Swing application, I do immediately know that it's a Swing application - and that is on Windows. For one thing, its file selectors are clearly non-native (and otherwise very limited in functionality). Menus aren't quite rendered right. Textboxes don't have the right context menu. Etc... there's lot of small details like that which together make it look exactly like what it is - not native, but trying.

  137. Re:Since when does Qt "work" with OS X? by angel'o'sphere · · Score: 1

    Yes, you told that often enough :)
    However to manage to display a non native filesecltion box the programmer already has to do extra work.
    If you simply use a standard file save dialog and a standard file open one, the system file selection box pops up. No idea how programmers mess this up so often.
    Never saw anything wrong with menus, you must have sharp eyes and be knowing to look for such flaws.
    I have a Swing App on Windows 8 in front of me, and I see no single difference to to other Windows Applications (except that Outlook does look alien, but so does Chrome)

    --
    Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
  138. Re:"Too many things named swift" ... by PPH · · Score: 1

    ... he posted hurriedly.

    --
    Have gnu, will travel.
  139. Re:Since when does Qt "work" with OS X? by angel'o'sphere · · Score: 1

    Perhaps you should read the answers to your post first before making an idiot out of yourself. There are at least half a dozen posts with links ...

    Qt btw. comes with its own IDE, so only a few use XCcde :)

    --
    Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
  140. And a new runtime library by hey! · · Score: 1

    "Kick in the pants"

    --
    Post may contain irony: discontinue use if experiencing mood swings, nausea or elevated blood pressure.
  141. Pass, I'll wait another few decades by Jmc23 · · Score: 1
    until they implement all of Lisp.

    Hell, judging by recent developments, by that time all languages should have evolved to Lisp.

    --
    Don't complain about syntax, grammar, or spelling. There is no.hell like input on android.
  142. bug in the iBook by rewindustry · · Score: 1

    (by god i hate reading documention in iBook form, is the most irritating thing known to man pages)

    page 10, line 2 of the sample code - this seems to be a comparison operation with no consumer.

    following is my opinion only:

    in general the swift documentation is *far* too breathless in it's own praise to be believable, i find.

    the hell of it is i now have another language to support in my own "portable" products, and another whole learning curve, sorting out all the personal little differences these precious lisping clowns have implemented, to meet a demand that will certain fizzle in a year or so.

    unless swift somehow turns out to be genuinely *better* than existing languages, and therefore a real improvement, apple should be taken out and shot, without trial, for pushing bad drugs, essentially, on an already very unhealthy industry.

    so far swift has all the hallmarks of a "vanity" product, and appears entirely constructed of existing concepts, so i do not hold much hope.

    i will, unfortunately, be forced to learn this new beast, cover to cover, in my work, and i do promise to correct my impressions, should swift prove me wrong.

    1. Re:bug in the iBook by BasilBrush · · Score: 1

      On of the things about the iBook format is that page/line numbers depend on what size the window is. So I can't confirm the error you think there is, without a quote of the actual code.

      Your opinion that it will fizzle in a year is misguided. Whilst Apple will still be supporting Objective-C for many years to come, Swift is pretty obviously their preferred development language going forward. So third party Apple developers will certainly use it for new applications once it's out of beta.

  143. Re:Since when does Qt "work" with OS X? by rochrist · · Score: 1

    He keeps ignoring Maya which has been brought up several times.

  144. Re:Compatibility is no problem, before or after sw by perpenso · · Score: 1

    Don't this code have the problem that you call some_work from the gui thread, and thus will block all updates of the graphics userinterface while some_work is running?

    The parent objective-c UI event handler (buttonPressed) has the same constraints as the child C function (some_work). Both should do very very little themselves and/or have a background thread do the work.

  145. Which SWIFT? by unixisc · · Score: 1

    Well, thank you Apple for overloading yet another acronym. SWIFT is already popular in the financial industry for transactional information

    1. Re:Which SWIFT? by BasilBrush · · Score: 1

      Apple's "Swift" isn't an acronym. You can tell because it's not capitalised.

  146. Re:Since when does Qt "work" with OS X? by BasilBrush · · Score: 1

    Calibre is the OSX app with the worst UI I've ever seen. And VLC is pretty bad too, though not as bad as Calibre. So I guess using Qt on OSX isn;t such a great idea.

    Although Google Earth is OK. So perhaps if you are careful...

  147. Re:Since when does Qt "work" with OS X? by spazzmo · · Score: 1
    --
    The cheese stands alone...
  148. Re:Since when does Qt "work" with OS X? by spazzmo · · Score: 1
    --
    The cheese stands alone...
  149. Re:Since when does Qt "work" with OS X? by Bill,+Shooter+of+Bul · · Score: 1

    Mainstream?
    Care to define "Mainstream"? : What percentage of mac users need to run an app for it to be "Mainstream"? How many "Mainstream" mac apps are there, that are not produced by Apple and included with OS X?

    --
    Well.. maybe. Or Maybe not. But Definitely not sort of.
  150. Re:Since when does Qt "work" with OS X? by Simon+Brooke · · Score: 1

    That's a matter of taste. For me everything on MacOS X looks like candy-covered shit on acid, but that's my taste.

    I hated NeXTStep, too.

    --
    I'm old enough to remember when discussions on Slashdot were well informed.
  151. OMG Please no by MooseMiester · · Score: 1

    Am I reading this right? That Objective-C is too hard and we need to remove the idea of strongly typed variables? Please, please tell me it isn't so.

    Murphy's best law Design a system even a fool can use, and only fools will use it

    --
    Murphy was an optimist
    1. Re:OMG Please no by Anonymous Coward · · Score: 0

      But doesn't that pretty much fit Apple's customer base to a tee?

  152. Re:Since when does Qt "work" with OS X? by Xest · · Score: 1

    "We are talking about UIs, not code for the data model. Hence the term "platform". For non UI C++/Swift code the question of the platform is of nearly no concern (except the size of int etc.)
    And your terminology is wrong again, swift is not a technology, it is a programming language."

    I don't know what you're talking about, but I and everyone else weren't just talking about UIs, we were talking about whole applications of which the UI is just a part. A platform consists of more than just it's UI. The term platform can encompass everything from the runtime, to the whole OS, to even the hardware itself, but in this context we were talking about software platforms so down to the OS level primarily. Oh and yes, Swift is a technology, programming languages are a type of technology. Technology is a very generic term, an example definition direct from Google:

    "the application of scientific knowledge for practical purposes, especially in industry."

    I don't know if you have abysmal English and are struggling to say what you're thinking and are coming out with something that's completely nonsense, or if you don't know the topic or what, but you're not making much sense at all given all this.

    "No I'm not mixing Swing with SWT."

    Then you're simply wrong. Swing uses themes that try to closely represent the OS in question, whereas SWT uses JNI to make calls to the native OS UI functionality. Swing's themes are not identical to the underlying OS UI and there are clear differences that stand out like a sore thumb.

  153. Re:Since when does Qt "work" with OS X? by angel'o'sphere · · Score: 1

    So C, C++, Prolog, SQL are technologies?

    Sorry regarding your SWT versus Swing example, you are clearly wrong.

    It does not matter how I achieve a platform conform L&F: may it be a Skin or a native call. SWT does not use that many native cals anyway, perhpas you should install an SWT application, like Eclipse, then you notice the hundrets of non platform conform mini flaws :) (regardless of the fact of using JNI)

    And please stop turning words around. A programming language is not a platform, nor a technology, so your accusion of 'abysmal english comprehension' is ... well, you insult yourself by continuing to argue.

    Our argumemt about Swift, the language, not the technology, not the platform, running on iOS - the platform - and OS X - the platform - came from your 'mashing' everything into one basket. Then you started to suggest I could not architecture a system and I was unable to put reuseable stuff (which is certainly not a UI written in Swift running on iOS and OS X ... and other OSes) into 'libraries'.

    Sorry, read your old posts and stop insulting my or your own intelligence.

    --
    Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
  154. Re:Since when does Qt "work" with OS X? by Xest · · Score: 1

    "So C, C++, Prolog, SQL are technologies?"

    Yes well done, you're beginning to get it now.

    "Sorry regarding your SWT versus Swing example, you are clearly wrong."

    How exactly? Please elaborate, saying someone is wrong doesn't magically make it so.

    "It does not matter how I achieve a platform conform L&F: may it be a Skin or a native call."

    Of course it does. If you're just making native calls to the OS' windowing API(s) like Win32, or MFC on Windows or similar on other platforms then you're just using the methods to render UI components that the OS does which means it is by definition rendered to the standard of the OS. If however you use a skin then it relies on you being able to replicate every single element of the underlying OS, which is something that to date, has never been achieved.

    "And please stop turning words around. A programming language is not a platform, nor a technology, so your accusion of 'abysmal english comprehension' is ... well, you insult yourself by continuing to argue."

    Is there something wrong with you? seriously? I didn't say a programming language was a platform, I said a runtime for a language such as the JVM or the CLR is a platform - it's the execution environment that is the platform. A programming language is however a technology, stop trying to pretend your abysmal understanding of the English language somehow reflects the actual meaning of terms in English, it doesn't. I respect people who make efforts to speak in their non-native language, but not if they start demanding they're right when they misunderstand things. Sorry, but every single English dictionary says you are wrong.

    "Sorry, read your old posts and stop insulting my or your own intelligence."

    I think you're doing that all by yourself by implying well defined English terms are incorrect, and inventing arguments that were never even made. You don't need me to help you.

  155. Is anybody else heavily reminded of Scala? by n01 · · Score: 1

    I didn't have much time to look at the language guide, but in the short time I already discovered many things that exist in Scala, and even the syntax is very similar:
    * Tuples
    * Closures
    * Swift seems to be a functional programming language, even more than Objective-C (the 'functions'/closures there are called blocks).
    * For comprehensions
    * var/val is named var/let here

  156. Nice, but let's see... by Anonymous Coward · · Score: 0

    Google in the past launched *Go* language (1) . Who's talking about it today or using? Facebook recently launched a programming language called *Hack* (2). Who's talking about it today or using? I have my doubts about these *own* programming languages. Does it worth? Does it gain high popularity? Or will this ending up being used just inside the companies that created them? It's something to reflect...

  157. Re:Swift another scripting lanugage by BasilBrush · · Score: 1

    What makes you call it a scripting language? It's not interpreted, and it's primary use isn't to control other programs, nor to be embedded in other programs.

    It's a full featured compiled language, useful for anything that C, C++, Obj-C or Java would be used for.

  158. Ditching PHP (and WebObjects) for Swift/Cocoa by Gary+W.+Longsine · · Score: 1

    Yeah, that definitely shouldn't be overlooked. Apple has a bunch of web-facing apps of their own, implemented in a variety of technologies, including some WebObjects/Java stuff, and some SproutCore/JavaScript stuff. Both of those are essentially clones of portions of (and different generations of) Cocoa (fka NeXTSTEP, which is relevant to recall here, because the WebObjects clone is that old, despite the fact that one of the largest stores on the Internet, iTunes, is built on it).

    Here's an interesting political history of WebObjects around the time we last heard from it. As strange as it may seem, there's still an active WebObjects development community despite it being essentially self-supported for nearly a decade, now. Many of the developers in that community were, previously, Objective C developers, and the ones that survived the transition to Java are language agnostics. I suspect they might welcome the opportunity to migrate to a Swift/Cocoa web stack.

    It will take some while, but Apple has just made the first step to a "language mindshare" play in the web application space.

    --
    If you mod me down, I shall become more powerful than you could possibly imagine.
  159. mainstream standards by Gary+W.+Longsine · · Score: 1

    Time was, phrases like, "if their entire platform doesn't want to play nice with mainstream standards" were deployed by Microsoft dweebs against UNIX geeks. Did you not notice that iPhone apps are written in Objective C / Cocoa? Swift could just as easily be called, The New Objective C, or Objective C^3, or Objective Cocoa, and none of what you're griping about has changed at all, since the iTunes App Store was first deployed. You don't own a Mac, so you're already not in the iTunes App Store market. Why, again, do you care about this discussion, at all?

    --
    If you mod me down, I shall become more powerful than you could possibly imagine.
  160. Re:Since when does Qt "work" with OS X? by Anonymous Coward · · Score: 0

    I don't think you get the gist of the post. Qt does a tremendous job, but there are just so many little differences that it is hard to get it right. I've developed using Qt for years and it is probably the best cross platform GUI toolkit out there. Still I can tell in less than a minute if a Mac app is made in Qt or Cocoa. The spacing and alignments of buttons and labels are not quite right. Many things have no clear translation between platforms. E.g. Windows and Linux doesn't have inspectors as a common UI element, or a standard look and placement for preferences dialog. A OSX preference dialog doesn't look anything like one on Linux and Windows.

    The alignment of GUI elements used on OSX is hard to achieve with the layout management approach of Qt.

    I can't remember if this is right or not off that bat but I believe keyboard focus doesn't work the same way either.

    Conventions are just too different. E.g. on windows one loves to have lots of toolbar icons. E.g. for Save, Open etc. This is almost never done on Mac. It is very hard to make a tool translate all these conventions and practices automatically.

  161. i was wrong by rewindustry · · Score: 1

    turned out the code i was objecting to works in a thing called a sandbox - so a comparison "statement" is legit in the directly interpreted sense - the ibook just assumes i know what a sandbox is, and does, in order to make sense of it's examples.

    your point about obj-c is valid, i think - will stick to providing support at this level, let apple and the swift people build their own bridges, if needed.