Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Alenore

macrumors 6502
Apr 7, 2013
423
426
Plus, C (and by association supersets of C like C++ and ObjC) now have a terrible reputation for security. Swift is playing the security card hard.
Huh ? C or C++ or Obj-C are just tools to build things. Swift isn't any more secure than C if the developer using it has no idea of what to do security-wise.
 

rnodern

macrumors member
Nov 29, 2014
34
9
Manila, Philippines
I work in a major corporation +40,000 employees globally. We had an organisation wide application building competition where members had to create a team & come up with an app idea, with the end result being building the app and pitching it to the board of directors.
Anyhow, we picked up enough Swift and Xcode knowledge in less than a week to build the app and win the contest. Our only existing, limited technical experience was SQL and server-side scripting for web. With a liberal sprinkling of Illustrator Ninja-ry.

Anyhow, the concepts we learned in that brief period would be sufficient to realistically tackle anything. Which we are now doing! I really like Swift. At the very least, it's a quick and easy way to learn how to build apps for iOS and a great approach for a novice developer.
 

gnasher729

Suspended
Nov 25, 2005
17,980
5,565
Huh ? C or C++ or Obj-C are just tools to build things. Swift isn't any more secure than C if the developer using it has no idea of what to do security-wise.

No buffer overflows. No integer overflows. No uninitialised variables. No problems with NULL pointers.

Swift removes huge classes of security problems from programming. Do anything wrong, your program will crash (which is the secure thing to do).
 

theluggage

macrumors 604
Jul 29, 2011
7,507
7,394
Huh ? C or C++ or Obj-C are just tools to build things. Swift isn't any more secure than C if the developer using it has no idea of what to do security-wise.

Well, to pick an example at random, the native string and array types in C are just a bit of syntactic sugar around raw pointer arithmetic, and its entirely up to the programmer to check that the strings don't overrun their bufffer, or that copying a string doesn't copy other data (which, in a nutshell, was what happened with the infamous Heartbleed bug last year). Yes, there are 'modern' function and object libraries that handle stings and arrays more safely, but you have to choose to use them in place of the native C routines.

Swift native strings and arrays all use such "modern" libraries.

Also, C++'s templates and multiple inheritance features are complete and utter tarpits that lure the unwitting programmer into over-complex and opaque code. Most modern OO languages just focus on the primary use cases for templates (generic types) and multiple inheritance (interfaces/protocols) and keep things much cleaner and simpler.

Pity Swift has included operator overloading. Yeuch!
 

The Werewolf

macrumors newbie
Jan 18, 2015
7
5
Swift is one of those things that makes Apple great.. and most of us don't even realize it. Swift has increased my development performance and quality. It's actually really amazing!

So.. what happens when Mac developers realise that Swift - which *is* an excellent language... is basically Microsoft's decade old C# with a more Pascal-like syntax?

I used to be a Mac developer and jumped to Windows when I saw what a mess Objective C was - and how awesome .Net and the associated languages are. Now that Apple has a truly modern language for development, I'm actually interested in developing for MacOS and iOS again.

Now.. someone port Swift to Windows and Android for platform compatibility (and add the concept of assemblies, which Swift kind of has but is cripped) and you'll really enjoy this.
 

OneMike

macrumors 603
Oct 19, 2005
5,814
1,795
this is not really surprising to me that it's gaining ground. Interesting, I guess. I'd be more interested to see how this plays out over a longer amount of time.
 

LordQ

Suspended
Sep 22, 2012
3,582
5,653
What could be the benefits if iOS 9 is completely rewritten with Swift?
 

poorcody

macrumors 65816
Jul 23, 2013
1,312
1,522
So.. what happens when Mac developers realise that Swift - which *is* an excellent language... is basically Microsoft's decade old C# with a more Pascal-like syntax?

I used to be a Mac developer and jumped to Windows when I saw what a mess Objective C was - and how awesome .Net and the associated languages are. Now that Apple has a truly modern language for development, I'm actually interested in developing for MacOS and iOS again.

That's funny because I am following your same path. C#/.Net was really a great development environment. If you want to develop a Windows desktop app today, though, you are really left scratching your head as to what tools Microsoft even expects you to use (very immature WinRT, or the almost-forgotten WPF -- and we won't even mention Silverlight).

Swift is starting to have me looking at Mac development again, from the prospective of having a great and clean language and API set.
 

gnasher729

Suspended
Nov 25, 2005
17,980
5,565
What could be the benefits if iOS 9 is completely rewritten with Swift?

None. It would destroy the compatibility with MacOS X (both share >85% of their code), and any rewrite introduces lots of bugs that would have to be fixed. At the same time, no new functionality would be gained.

You don't rewrite code just for fun.
 

LordQ

Suspended
Sep 22, 2012
3,582
5,653
None. It would destroy the compatibility with MacOS X (both share >85% of their code), and any rewrite introduces lots of bugs that would have to be fixed. At the same time, no new functionality would be gained.

You don't rewrite code just for fun.

Oh, I see. Thank you for the insight!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.