Help for a nooby

I just bought a book to learn objective-c, but now swift has come out. Does anyone know if Apple's guide starts from the bottom or requires knowledge of objective-c? If so, should I start with swift or learn objective-c anyways?

Posted Jun 3, 2014, 7:50 AM UTC

310
obsessedollie•

The Apple guide is actually pretty nice to read, but does require some basic understanding of programming. If you have any familiarity with Python/Ruby you should be able to get by. If you are a complete beginner it might not be such an easy task. However if you are serious about it, there's nothing wrong with reading the documentation and the initial playground is quite nice.

I would carry on with Objective C if you've started, so you get to know the Cocoa frameworks well, then when you switch to Swift it feel seem a bunch easier.

2
jadengore•

As someone who agonized for an hour trying to figure out how to reverse a string in Swift, I would wait for better docs. The docs are incredibly sparse. String doesn't even have mention of how to get an index of a character at the moment. That's just one example too.

I'm sure the docs will improve in the coming weeks, and since Obj-C things will work with Swift, it can't hurt.

1
OpiumDreamer•
let forwards = "Some string to reverse";
var reversed = "";
for character in forwards { reversed = character + reversed; }

An hour? Really?

1
jadengore•

Did you test that? I thought I tried that and it wasn't working for me (could also be the playground trolling me).

I feel like there must be a better way. Most of the hour was spent trying to just figure out an "index of" equivalent, which I have yet to find in the docs. String functions are very sparse in the docs, and I stand by that.

1
OpiumDreamer•

No, I haven't downloaded the stuff and I don't guess I'll get to it too soon. I did read about 90% of the book though.

FWIW, all of NSString's protocol should be available.

1
walkietokyo•

One thing to consider when getting started with a language is the level of documentation and support that's available out there. Since Swift was released yesterday, the only currently available information is whatever Apple is giving us.

Objective-C on the other hand has plenty of documentation and also thousands of experienced users that's published books and tutorials etc. There is also a wealth of resources and experience on sites such as StackOverflow.

I'm sure Swift will get a lot of information soon enough, but if you're just starting out you may want to consider holding off Swift until there's a larger community surrounding it.

2
jadengore•

TRUE STORY. Docs are weak ATM.

2
c0x91•

Apple says: Swift is friendly to new programmers. It is the first industrial-quality systems programming language that is as expressive and enjoyable as a scripting language.

1
MadMerkan•

It's almost as if someone at Apple read the book Functional Programming Patterns in Scala and Clojure: Write Lean Programs for the JVM and adapted the ideas for use with LLVM...

1