|
|
|
|
|
by The_Colonel
2226 days ago
|
|
It has the benefit of 15 years more hindsight. As an example, during this time the development community figured out that using immutability as the default brings benefits. Kotlin is designed with this in mind, but C# isn't - e.g. C# has this cool feature for object initialization which is so handy and all developers use it. Except for - it doesn't work with immutable classes (the ones with readonly fields). As an effect developers dislike to use immutable classes since it's not ergonomic in C# and instead use standard POCO. Another example is that C# still in this age does not support readonly parameters and local variables (which even Java and JavaScript (!) support). In Kotlin "readonly" local variables is the idiomatic code practice which doesn't make code any more verbose. And in the case they decide to add it to C#, it will have to be at the cost of verbosity (similarly to how Java does it) because of backwards compatibility. |
|
Well good thing they're adding that in C# 9 then