TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

First C# 7 Design Meeting Notes

154 pointsby Romokuover 10 years ago

10 comments

MichaelGGover 10 years ago
Good start, finally adding records, patterns, tuples, non null, would be a good first step to making C# not feel so heavyweight compared to F#. If the F# team ever gets enough resources to complete with C#&#x27;s VS features, perhaps we&#x27;d get some serious adoption. As is, F# comes across second class both in tooling and MS marketing - that&#x27;s not really competing fairly ;)<p>But without making things expressions, it&#x27;s still gonna be clunky. First class immutability and expressions instead of statements would help propel it further. I still would feel rather limited about having no type inference on local functions, though.<p>What would be really exciting is if the runtime was also open for some real changes. Traits, non null, slices, maybe even ownership (so we could stack alloc, a huge perf win)... One can dream.
评论 #8959012 未加载
评论 #8959015 未加载
评论 #8958444 未加载
评论 #8959627 未加载
评论 #8958775 未加载
DrDimensionover 10 years ago
I cannot help but think that the overwhelming desire to support immutability and functional constructs here, as well as in nearly all other modern languages, gives significant evidence that functional programming is finally winning out over OOP.<p>In the future, I hope that FP will be the default design choice, with objects being used where needed such as for components, plug-ins, and ad-hoc dictionary-passing-style tools.<p>After all, simplicity is the most important property of any software system - <a href="http://www.infoq.com/presentations/Simple-Made-Easy" rel="nofollow">http:&#x2F;&#x2F;www.infoq.com&#x2F;presentations&#x2F;Simple-Made-Easy</a>
评论 #8961468 未加载
评论 #8961575 未加载
评论 #8962273 未加载
Rapzidover 10 years ago
I would LOVE for C# to get language support for go style channels complete with select and friends.<p>C# already has the fantastic Task stuff, and while they aren&#x27;t as cheap as go&#x27;s go-routines they work very well. Channels would just ice the cake so well. :D~~~<p>And while I&#x27;m at it. I did some testing recently and realized that manually currying in a for loop is faster than using function composition with delegates by about 40% :| It feels like in theory it should be compiled down to code with the same efficiency? This is probably more of a CLR&#x2F;JIT issue though?
评论 #8959428 未加载
评论 #8958734 未加载
评论 #8962629 未加载
评论 #8958667 未加载
评论 #8958605 未加载
vansover 10 years ago
I think it&#x27;s too late for non null ref types. But pattern matching, traits and built in code contract would be awesome !
评论 #8960800 未加载
x0x0over 10 years ago
As a java programmer, who is involved in some large projects that can&#x27;t be ported, I&#x27;m really jealous. And eagerly waiting to see how well the .net core runtime targets linux and mac.<p>Good, no copy interop with native code would also be awesome. Particularly for machine learning.
评论 #8959225 未加载
jpgvmover 10 years ago
If even 50% of this makes it into C# it&#x27;s going to be a pretty amazing language.<p>Native code interfaces were already reasonably fast, allowing more no copy semantics and array slice behaviour is going to do wonders for native library performance.
评论 #8958701 未加载
coldteaover 10 years ago
If only the open source languages we use had that many resources and paid developers...<p>(Well, technically C# and the related libs are fully OSS now too, IIRC).
评论 #8958510 未加载
评论 #8958843 未加载
评论 #8959148 未加载
评论 #8958496 未加载
mhomdeover 10 years ago
I&#x27;ve been trying to think of something that drastically change how I coded. Bugs and productivity really are the two major dragons to slay.<p>I&#x27;m just spitballing here but something I&#x27;d really like to see stuff like code contracts and unit testing, but more integrated with the language, less verbose and requiring less to setup. Being able to let the &quot;meat&quot; of a method be separated from all the error-checking, post, pre conditions etc would really make things cleaner.<p>Current implementation feels like it requires too much setup with separate classes, duplicate method signatures in several places etc etc. It would be really cool to have something like<p><pre><code> public int SomeMethod(int a, int b) pre { Requires (a &gt; 5); Requires (b &gt;= 0, new Exception(&quot;something something&quot;)); } { &#x2F;&#x2F; DoStuffHere } post { Ensures (result &gt; 0, new Exception(&quot;needs to be above 0&quot;)); } </code></pre> I&#x27;d even want to be able to separate it into separate files using partial classes (or something) so you could the condition stuff separate , with or without duplicating signature depending if you wanted to target specific overloads<p>Full signature would simply be without the body:<p><pre><code> public int SomeMethod(int a, int b) pre { Requires (a &gt; 5); Requires (b &gt;= 0 ,new Exception(&quot;something something&quot;)); } post { Ensures (result &gt; 0); } </code></pre> Without signature is trickier, but would be cool since you could use same conditions for several overloads, and just target the variables that are included in each:<p><pre><code> Conditions.SomeMethod { pre { Requires (a &gt; 5); Requires (b &gt;= 0, new Exception(&quot;something something&quot;)); } post { Ensures (result &gt; 0); } } </code></pre> heck, why not even throw in &quot;test blocks&quot; and Visual studio could run light-weight kind of unit test as you programmed and mark the whole method as functioning or not. Imagine having a sort method and throw in something like:<p><pre><code> public IEnumerable&lt;int&gt; Sort (IEnumerable&lt;int&gt; list, Order order) test { (list = {3,5,6,2}, order = Order.Ascending) =&gt; result == {2,3,5,6}; (list = {3,5,6,2}, order = Order.Descending) =&gt; result == {6,5,3,2} } </code></pre> VS could highlight the failed test(s) directly in the editor as you coded<p>The specifics and syntaxes of these things requires some thought but I love the basic premise, am I rambling?<p>edit: I saw that something in this direction if not as extensive was actually discussed
评论 #8960982 未加载
评论 #8959302 未加载
评论 #8959387 未加载
bartweover 10 years ago
I&#x27;d like some method to write GC-less code for games. Structs with copy constructors and destructors perhaps.
tallesover 10 years ago
&gt; Method contracts<p>Oh god, I want it SO BAD.