24 ms·
C# 7 Work List of Features
- orf 11y agoImproved tuple support would be awesome, it's something I often miss when working with C# and coming from a Python background (that along with a nicer dictionary syntax). The nullability tracking proposal also looks interesting. Overall looks like C# 7 is going to be awesome even if only a few of these get implemented.
- thecopy 11y agoAgreed! I really like the idea of symmetry when calling a method. I have never gotten why we can send multiple values in, but only one value out. And polluting the source code with structs for every method which needs to return two or more values is ugly.
- cltsang 11y agoWell, that's what out and ref parameters are for
- cpfohl 11y agoExcept out and ref parameters are exactly zero fun to use. Wheras returning two values is a lot of fun, esp. with pattern matching.
- yoklov 11y agoThis is somewhat subjective... I'm not sure I find either more fun than the other.
- cpfohl 11y agoYou are absolutely correct. Perhaps fun is the wrong word. It is however, a royal pain to use the first, and way less so to use the second...That's something I feel I could probably defend in an objective sense.
- TillE 11y agoThat's what C APIs look like. Sure it works, but it's not pretty. Conceptually, it makes sense to pass in an argument that gets modified (C# ref), but it's confusing and weird to have a parameter that's purely for output.
- jug 11y agoYes, at the cost of forcing the developer to start thinking in pointer semantics. When the language is trying to steer away from that, and suddenly introduces explicit attributes to return to that age, I think there's kind of a conflict polluting the language a little where it wouldn't have to be. I do believe at least 'ref' should be in the language to simplify C/C++ interop, but I think it they should firmly nudge devs into thinking of that more as a convenience feature for .NET marshalling. The beauty of tuples is that you get both a useful data type and nicer data passing in one bang with the tuple deconstructors, without requiring pointer semantics. Really a lot to win with just one concept.
- px1999 11y agoThe problem, and as far as I can tell the reason that they're considering a better tuple return value is that these don't work with async. The existing tuple type doesn't work well because its members are generically named; and very few people want to make lots of little classes that are only used to pass results from one method to its callers.
- NKCSS 11y agoThere have been Generic Tuples for a while in .NET... https://msdn.microsoft.com/en-us/library/system.tuple%28v=vs.110%29.aspx https://msdn.microsoft.com/en-us/library/system.tuple%28v=vs...
- mattmanser 11y agoThose things suck. Every time I think about using them I always end up just using a dict or declaring a new struct.
- MichaelGG 11y agoF# uses them just fine and they don't suck. So perhaps it's just the compiler/language not dealing with them very well? Edit: OK so it does suck that it's a reference type for even small tuples. But it's not C#/F#'s fault the CLR doesn't do a better job on those kinda things.
- Guvante 11y agoF# allows you to break up the tuple immediately, this tremendously aids readability as it avoids introducing confusing names. let (a, b) = Foo() Compared to var tuple = Foo(); var a = tuple.Item1; var b = tuple.Item2; You could consider them equivalent, but conceptually it is faster to understand that a is the first result IMO.
- MichaelGG 11y agoI'm just pointing out that System.Tuple doesn't suck as the commenter was saying. It's just C#'s handling of them.
- mattmanser 11y agoWhich means they suck in C# doesn't it?
- Guvante 11y ago
- cies 11y agoWow.. This "Strong interest list" is awesome: * Tuples (Proposal: #347) * Pattern matching (Proposal: #206) * Records / algebraic data types (Proposal: #206) * Nullability tracking (Proposal: #227) * Async streams and disposal (Proposals: #114, #261) They seem to be really useful for a "more-functional style" of programming. When comparing these ambitions and the level of transparency to Java's ambitions & transparency, then it seems that C# is (or has) overtaking Java. Combine that to the fact that dotnet is now an opensource project, and MS seems to be more "open" nowadays then Oracle has ever been: I'm stoked about this news.
- MichaelGG 11y agoIt's "awesome" ... yet still many years on behind. These are the kinds of things that should have been in v1 or v2. Things that F# got right from the get-go. It's great if you have to work on projects that are stuck with C# (but can freely use the latest compiler).
- cies 11y agoGiven how much MS has invested in Haskell, and how little/late they use that technology to their advantage has made me wonder many times what drives their R&D budget. Non the less: cool "new" features in C#, and thank you very much MS for investing so generously in Haskell!
- octo_t 11y agoThe fact that this is so out in the open on Github is pretty amazing - shows how much Microsoft is changing. Can you imagine the feature list of C# 1.0 being discussed like this?
- cies 11y agoYups. They day I read their massive open source release announcements I knew that MS is from now on not the same company it was. Mahatma Gandhi supposedly said: "First they ignore you, then they laugh at you, then they fight you, then you win." Which I think is very applicable to MS attitude to open source. Now they have a new attitude: If you can't beat'm, join'm.
- LLWM 11y agoFirst they ignore you, then they laugh at you, then they fight you, then they embrace you, then they extend you, then they extinguish you.
- jongalloway2 11y agoThat'll be quite a trick with an MIT license, community promise on patents, and published language specs.
- danbruc 11y agoBut this is not as new as some may think. The Entity Framework team uses a transparent design process [1] since 2008 and the C# team also opened the design process to the public some time ago. But it is of course getting more wide spread and even more open. [1] http://blogs.msdn.com/b/efdesign/archive/2008/06/23/transparency-in-the-design-process.aspx http://blogs.msdn.com/b/efdesign/archive/2008/06/23/transpar...
- sker 11y agoMan these guys don't stop. They haven't even released C# 6 and now we're discussing 7. With the "strong interest" features and type providers, is there any reason left to use F#? Also, I don't see why array slicing would require CLR support. That would be a welcome addition.
- bernadus_edwin 11y agoDot net framework team are very fast. When i want move to RoR, they provide asp mvc 3 include EF migration. When i want move to js, they provide async keyword. Now when i want move to f#, they provide it all in c# language
- M8 11y agoI would only use F# if I already knew it. Otherwise it just doesn't give any killer features anymore to justify the effort needed to learn it. I don't consider things like no nulls and default immutability a killer feature. Also there is just a handful of F# jobs and they don't offer an outstanding salary for knowing F#.
- kirse 11y agoF# async and parallel programming (Async.parallel, Agents/Mailboxes, Array.parallel.map, etc) are vastly superior to C# right now. Every latest C# iteration has repeatedly borrowed everything great from F#, that should be a sign alone that F# has tons of killer features (and continues to be ahead of the curve). I picked up F# in about 3 months by reading a few books, then refactoring a C# library into F# (this taught me a lot of the interop quirks), and then doing a full project in as much of the F# idiomatic way as possible. As far as jobs, I don't know anyone who uses the .NET stack that considers themselves strictly an "X" programmer. I've never used VB on a project, but I'd be pretty confident I could consult on a large VB project based on how much C# I've written. Mixed projects are really the best of both worlds anyway, learning F# will improve your C# simply because it teaches you new ways of reasoning about your domain. If C# 7 ends up implementing Tuples, pattern matching, ADTs, etc... those are all bread-and-butter of F#, might as well learn how to use them ahead of time.
- guiomie 11y agoNot sure to get the Tuple (#347) ... Why not use an anonymous type or the already existing Tuple class ?
- louthy 11y agoAnonymous types can't be returned from a method. Well, they can, but not with any kind of safety (casting to object, or dynamic). Using tuples is all about representing a type by its 'shape', not its name. With anonymous types there's no shape declaration; but I could imagine that it would be useful for C# to allow implicit casting of anonymouse types to tuples (where the shapes are equal).
- jtreminio 11y agoIf I wanted to learn C#, not knowing any other compiled languages (but knowing PHP), where would I start? Another gotcha: I'm on OSX, and would prefer to learn C# from the standpoint of CLI first, then GUI components.
- WDCDev 11y agoYou have a couple options: 1) Code up some simple C# code in a text editor (sublime) and then compile it using the mono c# compiler. 2) Run Windows on Parallels and download visual studio community edition. Folks are working on a CLR that will run on Darwin and the core framework as well as an alternative to Mono. This won't be released until later this year though, and tooling is still TBD.
- josteink 11y agoSublime? Parralells? Why not just Monodevelop[1] instead? It's an open-source .NET IDE. Although not on par with Visual Studio, I doubt anyone would expect that anytime soon. For a beginner it will probably be very relieving having Intellisense and code-completion, not to mention it will encourage exploration of the APIs in a much more playful manner than trying to read MSDN docs. If you're going to start getting into C#, don't start with your hands tied behind your back. Get the full package! [1] http://www.monodevelop.com/ http://www.monodevelop.com/
- Zolomon 11y agoUse mono [1]! Then write your first console application [2]. Or read [3] to learn about the language. And then maybe check out some trending github projects [4]! [1] http://www.mono-project.com/ http://www.mono-project.com/ [2] https://msdn.microsoft.com/en-us/library/k1sx6ed2.aspx https://msdn.microsoft.com/en-us/library/k1sx6ed2.aspx [3] http://learnxinyminutes.com/docs/csharp/ http://learnxinyminutes.com/docs/csharp/ [4] https://github.com/trending?l=csharp https://github.com/trending?l=csharp
- robodale 11y agoStart with Mono. The .NET platform is a beast to "just sit down and learn". I've been doing .NET since 2002.
- ohjesusthatguy1 11y agonigger.
- melling 11y agoMaladjusted 20 something male? We really need to figure out how to better socially educate them. http://en.m.wikipedia.org/wiki/Timothy_McVeigh http://en.m.wikipedia.org/wiki/Timothy_McVeigh Wonder what kind of people think Swatting is funny? http://en.m.wikipedia.org/wiki/Swatting http://en.m.wikipedia.org/wiki/Swatting Lasers at aircraft? http://www.laserpointersafety.com/news/news/nonaviation-incidents_files/77b30f9076e0b5a65d6278f574d7d481-10.php http://www.laserpointersafety.com/news/news/nonaviation-inci...
- ohjesusthatguy1 11y agojust pretty sure that would provoke a reaction. I'm trying to figure out how this hellbanning thing works.
- melling 11y agoAnd are you a 20 something maladjusted male? I'm just trying to figure out you work? You're kind of wasting people's time because you have have too much energy and nothing better to do. Personally, I would try to refocus and shoot for a more worthwhile goal.
- ohjesusthatguy1 11y agoThe most important principle on HN, though, is to make thoughtful comments. Thoughtful in both senses: civil and substantial. The test for substance is a lot like it is for links. Does your comment teach us anything? There are two ways to do that: by pointing out some consideration that hadn't previously been mentioned, and by giving more information about the topic, perhaps from personal experience. Whereas comments like "LOL!" or worse still, "That's retarded!" teach us nothing. Empty comments can be ok if they're positive. There's nothing wrong with submitting a comment saying just "Thanks." What we especially discourage are comments that are empty and negative—comments that are mere name-calling. Which brings us to the most important principle on HN: civility. Since long before the web, the anonymity of online conversation has lured people into being much ruder than they'd be in person. So the principle here is: don't say anything you wouldn't say face to face. This doesn't mean you can't disagree. But disagree without calling names. If you're right, your argument will be more convincing without them.
- TazeTSchnitzel 11y agoThe one thing that worries me about the tuples proposal is it would be confused with System.Tuple. The proposal seems similar to Python's namedtuple, so if possible, perhaps they could add some new .NET type (System.NamedTuple?) and use that?
- ohjesusthatguy 11y agonigger.
- ExpiredLink 11y agoMore features == better language. A tried and proven strategy.
- aeonsky 11y agoAre you willing to say the same for C++?
- pjmlp 11y agoYes. Most of the C++ warts are caused by the need to be copy-paste compatible with C, expectations of C developers being lured into this new language and be a drop-in compatible replacement for C tooling. "The Design and Evolution of C++", http://www.amazon.com/The-Design-Evolution-Bjarne-Stroustrup/dp/0201543303 http://www.amazon.com/The-Design-Evolution-Bjarne-Stroustrup...
- aeonsky 11y agoIf the entire C++ codebase I worked with was mostly C, my job would be so much easier. I think the 2000+ page C++ manual proves my point.
- thescrewdriver 11y agoIt's worked really well for C# so far, so perhaps it's only one of meany factors which determine the success of a language.
- pointernil 11y agoNice. At what point would it make more sense to just leave c# as it is and move on to a new "language"? I like all the changes and more importantly I guess I actually understand the intention and the need for them, at same time I'd like to question how all those actually fit into one language... I understand MS has a very strong record for support of legacy software, systems etc. So for sure on point would be to still "support" legacy C# code and allow for more modern paradimes in the same language, but given all the other .net languages and the interoperability provided: what is the drive behind pulling it all in into C#?
- MichaelGG 11y agoThey're far too heavily invested in C#, and good alternatives, like F#, are viewed as too difficult for the majority of their customer base to deal with. They can add these features, let less ... able ... customers argue over "var" and what they'll use, while pleasing other users. C#'s seriously annoying to code in due to it's statement-oriented nature and lack of basic features. Additionally, because libraries take dependencies on C# compiler implementation details, other languages do not interop as seamlessly as the .NET/CLR concept would have us believe. Looking at things like the precise output of lambda expressions, or all these APIs that take object, then read the properties as an argument list (which should just take a list of tuples instead). Also, just imagine the fallout of "Microsoft abandons main .NET language!"
- mattmanser 11y agoSeriously annoying? If you don't like it, don't use it and comment on other things. There's plenty of people that think it's one of the best languages available today.
- MichaelGG 11y agoYes, it is very annoying. It's overly verbose for no good reason. Well, if you count internal compiler complexity a good reason (that's why fields don't have type inference according to Eric Lippert, though they still haven't fixed up that inconsistency in Rosyln it seems). Plenty of people think C++ is a good idea for common apps. Plenty of people think node and JS are awesome. Plenty of people loved Flash. What's your point? Because C# is so popular (like JS), its questionable decisions ripple all over and affect people even if they aren't directly using C#.
- DonnyV 11y agoThe great thing about .NET is that it has a ton of great features but never feels overwhelming or slow.