Basic comparison of C# and Apple Swift programming language syntax
-
There are a lot of developers that use C# every day and the purpose of this post is to help them understand what Swift offers at a language level compared to C#. And, before you start the "apples and oranges" arguments, it's worth pointing out that using Xamarin you can develop iOS and OSX apps using C#.
"Let's flip the track, bring the old school back. This is how we do it."
-
There are a lot of developers that use C# every day and the purpose of this post is to help them understand what Swift offers at a language level compared to C#. And, before you start the "apples and oranges" arguments, it's worth pointing out that using Xamarin you can develop iOS and OSX apps using C#.
"Let's flip the track, bring the old school back. This is how we do it."
Maybe he's not very familiar with C#: " Switch statements are rather similar in both languages except that in Swift case statements don't automatically pass on to the next like in C#. As a result C# requires the use of the break keywords to exit the Switch statement, unless you want to fall through to the next case. While in Swift you must use the "fallthrough" keyword to tell it to pass on through to the next case statement. More information on this can be found in the Swift documentation. " It sounds like he means "C" when he says "C#", but I do wish C and C# behaved the way he describes Swift does. Swift appears to have some features I'd like, but I doubt I'll ever be using Swift.
You'll never get very far if all you do is follow instructions.
-
Maybe he's not very familiar with C#: " Switch statements are rather similar in both languages except that in Swift case statements don't automatically pass on to the next like in C#. As a result C# requires the use of the break keywords to exit the Switch statement, unless you want to fall through to the next case. While in Swift you must use the "fallthrough" keyword to tell it to pass on through to the next case statement. More information on this can be found in the Swift documentation. " It sounds like he means "C" when he says "C#", but I do wish C and C# behaved the way he describes Swift does. Swift appears to have some features I'd like, but I doubt I'll ever be using Swift.
You'll never get very far if all you do is follow instructions.
-
He must have been thinking of C#'s special treatment of the empty case body, which does fall through.
Oh my... You seem to be correct. " The scope of each case can’t be empty. As a result, you must include at least one statement following the colon (:) of each case label. " That's horrible. :wtf:
You'll never get very far if all you do is follow instructions.
-
There are a lot of developers that use C# every day and the purpose of this post is to help them understand what Swift offers at a language level compared to C#. And, before you start the "apples and oranges" arguments, it's worth pointing out that using Xamarin you can develop iOS and OSX apps using C#.
"Let's flip the track, bring the old school back. This is how we do it."
-
There are a lot of developers that use C# every day and the purpose of this post is to help them understand what Swift offers at a language level compared to C#. And, before you start the "apples and oranges" arguments, it's worth pointing out that using Xamarin you can develop iOS and OSX apps using C#.
"Let's flip the track, bring the old school back. This is how we do it."
Quote:
Both languages support the use of Unicode characters as variable names. Basically, you could use Emoticons or other non-ASCII characters as variable names if you want, but who does that anyway?
Offshore teams trying to make it impossible for you to bring development back in house by using symbol names not just in a language you don't understand but in a character set your keyboard can't even type?
Did you ever see history portrayed as an old man with a wise brow and pulseless heart, waging all things in the balance of reason? Is not rather the genius of history like an eternal, imploring maiden, full of fire, with a burning heart and flaming soul, humanly warm and humanly beautiful? --Zachris Topelius Training a telescope on one’s own belly button will only reveal lint. You like that? You go right on staring at it. I prefer looking at galaxies. -- Sarah Hoyt
-
He's not really comparing it with C# is he? He's comparing Swift with the parts of C# which are common to all C based languages, no mention of LINQ, Generics, ORM etc etc and their equivalents in Swift
From the looks of things, this is part 1 of n, so just pure syntax for now.
TTFN - Kent