News for hackers. Stuff that matters.
Re:Swift 5.3 Will Be Supported on Windows and Additional Lin... by AsyncAwait on Saturday May 16, 2020 @06:51AM (#23202365)
Swift is also a much nicer language than C# in my opinion.
Re:Swift 5.3 Will Be Supported on Windows and Additional Lin... by hu3 on Saturday May 16, 2020 @07:12AM (#23202470)
I'd argue the other way around.

Not to mention that developing C# in Visual Studio or Rider feels years ahead of what's considered good enough IDE assistance in other languages. Comparable with Java even.

Re:Swift 5.3 Will Be Supported on Windows and Additional Lin... by AsyncAwait on Saturday May 16, 2020 @07:53AM (#23202676)
In some ways, Swift is a higher-level Rust. It places a lot more emphasis on functional programming, null safety, value types and immutability than C# does.

The more flexible memory management model added recently, native binaries, (as the default option) and even identifier: Type over type identifier is also a nice plus for me, I agree that the IDE situation is heavily in C#'s favor.

If C# is a nicer Java and Kotlin is a nicer C#, then Swift is a nicer Kotlin.

What would you argue C# has going for it over Swift?

Re:Swift 5.3 Will Be Supported on Windows and Additional Lin... by The_rationalist on Saturday May 16, 2020 @07:36PM (#23208114)
null safety modern C# has optional chaining, Elvis operator and non nullable types value types C# has value types contrary to Java (until project Panama)

What would you argue C# has going for it over Swift? feature wise I don't know but it clearly has a far bigger lib ecosystem which is the most important criterion

Re:Swift 5.3 Will Be Supported on Windows and Additional Lin... by AsyncAwait on Sunday May 17, 2020 @05:28AM (#23210802)
Yes, some of these have been slowly added, similar with Java slowly moving to embrace features from Scala and Kotlin, but to me it doesn't feel as nice, rather sort of baked on and many of the libraries don't use these latest features.

Swift was designed to seamlessly blend functional and OO styles from the get go.

Fundamentally, there's still classes and inheritance everywhere in C#, which is also what I hated about Cocoa and using it from Swift before they came out with SwiftUI.

Now don't get me wrong, I am not saying C# is a bad language, just that when you compare it with Swift, Kotlin, Rust etc, it's clearly playing catchup.

> far bigger lib ecosystem which is the most important criterion

Going by that metric, you could argue there's no point to C#, because Java likely still wins handsomely on that front and maybe Java should just give it up to JavaScript anyway.

Clearly we don't just evaluate languages solely by the size of their ecosystem. There's a critical mass that needs to be achieved, but at some point there's 2-3 libs for everything you may want to do and simly having 5 more is not magically better, the same way having "millions of apps" on the App Store doesn't mean much if most of them are not that great and people stick to just a few.

As an example, the GUI situation on Windows clearly offers more choice for C# devs as to how they want to go about their GUI, but I'd argue the Windows GUI situation is a bit of a hot mess right now and SwiftUI seems like a breath of fresh air compared to that.

Re:Swift 5.3 Will Be Supported on Windows and Additional Lin... by merb on Sunday May 17, 2020 @05:58PM (#23215878)
> Now don't get me wrong, I am not saying C# is a bad language, just that when you compare it with Swift, Kotlin, Rust etc, it's clearly playing catchup.

btw. it's the other way round. most modern stuff was in c# while the others played catchup and some still do. no language has async/await implemented as good as c# has, no language has nullable value types as good as c# no languages has a reflection api that is really easy to use and if that isn't enough there are also expressions which are more like macros and due to the way how generics are implemented no internal api sucks. btw. c# even has channels.

swift has nothing over c# and all features swift has were more likely be in c# before they were in swift.

Re:Swift 5.3 Will Be Supported on Windows and Additional Lin... by The_rationalist on Monday May 18, 2020 @12:34PM (#23224659)
no language has nullable value types as good as c# What's different from kotlin or typescript nullable value types + smartcasts?
Re:Swift 5.3 Will Be Supported on Windows and Additional Lin... by fomine3 on Sunday May 17, 2020 @08:35PM (#23216940)
I like C# for balancing both implement new features (in easier way IMO) and keep compatibility.
Re:Swift 5.3 Will Be Supported on Windows and Additional Lin... by The_rationalist on Saturday May 16, 2020 @07:03AM (#23202416)
Could you argue why?
Re:Swift 5.3 Will Be Supported on Windows and Additional Lin... by AsyncAwait on Saturday May 16, 2020 @07:49AM (#23202652)
A lot more emphasis on functional programming & nicer syntax around it, preference of value types over reference types and immutability by default/opt in mutability, nicer parsing with Codable, nice pattern matching and destructuring syntax, native binaries by default, more flexible memory management.
Re:Swift 5.3 Will Be Supported on Windows and Additional Lin... by The_rationalist on Saturday May 16, 2020 @07:40PM (#23208134)
Modern C# has both destructuring and pattern matching in switchs. The memory model of swift seems obscolete, reference counting does not catch reference cycles and swift isn't faster than C#

C# isn't really missing features vs swift but it might have a less modern syntax

Re:Swift 5.3 Will Be Supported on Windows and Additional Lin... by AsyncAwait on Sunday May 17, 2020 @05:31AM (#23210811)
In regards to the memory model, I am not talking about reference counting, but rather [1].

1 - https://swift.org/blog/swift-5-exclusivity