Get Ready For C# 4.0
blogs.msdn.com
blogs.msdn.com
In the end he talks a little bit about what is beyond 4.0 and he demonstrates the "compiler as a service", which is something I am looking forward to see :) In fact guys from Mono already moved things forward a little bit: http://www.mono-project.com/CsharpRepl
I like where this is heading.
2008, C#: Three quarters of the way to Lisp!
foo({ 'name': 'bar', 'title': 'Bar' });
This means not having to look up what the exact order of options are, nor having to pass in a bunch of null parameters because the one you want is the last parameter. Very cool.
}
Obviously, all IMO.
I do, however, have intellisense in my eyes.
var c = new Cube(1, 2, 3)
or: var c = new Cube(height: 1, width: 2, depth: 3); var c = new X(3, "blue", null, null, null, null, false, true, null, 1, null);
(which, sadly, is an all too common implementation pattern), you can have: var c = new X(foo: 3, bar: "blue", baz: false, quux: true, wibble: 1);
Which seems quite a bit better.Another advantage of named/optional parameters is that you can use them in the construction of immutable objects, whereas you don't get that advantage if you use settable properties.
I've passed on anything coming out of microsoft since about 2003 or so, and I feel much better for it. No more stacks of MSDN cds, no more 'support events' and so on.
No more viruses, worms, trojans, piles of malware and other nonsense, besides license fees, subscriptions to stay up-to-date, re-installs every 3 to 5 months.
Open source all the way for me these days, and I feel much happier for it.
It's possible that C# is a great language and that I'm missing out on something that would improve my life in a way that I can not currently imagine but there always seems to be a price for that.
The way microsoft has behaved in the past is such that if I can avoid using stuff that they have a hand in I will.
It's true that that may 'hurt' me in the sense that C# is probably a great language, but there are so many 'great languages' that this was a luxury problem anyway.
Between Python, Clojure and more exotic stuff like Erlang and Haskell there isn't enough time already. If microsoft had been a little nicer in the past they might have had an advocate in me, but enough really is enough.
With some other big companies, such as for instance IBM I've got the feeling that they really understood and have changed their ways, with microsoft I've never lost the feeling that they still don't get that they were in the wrong and are still just trying to dance their way around the real problems without admitting that they were wrong and bettering their ways.
I think that they will only change when the last of the 'old guard' at microsoft have stepped down from day to day management positions.
Care to elaborate? I still do not understand some of the over generalized MS bashing, especially when it comes to software development. From my experience, they have had some of the best tools and support over the years. Perfect? No way. Bloated libraries? Hell yeah, but only use parts that you need. Able to get the job done? Yes.
[I primarily used their tools when I worked for a couple of videogame studios and at university - currently using both open source and MS tools and languages]
Then there was netscape, the media player issue, a bunch of FUD to various governments to get them to extend their lock-in rather than to go with open source and a series of briberies http://slashdot.org/articles/06/12/27/1423234.shtml and so on.
The tools and their quality don't enter in to it, it's the corporate conduct that I have a problem with.
I certainly can't argue with that point and would agree to an extent. Though when working/programming I am less idealistic on this topic I suppose.
That and the threat of relying on any patent Microsoft may use against me in the future scares me away from anything that comes from Redmond.
My problem is not the heritage and other superfluous stuff. I am not willing to deal with a horrible operating system. Dave Cutler and team just don't get it - surprisingly Ken, Dennis and Brian did.
Can any of you really disagree with "No more viruses, worms, trojans, piles of malware..."? In all the time I have been using Linux (OpenBSD now) I haven't had this sort of problem. I am not saying this systems are invulnerable. But OSS/*NIX system users will probably not have this sort of problem and even if they do it won't be as often as Windows users.
P.S. Maybe the title attracted only Windows and C# people?
The title says "Get Ready for C# 4.0".
That's a pretty all-inclusive title, it apparently also addresses me. But I won't be 'getting ready for C# 4.0' and I think that I'm within my rights to say so and to explain why.
Maybe you don't like my reasons. Maybe you think I 'hate' microsoft (I don't, actually I think some of their products are pretty good, notably excel and visual studio, but I can't stand 'word', 'outlook' and 'clippy'). But I think they as a corporation still have to show they understand that they've done some things wrong in the past and until they change their ways (and deal better with the virus plague on their machines), and convince me that they mean it I will not be switching back, even though that probably would save me a bunch of headaches when communicating with customers that still think attachments in proprietary formats are a valid means of communication (it is to them all their buddies are using microsoft, I'm the odd one out).
I remember IBM handing out little flashlights on a trade show a few years ago, they were labelled 'we've seen the light'. It took them being beaten within another 3 years of their lives to finally 'get it', if not IBM could have easily gone the way of SUN and SGI. Microsoft still hasn't reached that phase.
I wish microsoft and all those that support them the very best, meanwhile I'll be playing over here with other, almost equally shiny toys.
About the virus plague -- yes, I was hit by Blaster on XP too, but MS seems to have really started getting security around 2003. The only explanation for your product having more malware than your nearest competitor's, even though your product is objectively more secure, is that the amount of malware is a function of market share.
I agree with you about the downsides of using proprietary formats. However, the power of a general-purpose computing platform like Windows, Mac OS X or Linux is that you can choose to lock or not lock yourself exactly as much as you want to, so I consider it a non-issue. Given that the platform gives you the freedom to not lock yourself into it, to my mind technical specifics and personal preferences for tools become the deciding factor. I really like the Visual Studio debugger and C# as a language.
np.
> is that the amount of malware is a function of market share.
I've heard that a lot, but it may very well just be bad design. By the time another platform displaces windows we'll know.
Whether it was 'objectively more secure' I don't know.
The number of exploits that have been found over the years is alarming, I don't think that the various unix based desktop systems are that vulnerable.
One argument why I think that is true is that if the number of windows hosts is 100x as large as the nearest competitor (and it's not, it's much less) then the 'niche' of the competitor is large enough that for a few of the entities targeting windows and getting only a small share of the machines because of inter-viral warfare (and that's pretty much the norm) the competitor is actually 'low hanging fruit'.
Assuming of course that the platform is equally easy to exploit.
The fact that we're not seeing something like that to me suggests that there really is a real difference between the various platforms in exploitability.
Talking in terms of "may" and "might" isn't particularly useful. Do you have concrete examples?
> I don't think that the various unix based desktop systems are that vulnerable.
Could you cite this, please? For Mac OS X in particular.
> Whether it was 'objectively more secure' I don't know.
It is. For instance, Windows has a proper ASLR implementation, while the Mac implementation is useless.
I strongly suspect you would see lots of downmods on comments like this from the vicinity of Redmond.
Two all is comments are about Windows OS not a single one about C# which is presumably the topic at hand.
I've had to re-install machines numerous times because they became unusably slow or infested with malware. We had one machine to which this never happened, nobody really understood what made it different from all the other ones (as much as 25 machines at a time at some point), that little machine just kept chugging away. Maybe it needed an occasional reboot, but even that must have been rare because I don't recall ever having to do that. It's not like it was build with premium components either, it was mostly built from leftover bits and pieces.
I was a licensed MSDN developer for a long time, it cost a pretty penny. You've never paid license fees ? Ok, that's your decision, I always paid for the ones we used, in fact I probably paid for plenty that I didn't use (aka the microsoft tax).
For the most part though, windows was nothing but trouble for me and the people that I worked with, and since switching to linux I haven't had any experience even remotely comparable to what used to be my lot when still using windows.
The machine I'm writing this on was bought in December, the 'vista' installation that came with it was wiped and replaced with Ubuntu. It's a fair sized machine, 10G of ram and an i7 processor, this is still the first logged in session on that machine since I got it. That's amazing stability. It's possible that microsoft has comparable stuff now but I won't be seeing any of it until I either absolutely have to or they do something unthinkable today to prove that they really get it. (Such as, for instance really opening up the source to windows or some earth shattering move like that).
I'm happy you're happy with either, I'm more happy with FOSS stuff, it feels like it is a more natural and democratic approach to computing than having my capabilities granted and removed by some corporation, especially one that has been a bad little boy in the class of corporations.
this is still the first logged in session on that machine since I got it. That's amazing stability. Not sure what to say about that, I have only rebooted Windows after applying system updates for as long as I can remember but then I mostly turn it off when I know I am not going to use it for a few hours so I have never had a large uptime.
That still doesn't address the fact that this is entirely off topic as Windows OS != C#. My entire use case for C# is as the scripting language for Unity3d which is based on mono since it is cross platform capable.
As a community of startup founders, we're all in the game to make money, and as such we're all nominally competing against one another, albeit on a very low level.
Whenever I see somebody making a business decision based on emotion rather than technical analysis, I can't help but crack a little smile. One more potential competitor has weakened himself just that little bit.
Closed minds in others are a competitive advantage for your business.
What is best and what is not is dependent on a lot of factors, and if you think that microsoft is 'the best' then you should realize that what is best for you may not be best for everybody else.
I didn't realize we were potentially in competition, but I sincerely wish you the best possible success.
Allow me to restate: Keep an open mind and make business decisions based on rational analysis, or your business will suffer as a result.
I'd say the same to you if you were angry with Apple or In & Out Burger.
So, of course you'd have made the same remark if I were angry with Apple or In and Out Burger.
Now, I have no experience with 'In and Out Burger', but Apple's antics of late have given me reason to regret buying an Imac for myself and my son a little while ago.
It is almost as though ever corporation that strikes it big in software immediately feels the need to not just taste but swallow, they literally want it all. I don't feel comfortable about that, and if that means I'll make a few bucks less, then so be it.
But so far it hasn't given me the feeling that I'm making less bucks, in fact I'm probably making considerably more.
To the tune of a substantial amount of money since I decided to leave microsoft behind me.
How is it working out for you on the other side of that line?
Are you happy? Profitable? Supported Well?
Then that's all good.
C# In Depth is not like a technical reference book where the author rehashes the same information what you can find on your own at MSDN. Jon discusses the evolution of language starting from C# 1.0 up to 3.0. I sincerely wish that all technical books were written like this. If you are still not convinced and want the cofnirmation from someone more authoritative, let me point you to Eric Lippert's forward for the book.
http://blogs.msdn.com/ericlippert/archive/2008/04/28/c-in-de...
Eric Lippert is a senior developer on the C# compiler team and his blog is a must read for all C# developers.
Coming to the main point, my guess is that Jon may be skipping on some details in the new version of the book which he has already covered in the current version. And I think it would be great idea to learn about the choices/compromises made by the language designers.
Good luck.
Just so as not to scare people off.
The use of .NET and C# (and Java) is often mandated by management levels, specially in large companies. For those unlucky folks, even a tiny little progress is a move in the right direction.
Even if you want a .NET-like environment, you could use JRuby, Jython or Clojure and have a far better programming experience on top of the JVM.
I really see no reason to even consider C# or .NET.
Would whoever modded this down please explain how this is worth modding down instead of writing why you disagree with it?
Saying those things are "far better" is just flamebait. If you're going to write such criticism, it's up to you to justify your statements, not up to other people to defend against a non-existent argument.
EDIT: Stop modding me up, holy shit. This is off-topic and it's not important. Why do you want to highlight this self-evident comment so much that you're giving it a bunch of points? If I could have just messaged jacques instead of posting, I would have done that.
None of this based on objective facts or stuff that you could measure. His truth to me is as good as your truth.
But he got modded in to the ground and you got modded up.
I wouldn't have modded me up, either; in fact, I would have modded me down, because this whole discussion is off-topic and doesn't deserve attention. I think the majority of moderation on here seems awful and is rarely even vaguely proportional to the quality of the comments, and I agree that this is an example of awful moderation. So you're arguing with the wrong fellow.
EDIT: I amended my comment above to be irritating and sarcastic toward people who modded me up.
Classy! My email is in my profile by the way, in case you ever want to take something 'offline'.
That does make sense. When it comes to things like, say, desktop application development, Clojure probably isn't there yet, even though it's backed by all the Java libraries. C# and .NET, on the other hand, were designed with this purpose in mind (among other things). If I had to write a Windows desktop app, I probably would choose C# over Clojure any day, even though I like Clojure better as a language. But, as they say, programming languages don't operate in a vacuum...
The image that got conjured in my mind when reading that post was one of a teenage girl on the phone going, "C#? What. everrrr."
"I really see no reason to even consider C# or .NET."
This looks like an exhibition of the classic blub fallacy.
What? My comment makes sense, even if C# is worse than Python, etc.
"As long as our hypothetical Blub programmer is looking down the power continuum, he knows he's looking down. Languages less powerful than Blub are obviously less powerful, because they're missing some feature he's used to. But when our hypothetical Blub programmer looks in the other direction, up the power continuum, he doesn't realize he's looking up. What he sees are merely weird languages. He probably considers them about equivalent in power to Blub, but with all this other hairy stuff thrown in as well. Blub is good enough for him, because he thinks in Blub."
The "paradox" (or "fallacy", as you called it) here refers to looking at a language that is more powerful, but not realizing that it is. By contrast, when looking at a language that is less powerful, this is usually obvious.
> By contrast, when looking at a language that is less powerful, this is usually obvious.
You mean like how when I look at Python, its deficiencies relative to C# are obvious? Or are you talking about how when you look at C#, its deficiencies relative to Python are obvious? The blub paradox goes both ways.
> he's sounding like a smug dynamic language weenie
I'll give you that. I have a strong opinion on the overall usability of statically-typed languages. I have been writing Java code for the past month and I really feel less productive than the month before, despite the very smart tools that take away most of the drudgery. I am also not anti-static-typing: I like C a lot. I don't like C++ that much because of Smalltalk-induced bias.
> It pulls the "mandated by management" straw man
I am yet to witness a C# project that's not born out of a corporate IT department. I have never seen someone move from dynamic languages to static ones for other reason than execution speed, and, even then, only after careful profiling.
> This looks like an exhibition of the classic blub fallacy.
Name 5 reasons to consider C# as your development language and I'll concede you another point. While you are at it, name 1 area where C# is considered the best language.
No, let's not. How about you keep your condescending attitude offline.
The C# situation with dynamic is analogous. It's for people who like working in a static language, but want a particular piece of code dynamically typed because it happens to be very convenient for the task at hand. Obviously, there are a fair number of such tasks; mostly whenever you're dealing with a piece of structured but unpredictable data that lives outside your static bubble, like XML or external unmanaged libraries.
And var isn't really worth mentioning; it's just very simplistic type inference on declarations. It's just (very good) syntax sugar and doesn't have any special semantic meaning at all.
I think this also has to do with language expectations, express-tivity, and maintainability. A project already using a dynamic language will have some sort method to deal with the nature that certain calls will or will not exist. The addition annotations/conditions seem like optimizations, but doesn't fundamentally change how a programmer would go about using that dynamic language. C#, on the other hand, the language is more constrained to begin with. A (C#) programmer would normally expect certain things such as an interface having a certain number of methods with certain types. Just imagine a library exposing an api with expandos... =p
His answer was basically your concern, that they didn't want to get in the habit of exposing dynamic things all over the place, since they felt it was sort of an unexpected thing to be doing in a language like C#. Hopefully third-party library programmers will be equally judicious.
To illustrate the value of such a thing, I invite you to look at the ADO.NET libraries for data access, which provided a verbose, painful "dynamic property bag" experience as far back as .NET 1.0; you had DataTables with columns that you would pass a type to, and then you had DataRows that you indexed into with strings to put objects in and get them out, and you had to cast them back and forth as you did it -- all of it ugly, none of it checked at compile-time. The value of C# dynamic (besides interop) is that now you can have such a thing in a fairly concise form with syntax that doesn't make you sob uncontrollably when you use it.
It's down to the old "with great power comes great responsibility" idea.