5 ms·
A mess in what way?
by jasonboyd 8y ago
A mess in what way?
- ramenmeal 8y agoSo many features have been added over time, I think it's beginning to show that the features are piled on top of a language that weren't designed for them. Things that I think feel awkward are the tuples handling, switch case pattern matching. As a go developer, when I see the Func, Action, Expression, and Predicate objects... oof I shudder. When you layer function overloading on top of those, you can get in a mess. Obviously it's an unpopular opinion, but I would like to see what c# would look like if it was designed from scratch again.
- maxxxxx 8y agoTo some degree I agree but I am pretty impressed how much they have been able to add while still keeping C# a pretty clean language. I am sure most language designers dream about starting from scratch....
- moron4hire 8y agoQuite the contrary, as someone who has been doing C# since it was invented, I find all of the new features to be implemented in a very coherent, even respectful way. It can seem like things are arbitrarily tacked on, but once you start using the features in earnest, it becomes quite clear that they are very well designed, very well thought out. I have much, much respect for the C# language committee. They've done amazing work in adding features and keeping the language clean and forwards compatible!
- oaiey 8y agoWell said. I am also on that journey and compared to C++ the complexity is still very low and readability very high. I think the only C# feature I have not cracked yet is co/contravariance. And that is more due to the fact, that you rarely need to declare it.
- mattnewport 8y agoI generally like the new features of C# but I still find C++ to be a much more coherently designed language. C# can't escape its poisoned roots in Java despite its best efforts.
- mattnewport 8y agoI tend to think F# is what C# would look like if designed from scratch these days. My take is that C# started out not very good because it copied a not very good language (Java) but they improved on Java a bit and have continued to add things that tend to improve the language within the constraints of remaining backward compatible. Choosing just on the language I wouldn't choose C# but when working in an ecosystem built around C# (like Unity for me currently) I appreciate many of the features as making things a bit nicer.
- oaiey 8y agoI disagree. First of all, F# is functional and therefore has another design. C# also intentional followed C style languages to pick up developers. C# was built for the masses while functional programming is for the elites (F# is has 10k devs using it, VB.NET has 100k and C# more than a million active users). I agree that there are some syntax they would have designed differently when they would have understand the functional programming influence they have today a bit earlier. When they would design it today from scratch, I think they would look at JavaScript.
- mattnewport 8y agoC# comes from a statically typed language tradition (the dynamic keyword aside) and has very little in common with Javascript beyond the surface level of curly braces. The trend in C# features seems very much influenced by functional programming, adapted to be more familiar and palatable to non functional programmers. Some features of C# that seem influenced by functional programming in general or F# in particular include lambdas, type inference, Enumerable (F# pipelines), pattern matching, tuples, null coalescing (a Maybe if you squint), expression bodied members, record types and Range expressions. There is also what looks like an 'aesthetic' influence of F# in language features that reduce ceremony and make for more concise code like auto properties as well as a functional inspired recommended practice of making immutable types.
- oaiey 8y agoFair assessment and I agree. My comment regards JavaScript was more about to pick up existing developers. C# was always meant for productivity. A rapid learning curve (as opposed to learning functional programming first) is very important here.
- rjf72 8y agoOut of curiosity, what do you find poorly designed about them? In my opinion many of these things are elegant to the point of self documentation. Switch case pattern matching in particular is just great: void foo() { object pi = 3.14d; switch (pi) { case int i: Console.WriteLine("pi is an int of value " + i); break; case float f: Console.WriteLine("pi is a float of value " + f); break; case double d: Console.WriteLine("pi is a double of value " + d); break; default: Console.WriteLine("pi is of an unknown type."); break; } } Elegance is of course in the eye of the beholder, so what would you propose as an improvement to something like this?
- vermorel 8y agoWell, C# 8 will be having something much nicer syntax actually: void foo() { object pi = 3.14d; Console.WriteLine(pi switch { int i => "pi is an int of value " + i, float f => "pi is a float of value " + f, double d => "pi is a double of value " + d, _ => "pi is of an unknown type."; }); } Check-out https://neelbhatt.com/2018/05/19/c-8-0-expected-features-part-iii-switch-statments/ https://neelbhatt.com/2018/05/19/c-8-0-expected-features-par... Cheers!
- pjmlp 8y agoLike any product or human languages, programming languages either evolve to make it easier to deal with the complexity of the problems their users need to tackle, or they fade away. Every programming language that advertises itself as simple, it isn't any longer simple if it actually is adopted by the market at large. Go is the newest example, already with a few quirks, needed to revamp their dependecy story, the team finally cave in to look into better solutions for error handling and generic programming.
- hombre_fatal 8y ago> Go is the newest example, already with a few quirks Here's a fun game for people who use Go: why does this error? https://play.golang.org/p/6LTbtuocu5- https://play.golang.org/p/6LTbtuocu5-