

I Don't Know Swift - speg
http://robnapier.net/i-dont-know-swift?utm_content=buffer6acce&utm_medium=social&utm_source=twitter.com&utm_campaign=buffer

======
wiremine
Great article. Swift is one of those rare opportunities where the barriers to
entry are reset, and any dev willing to put in the effort can be rewarded.
Feels like Java felt 17/18 years ago, but only much more accelerated. The big,
BIG difference is you need to commit to a single platform, whereas Java
ran/runs on Windows, Mac, Linux, etc.

Swift isn't a language that opens your mind like Lisp or Haskell, but it seems
like it is a language that can reset a career.

~~~
scrollaway
Truly I wish Swift was cross platform, then I would commit myself to learning
it and doing cool things with it.

As it stands though, it's just another walled garden. Aren't developers tired
of those yet? Even microsoft started opening up .NET a lot more. Who, in 2014,
creates a new _programming language_ and thinks it's a good idea to lock in
the developers to Apple products?

Maybe the language will be a revelation and it'll be implemented by volunteers
on Linux and what not. But until then, what's the point?

Tell me, iOS/OSX developers, why bother? I want to know why people think it's
a good idea to learn Swift at this point (other than purely for technical
curiosity which is great).

~~~
laichzeit0
To be fair, learning a new language is a joke. It doesn't require a
substantial investment of time.

You're most likely going to be gluing API calls together and that's where
you'll spend 80% of your time: Learning APIs. Even then this is more likely
looking things up in documentation or googling for answers on StackOverflow.
Whether you glue them with Python, Ruby, Objective-C, Java, Swift, etc. it
really doesn't matter.

If a new programming language is your only gripe then you have a way bigger
problem on your hands when it comes to writing applications :)

~~~
cabalamat
> To be fair, learning a new language is a joke. It doesn't require a
> substantial investment of time.

