DNK has a spanking new server up and running like clockwork. Stability problems are a thing of the past. Our new monitoring service reports 100% uptime since the move!
26
kicks
published 11 months, 12 days ago, submitted by Anastasiosyal Anastasiosyal 11 months, 15 days ago

anastasiosyal.com — C# 3.0 still hasnt sunk in yet for most, yet there already seems to be some buzz about c# features we would like to see in the future. Here is my take on the 4 language features i would like to see implemented in C#

Add a comment 6 comments | category: | Views: 651 | Get KickIt image code
4 features for C# 4.0
tags: | tag it

new Add a live kick counter to your blog >> liveImage

You can even customize the image by choosing your own colors, and then clicking the button below to update the preview and the html code:

  • "Kick It" text
  • "Kick It" background
  • kick count text
  • kick count background
  • border

Simply copy and paste this HTML into your blog post.


Users who kicked this story:

Comments:
Duck typing? Safe null dereferencing?

Come on guys. Those are nice things, but not critical by any means. I'd much, much rather see something that would help us write less-buggy code, such as design-by-contract attributes with compiler enforcement, ala Spec#.

[Pure]
string GetFoo(string baz, int bar)
requires baz != null && baz.Length > 0
requires bar > 0
ensures return != null;
{
...
}

This would eliminate a wide range of programming defects. How much greater importance is that than niceties like duck typing and null dereferencing!
posted by JudahGabriel JudahGabriel 11 months, 12 days ago
Moreover, Spec#-like contracts would open the door for more concurrency, as concurrency's main blocker is side-effects. If the compiler could tell you about side effects thanks to contracts within the framework, it would remove a huge number of concurrency defects as well.
posted by JudahGabriel JudahGabriel 11 months, 12 days ago
@JudahGabriel - you're better off commenting on the blog intself
posted by topbanana 11 months, 12 days ago
Perhaps there as well. But folks around the .NET community need to come to this understanding, which is why I posted here.
posted by JudahGabriel JudahGabriel 11 months, 12 days ago
How does the compiler enforce purity? It would seem that in order to mark a method as pure all the methods that are called inside of the method must also be pure. So essentially every library call all the way down to some level (system calls???) have to be verifiably pure. How does this happen?
posted by logicalmind 11 months, 12 days ago
The compiler can enforce purity by allowing calls only methods which are marked as pure. Most property getters could be marked as pure, for example, as well as many utility methods that do arithmetic, deal with strings, or otherwise don't rely on and don't modify external state.
posted by JudahGabriel JudahGabriel 11 months, 12 days ago



information Login or create an account to comment on this story

Related Stories:
 

Search: