[.net] If you could request one feature for the next C# and/or .NET version, ...?

Started by
74 comments, last by Rainweaver 13 years, 8 months ago
Quote:Original post by Aardvajk
Quote:Original post by phresnel
* RAII


Couldn't agree more. It's a shame you can't somehow mark instances to destruct when they leave scope. I know about the using method, but having to implement the IDisposable interface just to have predictable destruction is probably the main reason I never got into C#.

I don't really understand the love of GC. Managing resources in a language that supports RAII is not a difficult issue for me.


difficult or not, it still is work :)

i loved RAII in c++, but since moving to c# i never really had much need for it anymore, at all. those spare moments, implementing the using pattern worked just well.

it's a matter of being able to let go with old habits. once you start to trust the gc, you don't bother about it anymore.
If that's not the help you're after then you're going to have to explain the problem better than what you have. - joanusdmentia

My Page davepermen.net | My Music on Bandcamp and on Soundcloud

Advertisement
I would have to go with Property Indexers without the need for using a class with its own indexer (It's available in VB.NET but I don't use that...) or, NotifyPropertyChanged for automatic properties.
Quote:Original post by davepermen
the trick is to learn how unimportant the 'strong typing in code' is. my code got more maintainable trough var everywhere. and more easy to read and understand.

but i would adapt if i would have to code with you, of course. no problems there :)

(hint, once you start to use linq and automatic types and all, you get to stop caring about the typename anyways :))


Sorry, had it (and the abomination that is linq) for years now and seeing its misuse has only put me further on the explicit annotated variables are good camp.

(don't get me wrong, I like that the IEnumerable extension methods that linq uses are there. I just find the special syntax inconsistent, difficult to work with and distasteful. I also hate how people tend to wildly abuse it into doing 8 lines of readable work into 1 line of unreadable line noise. Not perl levels of bad, but still)
Oh wait I got one: Edit & Continue support for anonymous methods.

It is such a nice feature that can save you lots of time fixing and immediately retesting small bugs that would otherwise require you to restart the whole application and reaching the state where the bug occurred again. Unfortunately this becomes more and more impossible as Lambda expressions and LINQ gets added to the code :(

Speaking of which, I find LINQ to be very useful, and yes I actually mean the query syntax with that, not just chained extension methods; just by reading the query you naturally know what the code is doing. Sure, coding that filter / sort / group by manually might be marginally faster, but it also results in code that is a maintenance nightmare. Manual, chained expressions are okay if they're short and simple, but shunning the LINQ syntax even for more complex stuff kind of defeats the point IMO, as Lambda expressions aren't exactly natural to read. A long chain full of parentheses and arrows just isn't that easy to parse.
Actually i'd also really like object to have a VarName property so you could convert code such as
throw new ArgumentNullException( "myvar" );
and Propertychange("myvar");
into
throw new ArgumentNullException( myvar.VarName );
and Propertychange(myvar.VarName);
Quote:Original post by Telastyn
Sorry, had it (and the abomination that is linq) for years now and seeing its misuse has only put me further on the explicit annotated variables are good camp.

(don't get me wrong, I like that the IEnumerable extension methods that linq uses are there. I just find the special syntax inconsistent, difficult to work with and distasteful. I also hate how people tend to wildly abuse it into doing 8 lines of readable work into 1 line of unreadable line noise. Not perl levels of bad, but still)


to each it's own, then again i could argue you just haven't seen the light :) linq for me enhanced my code massively in readability due the focus on "what i want" and the defocussation of "what i do". and it reduced code massively.

but as said, it's a personal thing, if one likes and prefers that to the other. i would adapt as needed if i would have to work with you. i would just sneek my way in in some obscure places you would never look at anyways :)

but the defocussing on static types (means explicit written and have-to-rewrite on every change types) is imho, a thing of beauty.

i never thought i would think that way back in c++ days. i was too scared of all the possible ways code could go boom just because of some ambuigity. in c#, that got away, and thus the reliance on explicit types.
If that's not the help you're after then you're going to have to explain the problem better than what you have. - joanusdmentia

My Page davepermen.net | My Music on Bandcamp and on Soundcloud

Quote:Original post by itachi
Quote:propably property scoped fields

I'd like to have a NotifyPropertyChangedAttribute so I can finally get rid of backing fields all together:

[NotifyPropertyChanged]
public int Blah { get; private set; }


That relieves one use case of backing fields (granted if you're writing WPF/Silverlight, it's probably a large use case), but it doesn't alleviate the need for them completely.

What if you want to validate the value, for instance?

Quote:Original post by phresnel
* RAII
* multiple inheritance
* free functions
* type aliases and strong typedefs
* builtin copying and deep-copying semantics for objects
* C++ style const correctness
* lazy instantiation / non-constrained generics (possibly let compiler emit throw-statements for non-covered instantiation cases), this would eliminate a lot of workaround code
* non-type generics parameters
* [partial] specialization of generics


Jesus phresnel, one feature! Are you sure you don't just want C++? [grin]

But yeah, agree those are all things that C# would benefit from. I don't rate our chances of getting any of them though.

if you think programming is like sex, you probably haven't done much of either.-------------- - capn_midnight
This is more of a Visual Studio specific feature. I want the 'go to definition' support to work properly across languages (if I've got C#, F#, and C++/CLI projects in a single solution). Using each language for its strengths is the future(or, my future anyway), so it might as well be as painless as possible.
Quote:Original post by ChaosEngine
Jesus phresnel, one feature! Are you sure you don't just want C++? [grin]


Soz :P

But actually, I am using C++ most of the time in my spare time, and C# at work. Not easy to get a C++ job here in germany :D

More of an IDE thing kinda but how about having data breakpoints in C#?

I know there are garbage collection / etc issues that would have to be worked out, but maybe the debugger could take those into account? (ie if an object moves in memory, it watches the new location)

This topic is closed to new replies.

Advertisement