Catch up on stories from the past week (and beyond) at the Slashdot story archive

 



Forgot your password?
typodupeerror
×
Programming Apple

A Beginner's Guide To Programming With Swift 72

Nerval's Lobster (2598977) writes Earlier this year, Apple executives unveiled Swift, which is meant to eventually replace Objective-C as the programming language of choice for Macs and iOS devices. Now that iOS 8's out, a lot of developers who build apps for Apple's platforms will likely give Swift a more intensive look. While Apple boasts that Swift makes programming easy, it'll take some time to learn how the language works. A new walkthrough by developer David Bolton shows how to build a very simple app in Swift, complete with project files (hosted on SourceForge) so you can follow along. A key takeaway: while some Swift features do make programming easier, there's definitely a learning curve here.
This discussion has been archived. No new comments can be posted.

A Beginner's Guide To Programming With Swift

Comments Filter:
  • by Anonymous Coward

    I thought it was talking about SWIFT the object store, part of Openstack. Apple should have called their language iSwift.

  • by __aaclcg7560 ( 824291 ) on Thursday September 18, 2014 @04:55PM (#47940613)
    Another language filled with adverbs [fun-with-words.com].
    • by MightyMartian ( 840721 ) on Thursday September 18, 2014 @05:16PM (#47940783) Journal

      Another attempt by a vendor to try to lock in software development and make cross platform development incredibly difficult by introducing a new language.

      Fuck, I do tire of the sociopathic tendencies of corporations.

      • by iluvcapra ( 782887 ) on Thursday September 18, 2014 @06:28PM (#47941213)

        Thank god we have Android Dalvik, where I can use my existing Java ME codebase. Oh wait.

        We're going from Obj-C to Swift, this seems like a pretty lateral move from a "cross platform" perspective. I would have thought the Great Java Wars had taught everyone that true cross-platform development is a chimera that isn't worth either the vendor or developer's effort. Platform vendors compete on features -- cross platform is antithetical to competition on features.

        • by irq-1 ( 3817029 )

          I would have thought the Great Java Wars had taught everyone that true cross-platform development is a chimera that isn't worth either the vendor or developer's effort. Platform vendors compete on features -- cross platform is antithetical to competition on features.

          Remember when people called browsers "platforms" and the websites were "applications"? 20+ years of the web has shown that cross platform works, that what counts as a platform is malleable, and that the features companies compete over, change over time. Today in mobile language is a feature in contention, but if Cordova [apache.org] (et al.) become popular, Apple and Google will compete over different features.

      • Another attempt by a vendor to try to lock in software development and make cross platform development incredibly difficult by introducing a new language.

        ... because writing Objective-C Apps using the Cocoa object framework is the very model of cross-platform development.

        What surprises me is that it Apple until now to "make cross platform development incredibly difficult."

    • "We wouldn't have swallowed this at NeXT", said Ross perorally.

  • by Spy Handler ( 822350 ) on Thursday September 18, 2014 @05:00PM (#47940659) Homepage Journal

    Linux? Or do I have to buy a mac.

    • The 1.0 syntax was just barely frozen. There are a couple open source swift implementations (check github... you won't find them on source forge!) that are making progress. Not sure how useful it would be without a Cocoa/OpenStep library, though.
  • by Anonymous Coward

    >A key takeaway: while some Swift features do make programming easier, there's definitely a learning curve here.
    you don't say?! One would expect Apple had essentially done away with learning curves so that just about anyone and their uncle can write great apps in just a few minutes! Programming is so overrated, how hard can it be?

    • by narcc ( 412956 )

      They did ... once upon a time. Remember HyperCard?

      I don't know why people are so desperate to believe that programming is difficult. How old were you when you (very likely on your own) learned to program? 8 or 9 years old?

      I know, I know, if we give the unwashed masses simple and powerful tools they'll write bad code. The horror. Better leave it to the professionals. Surely, they never produce unmaintainable garbage...

      • Programming is sort of like cooking. Anyone can learn the basics and make some interesting and satisfying stuff - even an eight year old can to do some rudimentary stuff. I'd even venture to say that many people can make a living at it, as there are lots of jobs that don't involve doing incredibly demanding tasks - just basic production work. But there are also top tier jobs that require extremely experienced and talented professionals with years of study under their belt. Not everyone is suited for tha

        • Re: (Score:2, Insightful)

          by narcc ( 412956 )

          That's delusional. I've been at this longer than a lot of users here have been alive, yet the only "complex" applications I've seen are either unnecessarily complex or complex for reasons completely unrelated to programming.

          It's not like cooking at all. That's just wishful thinking.

          Programming is easy. Ridiculously easy. You know this, I know this. Why hide it?

          Why not produce easy tools for non-programmers to use? We use programming languages to make writing software easier, after all. Why are modern

          • I happen to have written large-scale commercial videogames in C++ for most of my career. I've worked with lots of people, many smarter than me, and I don't recall anyone talking about how their programming work was "ridiculously easy". I'm glad everything is so simple for you, but apparently we're not all so fortunate.

            • Well, to be fair *writing code* is pretty easy. But designing complex systems for reliability and maintainability is not. I suppose the GP believes that programming is the former, whereas I would have thought that it's more of the latter.

              • Yeah, well, of course "writing code" is easy, just like typing coherent sentences in English is rather easy. It doesn't mean it's easy to write a novel any more than it means "programming is easy". The difficulty scales along with the scope and complexity of what you're trying to accomplish, as with most things in life.

                Honestly, I was trying to exit the topic of conversation gracefully, because it didn't sound like he was open to any sort of reasonable discussion, and feels more like a trolling attempt th

                • by narcc ( 412956 )

                  it didn't sound like he was open to any sort of reasonable discussion

                  Well, you're right about that. A "reasonable discussion" isn't possible here. Can you have a "reasonable discussion" with a creationist? Neither can I. All you can do is show them the facts. It's up to them to accept reality, just as it's up to you.

                  Just look at the parent here:

                  designing complex systems for reliability and maintainability is not

                  Ah, but it is! (Hell, if it's actually complex, it's not maintainable.) See, most "complex systems" are only complex because of how their designed (poorly). Yes, some things are actually complex but that's generally completely

        • I'd rather have a good car analogy.

          Programming is like driving a car: some people are incapable of driving without killing bystanders or themselves, the majority can get by quite happily going shopping, and a few are F1 racing drivers.
          Most programs, and especially most iPhone apps, are my mum going to Tesco's, not Lewis Hamilton pipping Nico Rosberg by two hundredths of a second in the final title-deciding race of the season.

      • by Tablizer ( 95088 )

        Learning programming is relatively easy. Learning to write maintainable code, on the other hand, takes skill and experience.

        Clerks and accountants used to do amazing things with Lotus-1-2-3 macros because Lotus cleverly leveraged what users already knew about spreadsheets into a Turing Complete set of commands. But often these users eventually got themselves into a jam, or made something that nobody else could decipher.

  • by iluvcapra ( 782887 ) on Thursday September 18, 2014 @05:14PM (#47940753)

    TFA is actually mostly a Cocoa application stack guide. Discussion of the actual distinguishing features of Swift is minimal -- in fact I think the only thing they even passingly mention is unwrapping of Optionals. Otherwise it's just "How to build an iOS app"

  • I have started going through the "Skip Wilson" tutorials and have found the language quite refreshing - borrowing mainly from JS / Java / Python imo. But then again anything more refreshing than my PHP day job.
  • "You need a Mac that can run OS X Mavericks"

      A key takeaway:No wonder Android has more Apps(sic) than iOS after starting from behind.

    • by Anonymous Coward

      "You need a Mac that can run OS X Mavericks"

        A key takeaway:No wonder Android has more Apps(sic) than iOS after starting from behind.

      Because your dev machine for this new language can't be more then 6 years old? Yeah, sure.

      • "You need a Mac that can run OS X Mavericks"

        A key takeaway:No wonder Android has more Apps(sic) than iOS after starting from behind.

        Because your dev machine for this new language can't be more then 6 years old? Yeah, sure.

        No, because your dev machine for this new language has to run a particular operating system, and most indy devs won't throw out a grand for a machine with no guaranteed payback.

        • I'm uncertain of the statistics on this, but whenever I see photos of "Indy dev" conferences I always see a lot of silver laptops with glowing fruit. I think most of these people are already equipped.

          • Well here's a question for you then... do most indy devs go to indy dev conferences? I've never been to one....
            • Those that do go to conferences show themselves to be open to new ideas and to networking with other developers. Are they likely to be better or worse developers on average than those that don't go?

              • I don't buy that logic. Some people who go to conferences will be posers who are still playing at being devs, but will never release a product.
                • Note the words "on average". For sure there will be some people such as you describe. But their proportion is a hell of a lot higher amongst those who's only commitment was downloading an SDK.

    • Android only has more apps if you count malware and crapware. The app store guidelines and the need to get past a human tester is far more of a restriction on app numbers than the need to have Mavericks. The number one reason for app rejections is the discovery of bugs by the approvals staff. Equivalently buggy apps will find their way into the Android stores without any barrier.

  • You typed "I love Dice".

    we're self linking now?

  • by PPH ( 736903 ) on Thursday September 18, 2014 @09:06PM (#47942047)

    ... Tom said spryly.

  • Yet Another Programming Language
  • by Anonymous Coward

    I've been learning Swift for the last few months. My last few years have been solid ActionScript 3 and I've really enjoyed the move. "Proper" strong typing, didSet observers, optionals, generics, and so on and so on are all a happy revelation to me.

    I'm now tinkering with everything from component creation to Grand Central Dispatch for threading to drawing Hermite spline curves to applying filters to images to fluid dynamics. If you're on the London Underground and see a chap frantically typing on a little M

Time is the most valuable thing a man can spend. -- Theophrastus

Working...