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.
Swift name (Score:1)
I thought it was talking about SWIFT the object store, part of Openstack. Apple should have called their language iSwift.
Just what we needed... (Score:3)
Re:Just what we needed... (Score:4, Insightful)
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.
Re:Just what we needed... (Score:5, Insightful)
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.
Re: (Score:1)
What I find interesting is the ability to create new operators. Not just overloading existing ones, but creating new ones that affect parsing -- prefix, postfix, or infix with custom precedence and associativity.
Custom operators can begin with one of the ASCII characters [list of punctuation dice considers junk characters], or one of the Unicode characters defined in the grammar below. After the first character, combining Unicode characters are also allowed. You can also define custom operators as a se
Re: (Score:3)
Re: (Score:2)
Whatever you say, AC. However, I'm totally not surprised by a C-level executive and "Architect"-with-a-capital-A extolling the virtues of Java, Web UIs and giving the old song and dance about cross-platform only being about "performance."
Application vendors desperately want the platform to be a dumb pipe that disappears in order to deliver the Pure Application Experience. Platform vendors des
Re: (Score:1)
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.
Re: (Score:2)
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."
Re: (Score:2)
"We wouldn't have swallowed this at NeXT", said Ross perorally.
Yeah but does it run on (Score:3)
Linux? Or do I have to buy a mac.
Yeah but does it run on (Score:2)
learning curve? (Score:1)
>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?
Re: (Score:2)
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...
Re: (Score:3)
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)
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
Re: (Score:3)
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.
Re: (Score:2)
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.
Re: (Score:2)
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
Re: (Score:2)
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
Re: (Score:2)
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.
Re: (Score:1)
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.
Slight Misunderstanding (Score:4, Informative)
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"
Embracing the bird (Score:1)
Re: (Score:2, Funny)
I love his Geraldine character.
Re: (Score:1)
What are you, 60?
Re: (Score:1, Insightful)
Don't rag on people for getting old. That kinda is the goal, isn't it?
Re:Embracing the bird (Score:5, Funny)
If you start with PHP, even Brainfuck looks fun and refreshing. Jesus pal, talk about damning a language with faint praise.
Re: (Score:2)
Now that's just not true. Brainfuck is worse than PHP. So, for that matter, is whitespace.
Re: (Score:1)
Re: (Score:1)
exaggerating slightly for comic
Prerequisites (Score:1)
"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.
Re: (Score:1)
"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.
Re: (Score:2)
"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.
Re: (Score:2)
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.
Re: (Score:2)
Re: (Score:1)
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?
Re: (Score:2)
Re: (Score:1)
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.
Re: (Score:2)
and most indy devs won't throw out a grand for a machine with no guaranteed payback.
Good. With 1.3 million apps in the Apple App Store, there's enough already. Cutting out people who by their choice of PC show themselves to be less aware of good design is no bad thing.
That, mate, is what we call "bigotry". There are many factors influencing choice of development machine. For the dev with a family, that includes paying for the kids' clothes.
Re: (Score:1)
If your development income isn't paying for your development machine, then you're not a professional. I'd rather buy from professionals than amateurs.
Re: (Score:1)
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.
self linking content now? (Score:1)
You typed "I love Dice".
we're self linking now?
self linking content now? (Score:1)
SWIFT will be great for agile development ... (Score:3)
YACC (Score:1)
More Swift Shennanigans (Score:1)
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