Mac The Swift unveiling

mazz0

macrumors 68000
Original poster
Mar 23, 2011
1,826
1,041
Leeds, UK
Anyone else notice the slight pause followed by the complete lack of excitement following the "we wondered what Objective C would be like without the baggage of C" line?

I know what I was thinking, and I assume a lot of other people: "the problem with Objective C isn't the C parts!"

Now however, what I've seen of Swift looks beautiful!

What do people think?
 

int3

macrumors member
May 19, 2014
38
0
Portugal
Looks like visual studio developed 15 years ago. :p
I think apple should go with this. Make a soft language to compete with microsoft.
 

mazz0

macrumors 68000
Original poster
Mar 23, 2011
1,826
1,041
Leeds, UK
Sorry int3, I have no idea what you mean. Visual Studio isn't a programming language. Also, what's a "soft" programming language? What do you mean by "I think apple should go with this. Make a soft language to compete with microsoft." - could you rephrase that as I don't understand you?
 

grandM

macrumors 65816
Oct 14, 2013
1,100
57
Sorry int3, I have no idea what you mean. Visual Studio isn't a programming language. Also, what's a "soft" programming language? What do you mean by "I think apple should go with this. Make a soft language to compete with microsoft." - could you rephrase that as I don't understand you?
it also made me think of visual basic more than a decade ago
 

mazz0

macrumors 68000
Original poster
Mar 23, 2011
1,826
1,041
Leeds, UK
it also made me think of visual basic more than a decade ago
What did? I was commenting on the language, not the IDE. I'm confused.

----------

I'm not very familiar with Visual Studio by the way, before Xcode I mostly programmed in Java.
 

grandM

macrumors 65816
Oct 14, 2013
1,100
57
What did? I was commenting on the language, not the IDE. I'm confused.

----------

I'm not very familiar with Visual Studio by the way, before Xcode I mostly programmed in Java.
"Visual Basic is a third-generation event-driven programming language and integrated development environment (IDE) from Microsoft for its COM programming model first released in 1991"
The term was used for the language too
You didn't have to say which type a variable was and so on (was recommended though)
 

ArtOfWarfare

macrumors G3
Nov 26, 2007
8,661
4,200
What did? I was commenting on the language, not the IDE. I'm confused.
I've never bothered learning Microsoft's technologies because they don't seem to have any advantage over Java, but my understanding is that Visual Basic is a language while Visual Studio is an IDE.

Perhaps I'm mistaken.

Regarding my reaction:

The problems with Obj-C is the language feels like it was taped onto C. A lot of irritating problems and syntax in Obj-C had to do with how closely it was related to C. IE, why were literals always prefixed with an @? Because literals were already defined in C without the @. Why did ever object have a *? Because it was implemented as a C pointer.

