473,396 Members | 2,106 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

what is new in c# 3?

Linq and the features necessary to support it get a lot of attention but
i happened to find out about partial methods by chance. Is there a
comprehensive list of new c# stuff somewhere? i couldn't find anything
obvious on the c# page on msdn.

dan
Dec 28 '07 #1
9 1227
Hi Dan,

your #1 Source for .NET, see there:
http://msdn2.microsoft.com/en-us/net...k/default.aspx

And e.g. have a look at this:
http://msdn2.microsoft.com/en-us/library/bb308966.aspx

Regards

Kerem

--
-----------------------
Beste Grüsse / Best regards / Votre bien devoue
Kerem Gümrükcü
Microsoft Live Space: http://kerem-g.spaces.live.com/
Latest Open-Source Projects: http://entwicklung.junetz.de
-----------------------
"This reply is provided as is, without warranty express or implied."
Dec 28 '07 #2
http://msdn2.microsoft.com/en-us/library/bb308966.aspx, as Kerem pointed out,
is a great list of new syntax in C# 3.

For a list of breaking changes in C#, you can see
http://msdn2.microsoft.com/en-us/library/bb308966.aspx

--
Browse http://connect.microsoft.com/VisualStudio/feedback/ and vote.
http://www.peterRitchie.com/blog/
Microsoft MVP, Visual Developer - Visual C#
"Kerem Gümrükcü" wrote:
Hi Dan,

your #1 Source for .NET, see there:
http://msdn2.microsoft.com/en-us/net...k/default.aspx

And e.g. have a look at this:
http://msdn2.microsoft.com/en-us/library/bb308966.aspx

Regards

Kerem

--
-----------------------
Beste Grüsse / Best regards / Votre bien devoue
Kerem Gümrükcü
Microsoft Live Space: http://kerem-g.spaces.live.com/
Latest Open-Source Projects: http://entwicklung.junetz.de
-----------------------
"This reply is provided as is, without warranty express or implied."
Dec 28 '07 #3
On Dec 28, 7:35*am, Dan Holmes <dhol...@ivsi.comwrote:
Linq and the features necessary to support it get a lot of attention but
i happened to find out about partial methods by chance. *Is there a
comprehensive list of new c# stuff somewhere? *i couldn't find anything
obvious on the c# page on msdn.

dan
Whatever Jon Skeet says is new. Only 1/2 joking.
Dec 28 '07 #4
Dan Holmes <dh*****@ivsi.comwrote:
Linq and the features necessary to support it get a lot of attention but
i happened to find out about partial methods by chance. Is there a
comprehensive list of new c# stuff somewhere? i couldn't find anything
obvious on the c# page on msdn.
Here we go:

Partial methods
Automatically implemented properties
Implicitly typed local variables
Object initializers
Collection initializers
Implicitly typed arrays
Anonymous types
Extension methods
Lambda expressions and expression trees
Type inference and overloading changes
Query expressions (from x in y where z select foo etc)

<shameless plug>
Find out more details in my book, C# in Depth:
http://manning.com/skeet
</shameless plug>

(Seriously though, if you want more information on any of those, just
let me know.)

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
World class .NET training in the UK: http://iterativetraining.co.uk
Dec 28 '07 #5

"Jon Skeet [C# MVP]" <sk***@pobox.comwrote in message
news:MP*********************@msnews.microsoft.com. ..
Dan Holmes <dh*****@ivsi.comwrote:
>Linq and the features necessary to support it get a lot of attention but
i happened to find out about partial methods by chance. Is there a
comprehensive list of new c# stuff somewhere? i couldn't find anything
obvious on the c# page on msdn.

Here we go:

Partial methods
Automatically implemented properties
Implicitly typed local variables
Object initializers
Collection initializers
Implicitly typed arrays
Anonymous types
Extension methods
Lambda expressions and expression trees
Type inference and overloading changes
Query expressions (from x in y where z select foo etc)

<shameless plug>
Find out more details in my book, C# in Depth:
http://manning.com/skeet
</shameless plug>

