Posted By: exoteric | Oct 18th @ 12:12 PM
page 3 of 4
Comments: 77 | Views: 1191
stevo_
stevo_
Human after all

Is it even ON the wishlist? can you explain why somebody would want this vs the .net tuple class? regardless of source naming guidelines Tongue Out.. (having type arg a and paramter a is really needlessly complicated).. personally I think you have a over obsession with functional style code.

 

C# isn't classically functional, so trying to treat it so is really pretty abusive and it shows with how you'd need to use it.. if you want to go nuts on functional style, why not just pick a language that is based on functional foundations like F#?

 

Your efforts would be much more rewarding there.

> recursion; for composition (tuple.Rest rather than new Tuple<A,B>(tuple.Item1, tuple.Item2); to be fair: representation bias)

I would call .Rest.Rest.Rest.* a bad design rather than a different representation, get a better name and I may change my mind Tongue Out

 

> enumeration; for composition (use tuples directly as sequences which, intuitively they are)

And how are you going to enumerate them, return a IEnumerable<object>? That surely ain't cool.

 

 

I like tuple syntax, but I kinda feel it fails the -100 point test for C#.  re enumeration of tuple values, this seems more of a metaprogramming kind of feature and actually can't you do it with reflection even now?  actually, isn't this more or less equivalent to serialization?

 

 I would definitely like to see some kind of language feature that makes declarative dataflow and data binding less awkward.  It doesn't have to be direct support for the WPF dependency property system -- although I'd personally welcome that -- but maybe there's some more general feature that would still allow something like WPF dependency properties to be built on top of it and be syntactically nicer, though I can't think just what that would be at the moment.

 

I would of course also welcome better support for non-nullable and immutable values -- and pure functions -- but I suspect this may have to wait for a successor language to C# (which might still be called C# as with VB6 -> VB.NET).

Frank Hileman
Frank Hileman
VG.net

I agree with you. I would like to be able to specify the semantics of a data type or method more easily: should it be treated as immutable, or not (const). Should an argument be considered deeply const, etc. The compiler can take advantage of that and we can be free to break the rules, to add diagnostic fields to data types, for example.

 

The main problem I have is the clumsiness of value semantics in c#. This is just language weirdness.

Sven Groot
Sven Groot
My name has 9 letters. Coincidence? I think not...

On the other hand it is strange[1] that it's not possible to express that a struct (such as Tuple) conforms to an interface (such as IComparable<T>).

That's not true. Structs can implement interfaces just fine.

Dodo
Dodo
I'm your creativity creator™ :)

I'd want that, too. Smiley

Frank Hileman
Frank Hileman
VG.net

Constness (knowing if an object can be modified by a method) might be about purity if you are thinking about functional languages and concurrency. I simply find value semantics easier to reason with and work with, whether or not I am using a functional language or concurrency. It feels natural.

 

If you make a heap allocated data type (class in C#) immutable, it starts to acquire value semantics. But you still need to implement a lot of boilerplate code (Equals, IEquatable, operator == !=, GetHashcode etc), this code is a waste of time, and it is different from the boilerplate code you need for a stack allocated data type (struct in C#). The choice of value semantics or reference semantics should be independent of the allocation technique. 

 

Ideally, we can change from heap to stack based allocation without changing the data type implementation or usage. C# is probably permanently broken. But anything to move in that direction, and reduce the amount of code bloat, would be helpful.

SlackmasterK
SlackmasterK
I write my OWN blogging engines

I think the biggest and most important change in newer versions of the framework is simply this:

 

Companies should upgrade to it.

 

My .NET 3 - 4 skills are going to waste, except on my hobby projects. My previous job is just now starting to upgrade to .NET 2.0.

GrantB
GrantB
What the hell are we supposed to use man? Harsh language?

Not really sure about these but...

(1) Clojure like pure/persistent data structures and STM.

(2) Go like type equivalence.

(3) Erlang like lightweight processes, perhaps using heap allocated stack frames (c.f. Second Life marshalling).

 

mod up Unnullablfe<T> (although I'd prefer NonNullable<T>). It should be usable in all places types are usable today and the framework should make full use of it. This would obviously require a CLR rev. Languages that support it should mark their assemblies appropriately, those that don't have the implicit casts/expections added for them by the jit.

ramooon
ramooon
LongCat

I would love to see a way to extend types beyond that awkward "first-parameter-with-this-modifier" trick.

For example this natural syntax would be awesome:

 

// 'class', 'struct', 'interface' or 'enum' keywords
// are useless here since the type already exists
public extension TypeToExtend
{    
     // 'public' modifier is useless here, as in any interface declaration
     void ExtensionMethod()
     {
          // the 'this' keyword is available here
          ...
     }


     static void StaticExtensionMethod()
     {
          // the 'this' keyword is NOT available here, as in any static method
          ...
     }


     void ExtensionProperty { get; set; }
}

 

 

 

As you can see it would allow "extension properties" and "extension static methods".

You could even have "extension constructors", "extension events" and so on...

Everything you could imagine to extend !

 

ramooon
ramooon
LongCat

Well, I'm not sure to understand what you said but the extensions would be available only if you import the right namespaces (ie. exactly the same behavior as the current syntax). The main benefit over partial classes is that it does not require  the 'partial' keyword at the declaration site and it is not limited to classes therefore basically everything is extensible by default Smiley What I didn't realize is that the partial keyword would become totally useless o_O ... right ?

 

BTW Here's what I would like to see in future C# releases:

- Contracts: Spec# contracts built-in the language (with the bang non-null operator)

- Metaprogramming: a way to have user-defined keywords and syntax (ie.  a 'keyword' keyword and so on)

- Immutablilty and Purity keywords

- Some more declarative and lazy stuffs -- I absolutely love LINQ

 

Another idea, but IDE specific:

I wonder why although the IDE is now WPF based, it is still limited to classic characters ?

For example if I type something like "-->" I would like the IDE to replace it with a real arrow.

This would allow custom symbols to be used in modern languages...

 

GrantB
GrantB
What the hell are we supposed to use man? Harsh language?

Would there be any value in this?

 

void f(dynamic IFoo arg)
{
    arg.foo();
}

 

Where

(1) arg is of type dynamic

(2) the compiler warns when arg is used in a way not compatible with IFoo

(3) the compiler warns when an actual parameter does not implement method signatures isomorphic with IFoo

(4) the IDE provide arg with IFoo intellisense

page 3 of 4
Comments: 77 | Views: 1191
Microsoft Communities