I suspect Peter Norvig would disagree with you there --
[http://norvig.com/21-days.html](http://norvig.com/21-days.html)

> You're most likely going to be gluing API calls together and that's where
> you'll spend 80% of your time

For certain problems this is the case, and you can get away with writing
Python/Ruby/etc in Swift syntax.

For other problems it isn't the case. Choice of language does matter; if it
didn't, would Apple have invented Swift in the first place?

~~~
nknighthb
Learning to program is not the same as learning a new language. Norvig is
talking about something utterly different that has no relevance here. It's
even hinted at in his own words -- "Learn at least a half dozen programming
languages.".

~~~
cabalamat
> Learning to program is not the same as learning a new language. Norvig is
> talking about something utterly different that has no relevance here.

At least in parts of his essay, Norvig is talking about learning a new
language when one already knows how to program. For example, where he says:

 _In 3 days you might be able to learn some of the syntax of C++ (if you
already know another language), but you couldn 't learn much about how to use
the language. In short, if you were, say, a Basic programmer, you could learn
to write programs in the style of Basic using C++ syntax, but you couldn't
learn what C++ is actually good (and bad) for._

------
austinz
The linked Twitter post does bring up a good point: I wish Apple would make it
easier for third parties to build tooling for the iOS/OS X development
environment. Stuff like alternative IDEs, Xcode plug-ins, tools for
instrumentation/debugging, alternative simulators. Some of this already exists
out there (e.g. AppCode), but most of it is really dependent upon the often-
buggy first-party tooling. Better support for third-party tooling would
ameliorate the pain developers feel when Xcode doesn't work well.

I don't even see any downsides. A thriving third-party tooling ecosystem would
only serve to lure more developers, resulting in more applications and
increased hardware and software revenue. It's not like Apple currently makes
money selling its development software to developers.

~~~
ghshephard
I think we can be reasonably certain that Apple will not support, and,
wherever possible, will actively discourage the development of third party
primary development environments. They learned their lesson with CodeWarrior,
and aren't going to let third parties take a leadership role in their
development environment.

~~~
gdwatson
For the sake of someone who has never developed on a Macintosh and only saw
CodeWarrior in action a few times, could you explain what happened and how
Apple responded?

~~~
rsynnott
It became the de facto development platform for MacOS, then when Motorola
bought it they started de-emphasising MacOS support, eventually dropping it.
Apple responded by putting a lot more work into their own development tools.

------
mushishi
"If you’re reading my blog, there’s a decent chance that I know more about
Objective-C than you do. I have opinions about it. You should take them
seriously even if you disagree."

That's a weird way to start an article. I was hesitant to read the rest. And
the rest of it was a mixed set of odd arguments, e.g. "I predict with great
confidence that Swift will be TIOBE’s language of the year."

I have no idea why would I be interested on your prediction on a not-very-
useful index.

I don't even understand his argument: he is complaining that normally
languages are evolved in small circles before publishing, and says that Swift
has come naked, half-baked, to the world but then also remembers to say it
isn't even released (!)

~~~
peteretep
Did you just read the first half of the article?

The rest of it is the main point.

Given that it's likely to be very very popular, and nobody can claim to be an
expert, you can be one of the most knowledgeable people in the world about it
by getting in now. Want to be the author of a very popular framework in a very
popular language? Write a framework now in Swift.

~~~
mattgreenrocks
These are exceedingly poor motives.

Write a framework in Swift if the abstractions it introduces are considerably
better and more conceptually complete than the existing tools.

Otherwise you're not really improving things, just piling on more crap for
people to learn.

~~~
peteretep
Dude! There are no existing tools!! That's the point of the whole article!!!

------
archagon
I'm currently building an imitation of Apple's keyboard in Swift
([https://github.com/archagon/tasty-imitation-
keyboard](https://github.com/archagon/tasty-imitation-keyboard)). Learning
process has been pretty easy so far: a few hours with the documentation and
the rest picked up along the way. Playground was _great_ for getting up to
speed. It's pretty fun to be on the vanguard of a new, evolving language and
have it actually be capable of production use. Also very frustrating: there
are a number of design decisions that drive me crazy (lack of auto casting
between CGFloat/Float/Double/Int... _usually_ ), and the latest Xcode and
compiler betas have a bunch of bizarre non-deterministic bugs, performance
issues, and error messages that have nothing to do with my code and require
workarounds. I'm a little too lazy to file Radar bugs for them — Apple is not
paying me to write bug reports, and they'll surely get discovered by others —
but I'm really looking forward to writing a brief postmortem when I'm done.

(PS the code is super messy right now. I'm in the "hack away" phase, cleanup
will come later.)

~~~
m4x
> Apple is not paying me to write bug reports, and they'll surely get
> discovered by others

So you are happy to write a long comment here in exchange for karma, and are
excited to blog later in exchange for eyeballs, but won't submit radars to
improve your tools because Apple isn't paying you?

~~~
archagon
These are bugs that _will_ be found, unlike most other Apple bugs. Also, I'm
busy and bug reports take forever to write and reproduce, especially for the
kinds of eisenbugs that I'm seeing. Why so judgey, friend?

------
Zaheer
I'd have to agree that it's not fully baked but as someone learning it
currently, I have to say that it's a pretty awesome language. It fixes a lot
of the annoyances I have about other languages and wraps it all together.
Things like multiple returns, closures, etc are super handy features that I've
wanted in other languages.

Shameless Plug: Check out www.LearnSwift.tips if you're trying to learn. It
was born out of my desire to learn Swift and is just a simple curation of
resources, tutorials, code samples, etc to learn Swift.

~~~
rectangletangle
When you say multiple returns do you mean something like generator functions,
functions that return some form of tuple like construct, functions with
variable return types, or something else? I haven't looked into Swift much at
all, so I'm curious.

~~~
interpol_p
Tuples are used for multiple returns in swift.

So a function definition might look like:

    
    
        () -> (Int, String)
    

(Function that takes no parameters, returns an Int/String tuple)

Edit: Tuples can also have named parameters, so something like this is
possible:

    
    
        () -> (index: Int, name: String)
    

Then the resulting tuple can be accessed by name:

    
    
        //Where x is a tuple returned from the above function
        x.index
        x.name

------
amtab
I think this post makes a valid point, and I also think it's important to
remember that Objective-C has also been changing incredibly fast during the
Apple's meteoric rise and the accompanying developer interest. Swift did not
come out as fully baked as some might like, but Apple made the right move
releasing it sooner rather than later.

Forcing developers to use a language with as much baggage as ObjC couldn't
continue, particularly when compared to the much preferred web languages. ARC
and Storyboards were big changes but with the amount of headaches developers
have suffered dealing with the App Store, they needed something exceptional to
keep old talent and bring in new I believe.

I'm excited to see how fast Swift can be baked, but just judging from HN /
Reddit it is earning Apple a lot more developer love than any time in recent
memory.

------
jimmcslim
In the wake of the Swift announcement, it feels like some 'incumbent' iOS
developers are saying 'sure learn Swift but if you want to do iOS dev you
still need to know Obj-C' (as opposed to 'sure learn Swift but if you to want
to do iOS dev you still need to know UIKit' which I agree is obvious) as a
strategy to protect their turf.

Or perhaps it is just words from the wise?

~~~
mikeash
There are several reasons I'd say someone still needs to know Objective-C.

Swift is still half-baked. No, make that quarter-baked. It is not newbie
friendly. Vast areas are undocumented, the IDE is even more unstable than
usual for Apple, the compiler crashes constantly (I probably crashed it more
than a hundred times just in the first week), the standard library is lacking,
etc. etc. All of this makes it pretty difficult for veterans to work with. If
you're new to iOS, or god forbid new to programming in general, you're going
to have an extremely difficult time.

Virtually all the sample code is in Objective-C. Discussions assume
Objective-C. The APIs, though translated to Swift, are still rooted in
Objective-C. Trying to follow all of this without knowing some Objective-C is
going to be tough.

In a year or two, when the language is solidified, then going straight for
Swift will probably be viable. But right now, it's a terrible choice for
anyone new.

It has nothing to do with trying to protect our turf, and that's rather
insulting. I feel no need to protect my turf, because as an arrogant dickhead,
I feel secure in the knowledge that I will still be a better programmer than
90+% of the folks out there no matter how much good advice they get. I've
never even _heard_ of anyone remotely competent deliberately giving out bad
advice to protect themselves.

~~~
josephlord
Beta 3 might be half baked. The array semantics are fixed and it crashes far
far less. For the first two betas quarter baked was definitely a fair
description.

------
blisterpeanuts
As a mostly-Java, Android and web apps type of developer who's only recently
gotten into ObjectiveC iOS app development, I have two questions for the
community:

1\. Will Swift be cross-platform or is it going to be strictly for MacOS X and
iOS app development?

2\. Will Swift apps run on older versions of OS X and iOS? I've seen differing
opinions (e.g., [http://stackoverflow.com/questions/24001778/do-swift-
based-a...](http://stackoverflow.com/questions/24001778/do-swift-based-
applications-work-on-os-x-10-9-ios-7-and-lower))

~~~
jamieomatthews
Personally I think Swift could really change things for apple if it could be
used for server side scripting. An integration with core data, and you could
easily share Models on the client and server side.

It would make it a no brainer language to use for a mobile app, because you
could kill two birds with one stone. To date however, apple has made no
comment about cross platform development

~~~
Touche
But you'd have to use Mac servers, right?

~~~
jamieomatthews
Unless they open source it, yes.

Knowing apple, I feel that they would have an off the shelf solution that you
could just push code to. Almost like a parse type solution, integrated through
Xcode.

------
Alex-Galapagos
Swift isn't stable yet.. You can't do big projects in it.. We did some stuff
in Swift..but it's not something that can be scaled as of right now

~~~
r00fus
What were your scaling issues in particular?

~~~
Alex-Galapagos
We learned Swift right after it came out , then we realized that it's just not
mature enough and stopped our project

------
sergiotapia
So here's a question for you mobile devs guys. I'm a software developer with
experience in C#, Ruby and enough Go to be dangerous, where do I start
learning Swift?

I imagine it's a twofer, learning Swift AND learning the iOS bits.

I don't mind paying money for a solid learning resource. Thank you.

~~~
Zaheer
My process so far (I'm still learning): \- Learn the basics of Swift the
language
[https://developer.apple.com/library/prerelease/ios/documenta...](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/GuidedTour.html#)

\- Watch the Stanford iOS Intro videos to become acquainted with the iOS way
of doing things [http://online.stanford.edu/course/developing-ios7-apps-
fall-...](http://online.stanford.edu/course/developing-ios7-apps-fall-2013)

\- Start coding some projects and just learn as you go. It seems as if you
know enough programming fundamentals to jump right into it with some basic
intro material. Do check out my site www.LearnSwift.tips as well.

~~~
charlespwd
I'm going to emphasize this and add that writing Stanford's course example
apps in Swift instead of ObjC is really a great way to learn the language.

------
iwaffles
The article starts off by setting a negative tone.

"If you’re reading my blog, there’s a decent chance that I know more about
Objective-C than you do. I have opinions about it. You should take them
seriously even if you disagree. "

It's confusing when trying to understand his point and in all fairness I don't
think it added to it.

Even the title is a bit self-serving after reading the opening paragraph, "I
don't know swift" can be loosely translated into, "I don't know it so it must
be new."

He makes a good point that we can help grow swift into a better "fully-baked"
language by contributing.

I think the article would have been much better without the first paragraph. I
think there would be less confusion amongst readers and would have set a
lighter tone.

------
59nadir
I think the sentiment of this piece is very sound, but I don't know why I
would ever expect anything out of Apple to be up to me to change. I've never
known them to listen to anyone about anything and I don't know why this is an
exception, even if listening would make sense.

Most likely a lot of people have already told them that Swift being limited to
one platform is a massive mistake and if they're not listening to that I'd
rather just give up on them now.

------
pohl
If you had to estimate how long it would take for the community to start
producing code exemplifying whatever "idiomatic swift" turns out to be, how
long do you reckon it will take?

------
Derbasti
It is incredibly risky to release this unto the world without having tryed it
internally. I hope they can iterate quickly enough to iron out the most
glaring problems before the language is ossified by the amount of code already
written in it.

Otherwise, we might just get stuck with something half-baked that never had a
chance of growing up before widespread adoption.

~~~
interpol_p
It seems to have been used internally for some time. The public WWDC app was
written in Swift, and many Apple engineers had moved to using Swift entirely
by the time it was announced.

The most glaring problems exist in the IDE support for the language, not the
language itself. There is minuscule risk of Swift not gaining widespread
adoption amongst iOS and OS X developers.

------
ynniv
Apple once told us that the best way to write applications for the iPhone was
using web pages. Caveat emptor.

~~~
masters3d
if swift exited then this would have been great. By this time swift would have
replaced javascript. Think of the way apple killed flash video. They could
have killed javascript.

------
Geekette
Good reminder of how new Swift is, given that I've recently seen a couple of
LinkedIn profiles already declaring their owners as Swift experts, despite the
language being released only ~1.5 months ago.

~~~
Zaheer
lol Reminded me of a joke when it first came out: Recruiters will be on the
prowl for Swift devs with 5+ years of experience!

~~~
Geekette
Oh, I'm sure a few corresponding job ads can be found floating around too,
including on LinkedIn.

~~~
jfoster
I wonder if such ads could be being used as a honey-pot. Useful for
determining who not to hire. (and possibly not in compliance with employment
laws at the same time, if no job exists)

~~~
danielweber
If there is anything the software developer industry doesn't need, it's more
tests to automatically reject people.

------
markcrazyhorse
Here is a good resource to learn: [http://ios-blog.co.uk/swift-
tutorials/](http://ios-blog.co.uk/swift-tutorials/)

------
legulere
A counterpoint: Swift is actually quite conservative and only uses features
that have been proven useful in other programming languages before.

------
ninjakeyboard
Looks like scala to me - not so half baked.

------
gomesnayagam
it is premature baby

------
msoad
I'm learning Objective-C and want to learn Swift when it become 1.0. I don't
care how small share of Apple from software cake will be, I love working with
this highly polished platform.

------
Aardwolf
"I Don't Know Swift"

So? Neither do I, and since it's a language for one specific platform, chances
I will are not that high.

What's the big deal with it, that there are so many articles about it?