(Seriously though, if you want more information on any of those, just
let me know.)
I'd like to know your opinions on those features as they relate to
code-readability and maintainability (i.e. do they help, hurt, or have no
effect).

Dec 28 '07 #6
Scott Roberts <sr******@no.spam.here-webworks-software.comwrote:

<snip>
(Seriously though, if you want more information on any of those, just
let me know.)

I'd like to know your opinions on those features as they relate to
code-readability and maintainability (i.e. do they help, hurt,
or have no effect).
When used appropriately, they can help a lot - but only when you
actually *know* the new language features. For example, until you've
learned how query expressions are handled by the compiler, you can
easily make mistakes and the whole thing is somewhat magic. When you
*do* know what's going on behind the scenes, they're a huge boon to
readability, IMO.

I've been thinking a lot recently about two different aspects of
readability: what your code does, and how it does it. Often an increase
in the former aspect means a decrease in the latter. Extension methods
are a good example of that - they allow you to reduce the extra clutter
of specifying where a static method is coming from, but at the cost of
it not being obvious exactly what's going on.

That's okay so long as all the maintainers know how to find out the
"how" when they need to - but it also increases the risk of "cargo cult
programming":

http://blogs.msdn.com/ericlippert/ar...tax-semantics-
micronesian-cults-and-novice-programmers.aspx
A lot of the features of C# 3 could be overused and cause chaos - but
in the right hands they'll contribute a lot to readability, in my view.
I also suspect that a lot of the fear over some of the features
(implicitly typed local variables, for example) stems from a "but it's
never been like that before" viewpoint. I haven't been immune to this -
I initially hated the idea of implicitly typed local variables other
than with respect to anonymous types, but I now welcome them in many
other situations.

One thing I *would* say about C# 3 is that it's been very, very well
thought out. (That's not to say there aren't things I'd change - the
discovery of extension methods being the most obvious one.) The whole
thing hangs together as a set of changes and is very elegant. I've been
fortunate to spend rather a long time poring over specs etc (as part of
the writing process) which has made me think about the language changes
in a deeper way than I would probably have done otherwise.

In short, I really, really like C# 3 :)

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
World class .NET training in the UK: http://iterativetraining.co.uk
Dec 28 '07 #7

"Jon Skeet [C# MVP]" <sk***@pobox.comwrote in message
news:MP*********************@msnews.microsoft.com. ..
I've been thinking a lot recently about two different aspects of
readability: what your code does, and how it does it. Often an increase
in the former aspect means a decrease in the latter. Extension methods
are a good example of that - they allow you to reduce the extra clutter
of specifying where a static method is coming from, but at the cost of
it not being obvious exactly what's going on.

That's okay so long as all the maintainers know how to find out the
"how" when they need to - but it also increases the risk of "cargo cult
programming":