So far, my reaction to Swift (I'm 182 pages into the 860 page guide) is that it's certainly an improvement over Obj-C, but I think I still prefer Python.
 

grandM

macrumors 65816
Oct 14, 2013
1,100
57
I've never bothered learning Microsoft's technologies because they don't seem to have any advantage over Java, but my understanding is that Visual Basic is a language while Visual Studio is an IDE.

Perhaps I'm mistaken.

Regarding my reaction:

The problems with Obj-C is the language feels like it was taped onto C. A lot of irritating problems and syntax in Obj-C had to do with how closely it was related to C. IE, why were literals always prefixed with an @? Because literals were already defined in C without the @. Why did ever object have a *? Because it was implemented as a C pointer.

So far, my reaction to Swift (I'm 182 pages into the 860 page guide) is that it's certainly an improvement over Obj-C, but I think I still prefer Python.
- Indeed: visual basic = language/ visual studio = ide
- I remember when I started the Kochan book a while ago thinking to myself "luckily I learned C at university" or I wouldn't get this. And you could even use & to pass by reference. So you are definitely right. Objective-c was quite a hurdle for me to cope with. Shame swift didn't come sooner. Because now employers will demand newbies to know both.
 

int3

macrumors member
May 19, 2014
38
0
Portugal
Everyone got it wrong. LOL
First I main C#. I'm a programmer. I know Visual Studio is an IDE ...
What I meant is that a "soft" (easy to read and code) would be nice on os x. C# is a simple language for me, I would like to see a simple and powerful language with awesome framework on mac to make easy and fast and useful apps.
For mac I use C++ with Qt. And for windows I use C#.

----------

Sorry int3, I have no idea what you mean. Visual Studio isn't a programming language. Also, what's a "soft" programming language? What do you mean by "I think apple should go with this. Make a soft language to compete with microsoft." - could you rephrase that as I don't understand you?
forgot to quote.
 

sfwalter

macrumors 68000
Jan 6, 2004
1,847
923
Dallas Texas
Does this mean that I can write an entire iOS application exclusively in Swift and there's no need to write one line of Objective C code?
 

mrxak

macrumors 68000
Anyone else notice the slight pause followed by the complete lack of excitement following the "we wondered what Objective C would be like without the baggage of C" line?

I know what I was thinking, and I assume a lot of other people: "the problem with Objective C isn't the C parts!"

Now however, what I've seen of Swift looks beautiful!

What do people think?
Don't get me wrong, I love C and all its off-shoots that I've tried. I, too, hesitated a bit when I heard that line during the keynote. But it actually does make sense to start fresh. There is certainly C baggage in Objective-C that makes certain parts of Objective-C kind of a pain.

I've only just begun to look around at a few code examples in Swift and I'll reserve judgement until I hear from certain tech sites that will no doubt delve much deeper into the documentation than I'm prepared to do right now. Still, I'm excited. It's not every day that a big company like Apple comes out with a new flagship programming language. I'm sure some big developers are nervous, and some people with half-finished projects are kicking themselves, but to me this says Apple has its sights set on the future.

I wish they had spent more than 10 minutes on it at the end of the keynote, though I'm sure there's a lot of stuff going on in the WWDC sessions on Swift. I'll start reading through the eBook and some of the pages on the Apple dev site. All our questions will be answered, I'm sure, in time. Right now, though, I'm just excited.
 

dtlee1974

macrumors regular
Apr 2, 2010
129
31
I've never bothered learning Microsoft's technologies because they don't seem to have any advantage over Java, but my understanding is that Visual Basic is a language while Visual Studio is an IDE.

Perhaps I'm mistaken.

Regarding my reaction:

The problems with Obj-C is the language feels like it was taped onto C. A lot of irritating problems and syntax in Obj-C had to do with how closely it was related to C. IE, why were literals always prefixed with an @? Because literals were already defined in C without the @. Why did ever object have a *? Because it was implemented as a C pointer.

So far, my reaction to Swift (I'm 182 pages into the 860 page guide) is that it's certainly an improvement over Obj-C, but I think I still prefer Python.
I prefer Python myself. But, Swift is one hell of a lot more Pythonic than Obj-C. My boss asked me what Swift looked like and I told him, "Python with braces." It might not be that similar, but I think I can learn to like the syntax.
 

Madd the Sane

macrumors 6502a
Nov 8, 2010
508
40
Utah
Does this mean that I can write an entire iOS application exclusively in Swift and there's no need to write one line of Objective C code?
Short answer: yes.

Longer answer: yes, but you will still have to use the CocoaTouch Frameworks.

I did wonder why Apple implemented Modules in Objective C. "Wouldn't a precompiled header do the same thing?" I thought. It didn't prevent me from using modules, though. Although there are a few projects that do have variable names clashing with system headers.

One thing that I will find annoying is the fact that Objective C classes can't be subclasses of Swift classes, but vice versa is fine. This is probably due to technical limitations, though.
 
Last edited:

crewkid89

macrumors regular
Jun 16, 2011
242
23
United States
I got super excited when I saw swift and have already started to read the iBook docs. As an educational technology specialist, I more dabble in programming than anything else. Objective-C was always too steep of a learning curve for me to get over with everything else on my plate. I am excited for swift as it reminds me of Python and Livecode so far.

I am now wondering if GUI programs are within my grasp in Xcode. What will it be like learning Cocoa with Swift?
 

Madd the Sane

macrumors 6502a
Nov 8, 2010
508
40
Utah
I am now wondering if GUI programs are within my grasp in Xcode. What will it be like learning Cocoa with Swift?
There will be some parts of the implementation that will be similar to other Cocoa apps, such as setting a delegate for the application class (that is a subclass of NSObject, if I've read the docs right), @IBActions and @IBOutlets for UI interaction with the code, and other things that I haven't thought of or run across yet.

Although it seems that Swift automatically makes Cocoa initializers more Swift-like.

Edit: I wouldn't be surprised if Apple released documentation on writing a Cocoa app in Swift in the future.
 
Last edited:

crewkid89

macrumors regular
Jun 16, 2011
242
23
United States
There will be some parts of the implementation that will be similar to other Cocoa apps, such as setting a delegate for the application class (that is a subclass of NSObject, if I've read the docs right), @IBActions and @IBOutlets for UI interaction with the code, and other things that I haven't thought of or run across yet.

Although it seems that Swift automatically makes Cocoa initializers more Swift-like.

Edit: I wouldn't be surprised if Apple released documentation on writing a Cocoa app in Swift in the future.

I hope so. I have no experience creating a project or designing a GUI in Xcode so some tutorials would be helpful.
 

GhostRaider

macrumors 6502
Jun 2, 2014
322
270
Hopefully there are authors out there that are gonna work on making a book about the Swift language for beginners. Would have been nice if Apple themselves made a beginner's guide to Swift since they're the ones that made it. Probably it will take about a year to publish something like this.
 

AdonisSMU

macrumors 604
Oct 23, 2010
6,601
2,170
Hopefully there are authors out there that are gonna work on making a book about the Swift language for beginners. Would have been nice if Apple themselves made a beginner's guide to Swift since they're the ones that made it. Probably it will take about a year to publish something like this.
They have a book in the ibooks store already.
 

Madd the Sane

macrumors 6502a
Nov 8, 2010
508
40
Utah
The book is very much a low-level book on the mechanics and syntax of the language, and less on building an application. A book authored by, say, The Big Nerd Ranch would be more suited for the beginner and the novice, as opposed to someone who has studied/does study modern computer languages.
 

1458279

Suspended
May 1, 2010
1,601
1,521
California
If BNR is going to do a book, which I would expect, we should see it in about 8 months or more.

They just released the current one a few months ago. It'll be interesting to see what this does to the app store and all the app developers. They (Apple) mention they wanted Swift apps, so they could favor them over ObjC apps. Either way, this is a big change.

Complete surprise! I have to say I've never been big on ObjC, always found it awkward. The changes are coming fast, wasn't long ago they were bragging about how popular ObjC had become, now it looks like it'll be dumped.

There's a lot of programmers that'll have to learn yet another language :D

I've seen this happen before and the long-term outcome was excellent, but some pain involved.
 

the8thark

macrumors 601
Apr 18, 2011
4,003
877
I wish they had spent more than 10 minutes on it at the end of the keynote,
I am sure the entire "State of the Union" keynote will the choc full of Swift talk. When it's up online to watch I'll be watching it ASAP.

I am actually surprised MR didn't write an article up for swift. MR covered almost everything else from the Keynote. I think Swift and iOS Appstore betas were the two wow moments for me. I didn't expect them. And both of them are making me think Apple is working on the successor to OS X.
 

whooleytoo

macrumors 604
Aug 2, 2002
6,569
641
Cork, Ireland.
From what I've read so far, I like that switch statements can include non-constants, and even ranges! Functions returning tuples are very handy too. The for loop syntax is nice and simple.

I do like the fact that you can just write a one-line programme. That's handy for doing quick code-snippet tests.

I haven't read much yet that's amazingly new, but it does seem to import many of the best features of other languages.
 

960design

macrumors 68030
Apr 17, 2012
2,966
924
Destin, FL
I like Swift so far, but I'm easily amused by shiny red objects, Ferrari's in particular. I'll have to get to the end of the Swift book and write a couple of apps before I can actually comment on it. So far I like the 'script-style' coding.

Running Yosemite and XCode 6Beta and playing with playgrounds. Pretty sweet.
 

Similar threads

Register on MacRumors! This sidebar will go away, and you'll see fewer ads.