News for hackers. Stuff that matters.
Re:Is It Time for Swift? by pmalynin on Sunday January 31, 2016 @01:27AM (#11005485)
What bother me the most about Swift, is it essentially a C# clone, actually worse, because C# has more features. It is a travesty that Apple chose to design yet another shit language when there are so many other alternatives. And now, like with Go, everybody is jumping on the band wagon because its Apple.

Sigh.

Re:Is It Time for Swift? by millstone on Sunday January 31, 2016 @04:14AM (#11005816)
Swift borrows some ideas from C#, along with Kotlin, ObjC, and others. It's also radically different from C#:

1. Swift collections and strings are value types, but in C# they are reference types

2. Swift strings are mutable, C# strings are not

3. C# by default allows reference types to be nil, Swift does not

4. Swift performs overflow checking by default, C# does not

5. Swift is reference counted, C# is GCed

6. Swift's inouts are very different from C#'s ref. For example, Swift's inouts support properties

7. Swift's error handling is quite different from C#'s exceptions, both in syntax and implementation

8. Swift's enums act as algebraic data types, C# has nothing like this

9. Swift's switch statements are much more flexible than C#, because of where clauses

and more.

These are some radical departures! The differences between Swift and C# are much greater than the differences between C# and Java.

Re:Is It Time for Swift? by peterashford on Sunday January 31, 2016 @09:38PM (#11009332)
That sounds really trivial to me. You've described less difference between Swift and C# than exists between C# and Java and those latter languages are commonly thought to bew very similar.
Re:Is It Time for Swift? by apetrovic on Sunday January 31, 2016 @03:40AM (#11005754)
I've working in C# for eight years before switching to iOS. To me, Swift and C# similarity ends with use of curly braces.

C# is, in essence, better Java. Much, much better Java. Swift is a different language, it implements some new ideas (much more advanced type inference) and forces the programmer to thinks in a different way (by trying to eliminate nullability).

Swift is not a perfect language (my biggest gripe is very awkward generics implementation), but it is a good language, and it's getting better. Saying that it's "a shit language currently on the spot just because Apple" isn't fair, I think.

Re:Is It Time for Swift? by pcwalton on Sunday January 31, 2016 @02:05AM (#11005576)
While I agree that Swift and C# share a lot of commonalities and are fairly similar languages, the better integration of Objective-C alone makes the new language worth it.

I don't know anyone in PL who thinks Swift is a bad language. It's a nice, conservative, tasteful design that uplifts some proven functional features. What's not to like?

Re:Is It Time for Swift? by fishnchips on Sunday January 31, 2016 @04:22AM (#11005826)
I don't think it is a bad language but I think it sometimes introduces unnecessary complexity: custom getters and setters on properties, will-set/did-set blocks and operator overriding (including precedence and associativity). Also, coming from a background where pointers are an obvious thing I do not understand why classes and structs need to be separate data types. None of these things is a bad per se but I do think they make the learning curve steeper and invite some level of abuse. Reminds me a lot of C++.
Re:Is It Time for Swift? by austinz on Sunday January 31, 2016 @03:57AM (#11005795)
I love C# and think it's a great language, but when it was as old as Swift is now it was widely perceived as a Java clone. In fact, even today C# and Java are much closer in language design philosophy and implementation than C# and Swift, and calling Swift a "C# clone" betrays a profound lack of familiarity with what Swift is or how it works.
Re:Is It Time for Swift? by flamethroeaway on Sunday January 31, 2016 @04:39AM (#11005853)
And C# is a Java clone which is a C++ clone which is a C clone. Who cares if languages take other languages as inspiration? Would you prefer a Disney-like situation where innovation is stifled because that is no longer possible?
Re:Is It Time for Swift? by akhilcacharya on Sunday January 31, 2016 @01:45AM (#11005527)
C# clone? In what way?
Re:Is It Time for Swift? by pmalynin on Sunday January 31, 2016 @02:11AM (#11005596)
Re:Is It Time for Swift? by andybak on Sunday January 31, 2016 @06:09AM (#11006026)
That page reads like someone who doesn't know much about other languages cherry-picking and making dubious connections. A fair chunk of the Swift examples listed strike me as radically different to the C#
Re:Is It Time for Swift? by meddlepal on Sunday January 31, 2016 @02:03AM (#11005569)
C# clone? It's far more like a Kotlin clone without the JVM.