http://blogs.msdn.com/ericlippert/ar...tax-semantics-
micronesian-cults-and-novice-programmers.aspx
A lot of the features of C# 3 could be overused and cause chaos - but
in the right hands they'll contribute a lot to readability, in my view.
I also suspect that a lot of the fear over some of the features
(implicitly typed local variables, for example) stems from a "but it's
never been like that before" viewpoint. I haven't been immune to this -
I initially hated the idea of implicitly typed local variables other
than with respect to anonymous types, but I now welcome them in many
other situations.
I suppose the onus of creating "readable" code always falls to the
individual developer. I just wonder to what extent some language features
invite or encourage "lazy" coding. I'm not an early adopter of new language
features, but I don't think I'm afraid of them either. I am, however, a
little scared when they come with names like "partial methods" (where is the
rest of it?), "Implicitly typed variables" (what's wrong with explicit
types?), and "anonymous types" (you don't want me to know what type it is?).

I'm sure that there is a time and a place for these features, just like
there is probably a time and a place for overloading the "+" operator to
actually perform subtraction in C++. But is it worth it? I suppose that's
not only a subjective and rhetorical question, but one's answer probably
changes over time. I read some C# code today where all of the local
variables were declared (but not initialized) at the top of the routine. I
chuckled, because I used to do that.

Dec 28 '07 #8
"Scott Roberts" <sr******@no.spam.here-webworks-software.comwrote
I'd like to know your opinions on those features as they relate to
code-readability and maintainability (i.e. do they help, hurt, or have no
effect).
I've been very happy with the overall readability improvements in my code
due to C# 3.

- The "intent" of my code has become much more clear. It's very easy to look
at a block of code and tell what that code should be doing. This is a very
positive thing, and is a direct result of many of the new language
features.

- The line-by-line understanding of my code has decreased, I believe. I
blame Lambda functions, and (most recently) custom iterators mixed with LINQ
and LINQ to SQL.

By this I mean, you may look at someone's code that implemented, say, a
QuickSort. You may unsterstand every single line of code, with excellent
clarity. The overall intent of the code though may remain elusive.

With the somewhat abusive way I've been using C# 3 these days, my intent is
typically very, very clear. However, some of the individual lines of code
are very difficult to understand. This is especially true of the reader
doesn't know C# 3.

Now I just need to start adding in some addition complexity:
yield return myFile.BeginWrite( Parallel.For(myBuffer,
d=>SomeOperation(d)), myBuffer.Count(d=>d.Value % 2 == 0), this, null));

(I'm kidding I'm kidding. I would never write code like that. Except on a
Friday afternoon.)
--
Chris Mullins

Dec 28 '07 #9

"Chris Mullins [MVP - C#]" <cm******@yahoo.comwrote in message
news:en**************@TK2MSFTNGP02.phx.gbl...
Now I just need to start adding in some addition complexity:
yield return myFile.BeginWrite( Parallel.For(myBuffer,
d=>SomeOperation(d)), myBuffer.Count(d=>d.Value % 2 == 0), this, null));

(I'm kidding I'm kidding. I would never write code like that. Except on a
Friday afternoon.)
I think that's why I'm gun-shy. I read macro-compiled Clipper code on a
somewhat frequent basis and it looks just like that!!

Dec 28 '07 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: thecrow | last post by:
Alright, what the hell is going on here? In the following code, I expect the printed result to be: DEBUG: frank's last name is burns. Instead, what I get is: DEBUG: frank's last name is...
220
by: Brandon J. Van Every | last post by:
What's better about Ruby than Python? I'm sure there's something. What is it? This is not a troll. I'm language shopping and I want people's answers. I don't know beans about Ruby or have...
699
by: mike420 | last post by:
I think everyone who used Python will agree that its syntax is the best thing going for it. It is very readable and easy for everyone to learn. But, Python does not a have very good macro...
92
by: Reed L. O'Brien | last post by:
I see rotor was removed for 2.4 and the docs say use an AES module provided separately... Is there a standard module that works alike or an AES module that works alike but with better encryption?...
137
by: Philippe C. Martin | last post by:
I apologize in advance for launching this post but I might get enlightment somehow (PS: I am _very_ agnostic ;-). - 1) I do not consider my intelligence/education above average - 2) I am very...
12
by: Dario | last post by:
The following simple program behaves differently in Windows and Linux . #include <stdexcept> #include <iostream> #include <string> using namespace std; class LogicError : public logic_error {...
125
by: Sarah Tanembaum | last post by:
Beside its an opensource and supported by community, what's the fundamental differences between PostgreSQL and those high-price commercial database (and some are bloated such as Oracle) from...
47
by: Neal | last post by:
Patrick Griffiths weighs in on the CSS vs table layout debate in his blog entry "Tables my ass" - http://www.htmldog.com/ptg/archives/000049.php . A quite good article.
121
by: typingcat | last post by:
First of all, I'm an Asian and I need to input Japanese, Korean and so on. I've tried many PHP IDEs today, but almost non of them supported Unicode (UTF-8) file. I've found that the only Unicode...
8
by: Midnight Java Junkie | last post by:
Dear Colleagues: I feel that the dumbest questions are those that are never asked. I have been given the opportunity to get into .NET. Our organization has a subscription with Microsoft that...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.