Anders Hejlsberg on C# 3.0
spongman writes "Channel9 has a video of Anders Hejlsberg demoing C# 3.0. The new language enhancements include implicitly typed locals, extension methods, strongly-typed lambda expressions, anonymous types, and LINQ - a builtin SQL-like syntax for data access. The spec, samples and a working compiler can be found on MSDN."
But then, Bill Gates himself said that the only thing wrong with Delphi was that it wasn't a Microsoft product.
whoever modded this as troll never used GWBASIC :D
I did not know he was very instrumental in developing Pascal, a language I was an expert at one in the mid nineties.
... every release. Now is that good or bad?
got angst? it is an update to a open specification for a computer language... for which there is hundreds of thousands of programmers and millions of dollars invested... ...clearly this is not newsworthy
you might ask yourself why mandrake gets an "ad" when dell offers it as an option on 1 laptop model...
So what is C# is Windows only? 90% of all Slashdot readers are Windows users.
Try out fish, the friendly interactive shell.
Can someone explain the point of this? C# is not JavaScript; these aren't true dynamically typed variables, the compiler just assigns a type for you instead of making you do it yourself. I can easily take half a second out of my day to figure out what type a variable should be, and end up with more readable code.
Visual IRC: Fast. Powerful. Free.
Do we really have to have a Slashdot post followed by a flamewar every time a guy at Microsoft opens his mouth?
If you don't fail at least 90 percent of the time, you're not aiming high enough. (Alan Kay)
Migration away from Windows might be a problem, but you can't escape the fact that on Windows, currently and in the future, C# and other .NET languages are The Big Gun. It's too expensive not to use it, because if your competition does, they will be running around you in circles, blowing holes in you. There simply is no product that delivers the same kind of raw productivity.
And the way I see it, the same is about to become true for Mono on Linux, even though they might only currently share a subset which is compatible. C# on Linux with managed bindings (Gtk#, for example) is extremely potent (see Beagle, Diva, F-Spot, etc.).
As the compatible subset becomes larger, there will obviously be an added benefit. The work being done in both camps (MS for innovation and Mono for re-implementation) is, IMHO, very impressive.
You've obviously never heard of Mono...
We're geeks... We're the sorcerers of the modern-day world. --
"Overbloated" is a redundant (overbloated) expression.
The built in SQL like language would be usefull in many languages. It is now just waiting for LINQ version X (for short LINQX) before the confusion starts.
My wife's sketchblog Blob[p]: Gastrono-me
It seems that Microsoft is finally doing something with all the great research they funded. C# is becoming more and more like Lisp and ML, and might well become the first language in recent times that carries the approval of both academics and the industry. .NET as a whole gets many things right; multiple languages that can target the CLR and interoperate, special modifications made to create a friendlier environment for functional languages, registration of the core technologies with an independent standards body, publication of an implementation for multiple platforms, with source code, etc. etc.
.NET doesn't get everything right, but it's amazing how many good things are in there, especially considering that it comes from Microsoft.
Of course,
Please correct me if I got my facts wrong.
For anyone interested in development on Windows, or the possible future direction of Mono, I recommend checking out the PDC Keynote for day 1. The duration is about 3:20, and you'll see demonstrations of the 5219-build of Vista, a lot of Avalon apps, four great architects at Microsoft doing live coding (showcasing LINQ, Indigo (WCF), Avalon (WPF) and Atlas, among other things) and a lot of interesting information about where things are heading.
t es.mspx (Click on the "On-Demand Webcast"-link. High up on the page.)
A lot of it is market-speak and sales, but it is a developer conference. The link can be found here: http://www.microsoft.com/events/executives/billga
What really are the benefits that a developer gets by using C# instead of VB.NET? Either way, it's a vendor and platform lock-in, so there isn't really a portability gain. In terms of performance, the tests that I've read about haven't really shown a major advantage in favor of C#. As for functionality, C# was ahead of VB.NET in .NET 1.x, but in .NET 2.0, VB.NET has closed the gap by also allowing unsigned integers, custom operators etc.
I personally tried both, and I'm much more productive with VB.NET because I get clear keywords such as LOOP and END IF instead of braces. Theoretically, I could add comments to a brace that indicate what type of structure ends at the respective point, but that's a waste of time, and if I modify an algorithm, then the function of those closing braces may change. Also, the VB.NET editor's auto-completion feature is more advanced.
I'd really be interested in knowing other advantages that C# has, which is why I'm asking. So far it seems to me that some may be more familiar with a Java/C-style syntax (in which case I'm wondering why they don't go right for C++ or Java). Another reason may be that some people have this view that "real men don't program in BASIC".
C# is a nice language, but the problem is I just don't trust Microsoft anymore. From a business perspective sticking with Microsoft has proven to be a mistake.
.NET and move on to something else?
I work for a software house in London and we have a large VB6 application that has been built up over many years. VB6 has effectively been dumped by Microsoft, so our application is slowly rotting away. There is absolutely no way we can rewrite it in C# or VB.Net, we just don't have the resources. I suggested that we at least write all new components in C# and use interop, but that turned out to be a real pain, especially when trying to debug.
So what do we do? Spend a fortune rewriting our product in C# while our competitors (who may be using Java) continue to improve their products. And once we have eventually finished the rewrite, will Microsoft just dump
I have to wonder. If there had been a number of VB6 vendors, rather than just Microsoft, they could never have dumped VB6. In that situation we would have all just moved over to another vendor.
Is anyone else here in a similar situation?
I have a whole list of reasons, which have been hashed out millions of times in millions of other forums.
I'll just give you the top reason that I use c#.
In VB.NET, Build and Rebuild are the same thing! If you change one class and do a build, on a large project it can take MINUTES.
The same project and change in c# can take SECONDS to build.
The time savings alone could buy a lot of stuff.
Java's language features, by comparison to C#, seems to be moving along at a glacial pace, only recently getting features like foreach loops, and generics.
I personally prefer Java because of Eclipse, but Sun are really going to have to get a move on if Java is to remain competitive with C#.
Good, obviously. The one reason Ruby and Python (I don't know about Delphi) are so popular is that they're easy to program in. There is no good reason other languages are not so easy to program in*, so when they become more like the easier languages, that's good.
* People often cite performance, but there's no reason a Ruby program couldn't perform comparably to a C program. Yes, Ruby is interpreted, dynamically typed, and all that, but with enough effort, a compiler could be built that optimized away unused dynamism and yielded fast programs.
Please correct me if I got my facts wrong.
This rebuild thing is indeed a good point. My project is pretty big, and that's why I know all too well but you're talking about. I make extensive use of DLL's to minimize the amount that gets recompiled, but obviously it would be nice to be able to reuse object code at the build level.
There simply is no product that delivers the same kind of raw productivity.
... J2EE!
Which is why all large institutions pay big bucks to J2EE developers to develop in-house applications using
It is nice that C# exists, and it has a lot of nice features, but I fail to understand you 'raw productivity' statement. How is C# more productive to code in than, say, Java 5?
I'm not dissing your opinion, I just want to see some solid reasons. I think that the existence of C# is good for everyone as it will drive innovation in Java, and vice versa, but I don't see where it has massive advantages overall.
Mono is good for writing toys but nobody is going to bet the baby on Microsoft not enforcing their IP rights.
You might think C# is moving away from being strongly typed with the new "var" construct, but you would be wrong. All types are still inferred and verified by the compiler.
As IDEs and compilers grow more powerful, I think people will start to realise that strongly typed languages can be just as easy to program in as dynamically typed, and you get the added benefit of more help from the compiler at spotting bugs.
It is nice that C# exists, and it has a lot of nice features, but I fail to understand you 'raw productivity' statement. How is C# more productive to code in than, say, Java 5? I'm not dissing your opinion, I just want to see some solid reasons. I think that the existence of C# is good for everyone as it will drive innovation in Java, and vice versa, but I don't see where it has massive advantages overall.
I do like C# slightly better than Java 5 but that's not the big difference. It's the tools. VS.NET just works really well. I've worked quite a lot with Eclipse and although it's a nice IDE, VS.NET (especially 2005) is lightyears ahead.
so youre saying you would recommend a less appropriate technology for the job simply to satisfy your bias against microsoft?
I'm going to go out on a limb here and state my personal opinion: Java, as a mainstream platform for developing desktop applications has failed.
.NET or Mono for desktop applications.
.NET might have an advantage in developer productivity, but Java wins hands down because of the richness of runtime environments supported. And Java is great, as long as you maintain a nice bufferzone between it and your customers (be it a web-presentation layer or a web-service, etc).
.NET and Mono are going at light speed while C is at a virtual stand-still.
The enterprise isn't everything, and while Java 5 is excellent at creating enterprise applications, it just cannot compete with C# on
Feel free to point at any number of successful Java desktop applications (Eclipse, X-Develop, etc), but they all demonstrate the same thing: Java was never created to play ball with the other kids (I will not speculate whether this is accidental or intentional). This is especially true for Windows, which is the largest target platform for desktop applications. Take a look at how you install Eclipse on Windows, for example. Does it even slightly resemble the rest of the desktop experience?
As a desktop user, I constantly "notice" Java applications, whether during installation or when it's running, because of odd looking UIs, missing runtime environments (which are often painful to get a hold of. Even WinFX-applications have a fairly nice download frontend.). I don't want to "notice" the applications, I just want to run them.
Regarding the enterprise, I think Java is an excellent alternative, just keep it away from the users. I think that currently
It will be fun to see what happens with the enterprise, but I feel that someone needs to take a big step back if they are to stop C#/.NET/Mono from taking the desktop. Saying "I'm just sticking with C, and so should you" is only going to work until the gap becomes large enough. While I personally find the managed environments superior today, noone can argue the speed at which things are progressing. The managed environments,
Writing unmanaged C++ for Windows applications for Vista and beyond is not going to be a good idea; it's going to take a long time compared to the alternatives (C++/CLI, C#, VB.NET), and the result is not going to be better (look at the Avalon-applications from the PDC keynote, which are mainly XAML, and Sparkle which is completely managed; they are the coolest UI-experiences I've ever seen).
Personally, I hate just about every aspect of VB.NET's syntax. Too wordy and inconsistent. 'List (Of Integer)' instead of 'List<int>', 'CType(x, String)' instead of '(string)x', etc.
A more objective advantage is C#'s support for unsafe code. If you need to do high-performance bitmap operations, or pass pointers back and forth to native code, you can't do it in VB.
Also, the yield keyword is simply awesome if you need to implement IEnumerable. In VB, it's a pain to write even one implementation, but with C# 2.0, you can easily make a bunch of enumerable methods on the same class. For example, you could make a collection class that can be used like so:
Visual IRC: Fast. Powerful. Free.
Hmm ... the syntax reminds me of CCL ....
I guess you'd have to be in healthcare IT to know what I mean, though.
random underscore blankspace at ya know hoo dot comedy.
Just like C-hash
As someone who has served as a consultant and written applications in both languages this is what I can add:
.NET is, and will always remain a hack.
My VB apps were much quicker to prototype- to provide something to a customer in helping them determine requirements when they aren't really sure what they need. Also, the VB apps are often easier to maintain (less cryptic code can be easier to maintain).
My C# apps were usually written in that language because the client had a preference for it- not that any logical reason was given (unless you count putting C# in marketing information to justify higher costs). Also, because the lanugage can be more difficult to follow (meaning less likely the client's in-house developers can code or update it) than VB, consultans can often charge a higher hourly rate to code in it.
Both languages build to the same IL output.
Comments such as this one from above a great language for people who don't want to know to much about what thier program is actually doing - but VB
show a real bias whilst not providing any detail whatsoever. So take them with a grain of salt. Unless your reading machine language, you don't really know what your appp is doing.
It is possible to write great code in each. It is also possible to write really bad code in each. It comes down to the developers ability and preferences.
If you have a nice fat contract and want to perch in your ivory tower looking down upon the commoners, go with C#.
If you have demanding clients and need to give yourself some breathing room, go with VB.
Cogito Ergo Sum
Thanks, this is useful information. I will need some unmanaged stuff in my project but it will be OK for me to just have that in a separate DLL, which may then be written in C++ or C#. As for type conversions, there are various keywords like CStr (convert to string) or CInt (convert to integer) that are a shorter alternative to CType(Variable, Type) for at least the most commonly used types.
They keep adding more and more stuff to the language...is there anyone that can really read all of the code that is possible to be written in C#? It sounds like a readability nightmare to me.
Heck, it took me years to learn all of the components in C++, and I'd bet that the specification for the complete language is now much smaller than C#'s. And there's still stuff waiting to be discovered on the level of template meta-programming.
Is all of the stuff they keep adding actually useful? Or is it just being added so that they can give the impression of progress, and maybe convert more people to using it? Granted, I'm excited about C++0x, but unlike what I would be thinking if I used C#, I'm not worried because I trust the standards body to not put completely unnecessary stuff into the language. What do you C# programmers think?
Thanks to some of the brilliant developers at MS, we can get some awesome stuff out of this company, like C#.
.NET down to their sinking ship, Windows.
.NET framework could be freed from Windows, and given the official blessing to target all platforms, including Linux, then Microsoft could set itself up as the supreme tools vendor for the platform. It'd be a bright future for MS, and overnight .NET would probably become the de facto standard for development on Linux!
... the stodgy petrified boys up top will always put Windows first ... to MS's undoing, no doubt.
Now, too bad management will keep on trying to tie
If only the
But no
random underscore blankspace at ya know hoo dot comedy.
Why is parent a troll? Ironically enough it's true.
- Windows using, C# coding slashdot reader.
in about six months, they'll be able to rename C# "perl without the @, or the $"! "P-@$"? They can advertise it as "As powerful as a scripting language, like perl!", and all of the half-intelligent programmers will read that as "Gives you nightmares from trying to read code, just like perl!"
Why, oh why must language inventors continue to add every possible concept to their pet project? Must every language try to be everything to everyone?
No programming language is suited to all applications; anyone who claims omnipotence for their particular language is exhibiting either ignorance or arrogance. A wise programmer knows how to use many tools in appropriate contexts; it's this sort of rational maturity that separates amateurs from professionals. It makes no more sense to develop a web-hosted applet in C++ than it does to write a high-performance batch-processing engine in Java. Using multiple programming languages isn't a simple matter of syntax -- it's a matter of divergent perspectives that force me to think about what I'm developing.
A disturbing trend has emerged in the last decade, with developers trying to make every programming language applicable to every task; we add object-oriented features to COBOL and Fortran, add generic types to Java, and expand the C++ library with a plethora of complex templates. Now C# is "borrowing" all sorts of ideas from all over the map, without any thought for how all these pieces fit together into a cohesive and logical whole.
In the end, we get bloated tools that include features ill-suited to their core design. Instead of focusing on a clear set of goals, languages compete in an edless feature competition that often ignores sound engineering practices.
I have done professional C# programming, and the language does not impress me. Certainly it has some very good ideas -- but it lacks any sense of cohesion in design or intent, and it's ties to Microsoft make me leary of using it for long-term coding projects.
All about me
Lightyears ahead in what way, exactly? I've used them both, as well, and I found that VS.NET was great as long as I wanted to do something Microsoft wanted me to do, and fell right apart as soon as I tried to do things another way - maybe you know the mystical wonders I missed. Care to list a few?
Slashdot - where whining about luck is the new way to make the world you want.
It's much better, runs everywhere and is already used by many big vendors. I strongly recomend Java.
That's nice to hear. Fortune 500 companies are always interested in recommendations by Anonymous Cowards.
I'd argue that Java isn't a major success on the desktop because:
1) AWT sucked totally
2) Swing integrated poorly because of its design. Instead of being a neat interface like WxWindows on top of native user interfaces and layouts, etc (with a Java implementation for unsupported desktops), it did it all itself.
I can only name two mainstream Java desktop applications off the top of my head - Azureus and LimeWire, both of which have slightly dodgy reasons for existing. IIRC they either use SWT or custom interface code anyway. SWT is really the only viable option for writing desktop applications in Java these days. There are probably some other Java applications that use, e.g., KDE or Gnome or Win32 bindings too.
Thing is, the world is moving to web based interfaces. Whether it will be Google's vision, or Mozilla's vision (XUL), or Microsoft's vision (XAML) remains to be seen, but Microsoft have the existing market benefit currently.
I certainly wouldn't start a new Windows application using C or C++ these days, but that is a completely different discussion.
Are you a newbie? That is the whole point of this website.
If you don't want to bash MS, then go to some MScentric site and wax wonderful about their propietary crapola. Some that are on the MS payroll continue to espouse the virtues of MS here (perhaps you?!), but we all enjoy how much time, money and effort MS spends trying to alter the overall message of slashdot.org.
Lesson for MS to learn: FUD doesn't effect a community of a single mind and purpose.
C# will not replace Java. It is a wonderful Java knock-off with a great IDE (Visual Studio), but it is not a Java killer.
End of rant.
/bigweenie
Just ask executives and managers if they want their business chained to whatever Microsoft decides 5-10 years from now.
Once you ask that question, I doubt any executive would select the Microsoft solution.
As an open-source I really hate to say this but...
This is a terrific example of honest-to-god innovation from Microsoft.
Yes, I know, the building blocks have been available in some form or another in many other platforms. But so far nobody has managed to bring all of this together so elegantly.
The features are not just a random heap of syntactic sugar. They combine to create the query syntax (using lambdas) which can be either executed directly in C# (with the help of external methods) or be available as a runtime data structure (shades of lisp) that can be translated dynamically to an SQL or XQuery and sent to a remote server for execution. The type inference ensures that the query syntax is not littered by type declarations yet remains typesafe.
Nice work, Anders. I guess the Comega team deserves much of the credit, but I have the feeling it was Anders who brought it all together into a clean and not too "academically smelling" framework.
Stop worrying about the risks of nuclear power and start worrying about the risks of not using nuclear power.
As far as I see, .NET is a 'program with whatever you want' system. All the languages are being brought up to the same level so that people who are more experienced that C or Java can use C++ or C#, while VB programmers can use VB.NET (if they're not too lazy to re-learn the language)
The reason one might not go to C++ or Java is:
C++ has a little bit more tricky syntax than C# (as one book I have says: "C# is a language of few words") -- there are many fewer keywords in C# than C++
Java may not deliver the same functionality that a programmer needs, or maybe they're forced in some circumstance to use Visual Studio...
BTW, the only language I've ever seen (course not that I've seen them all) with END IF is Visual Basic...
~Ilyanep
To get message, take amount of carrier pigeons at each stage mod 2. Then decode binary.
"working compiler can be found on MSDN"
This means the other compilers AREN'T working.
I browse slashdot using windows from work 5 days a week yet I'm not the windows user, my company is. How many windows sufferers like me are there in your 90%?
Do you actually have any solid information to support your claims here, or are you just expressing your personal opinion as fact?
Almost all of the posters objecting to type inferencing here quote examples like your
as an illustration of how code is less readable without a type. Guess what? Code isn't very readable if you call your functions SomeFunction anyway, and writing or really doesn't help.On the other hand, if your functions and variables have meaningful names, you probably don't care whether the value returned is a float or a double most of the time. Type inference makes your code more generic, without losing any particularly useful information (if it is useful, you can still specify it), and the type safety of the system prevents the sort of
errors typical in languages like C.In other words, I see a lot of scare-mongering in this thread, but very little evidence that it's justified, other then people saying, "It's unfamiliar and I don't like it". Do you have anything more for us?
If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
The main advantage is that C# lets microsoft charge royalties at some point in the future when the language specification has been widely adopted.
The (very) good part is that the syntax gets formalized. But the idea itself is old - anybody remember those basic simulation jobs where a ship goes from one harbour to another. The cargo changes, the crew changes, lines in/out, etc. but the base (the ship) was same. No need to code that, just change the properties and no need to know beforehand what for ex. the cargo is. Now - think a message in computer system, starts plain but the payload gets compressed, encrypted, enhanced, some pictures added, and so on - fail the delivery, no need to any clean up or rebuild, just take the base and in retry send it to the same route. Huge savings in coding, no need to hardcode properties, properties can change dynamically at any time, even the destination can change with no coding, etc.. And yes - old idea and coded many times over but this is the first time this type of higher abstraction in language itself. I have seen it done in assembler, Simula, LISP, Prolog, Delphi, C, PL/I, etc.. but always differently.
Yet more evidence that C# is designed by monkeys. Add as much garbage to the language as possible to attempt to appease every programmer's wank fantasy. Ultimately you'll please no-one.
BTW Still waiting for GOTO Line Numbers to be added.
By .NET 2.0, C# and VB.Net are really just two different syntaxes for the same semantics. So feel free to use whichever is more convenient to you.
What gives Microsoft the right to unilaterally update the ECMA C# standard? Unless the whole ECMA standard thing was just a farce all along.
Perhaps. But then again, Java evolved very fast in its first few years, and a lot of what it evolved was crap, particularly the numerous poorly-considered additions to the library that now have to be supported pretty much forever. Policies on language features were made on evangelical grounds -- "We don't need templates!" springs to mind -- and a decade or so later, people are eating their words (as more conservative/deep-thinking programming communities have been telling them they would all along).
There is a lot of merit to stability in programming languages that are used by real people for real jobs. Some languages go too slowly, IMHO: I think C++ is drifting off into specialist worlds with a single really active supporter at the expense of useful mainstream stuff with no champion, but that's more a result of the way the standards committees are set up than anything else. Likewise, Perl 6 is becoming almost a completely different language, which is no longer recognisable as an evolution of Perl 5. But at least there's time for people to keep up, and in the meantime, everyone's able to use a solid baseline in C++03/Perl5 for real work.
These developments in a mainstream language like C# have potential to bring useful programming techniques into the mainstream, for the first time in some cases. Still, when most of the C# world is still exploring version 2, I can't help feeling that they'll either lose support or develop a community full of keen but under-informed developers producing naff code because they didn't have time to learn everything at once. Sometimes exciting isn't the best thing.
If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
If your C# code ever becomes reasonably readable or maintainable, you can easily be replaced.
Theoretically, I could add comments to a brace that indicate what type of structure ends at the respective point, but that's a waste of time, and if I modify an algorithm, then the function of those closing braces may change.
Why would you need such a thing?
Reading your comments, my first reaction is that if you don't know which blocks end where, your blocks are too big. Whenever I start wondering which closing brace is which, it's time to do an Extract Method refactoring.
The ultimate goal of Microsoft.
/ sf/default.aspx
http://lab.msdn.microsoft.com/teamsystem/workshop
The latest Visual Studio and chapter 16 of "Software Factories: Assembling applications with patterns, models, frameworks, and tools" reenforce this.
As a company, they have become used to rapid revenue growth. They have sustained this, in the past, by increasing their customer base. In the future, it is very likely that they will try to maintain revenue growth in two ways. The first is by expanding into application packages at the expense of the VARs. The other is by milking those clients that have no alternative to continued use of their products.
To avoid the risk (IMHO the likelihood) of huge future costs, it is essential to retain a credible threat of moving away from Microsoft.
I think VB.NET is very underrated. It's superbly designed, with considerations for normal human beings :)
.NET and Mono, such as boo. See also nemerle, which is more similar to C#.
It's much easier to learn than C#. But of course if you already know java or C++, C# will be easy to learn too.
That said, if you want to do any cross-platform development, VB.NET is a good bit behind C#. See the mono project and mbas.
Also a limitation of both is that you can't change anything you don't like. Microsoft decides everything for you. I'm leaning to open source programming languages for
* type names can get long, especialy when templates are used
* why do you want to do the compiler's work
* editor with intelisense will tell you the type for the expression in most cases so no need to repeat it
* you do not need to modify so much places if type changes during development
* and if you really want you can get the exact type, but mostly it is just waste of time
AFAIK, they are going to add this to C++ too
PASCAL:
program demo3;
var x:byte;
begin
x:=5;
if x=5 then
writeln('It is 5') (*no ; here*)
else
writeln(It isn''t');
writeln('So there.');
end.
The examples above (var i = 5, etc.) are pretty simple and I agree, not particularly useful.
l es/projection/default.aspx#anonymous1. Here's one:
The place where var is useful is when you're writing LINQ code. When you're writing LINQ statements you are effectively building objects on the fly. You don't know what the object will look like when you write the LINQ statement, but you also want to make sure that once it's assigned it's fixed to that type and you get the benefits of it being "strong" through the rest of your code.
There are tons of examples of this over at http://msdn.microsoft.com/vcsharp/future/linqsamp
public void Linq10() {
int[] numbers = { 5, 4, 1, 3, 9, 8, 6, 7, 2, 0 };
string[] strings = { "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine" };
var digitOddEvens =
from n in numbers
select new {Digit = strings[n], Even = (n % 2 == 0)};
foreach (var d in digitOddEvens) {
Console.WriteLine("The digit {0} is {1}.", d.Digit, d.Even ? "even" : "odd");
}
}
Neil
Okay I concede that point then...
~Ilyanep
To get message, take amount of carrier pigeons at each stage mod 2. Then decode binary.
The problem is that MS strongly ties the language with the IDE.
That is, whenever C# (or Visual [anything] for that matter) gets new features, we have to buy a new version of Visual Studio to take advantage of it.
For every developer that may work on a project that will use these new features (and our developers tend to move around).
I have run into several annoying bugs and limitations in the
Now C# 3.0 comes along. Will we have to upgrade to VS 200x yet again?
With these forced upgrades, MS has effectively implemented a subscription model for their software.
Shut up, You know Penguins fly, dont you?
Basic, Pascal, C, C+, C++, Objective C, Java, Small Talk, (endless variations of "talk"), etc,etc,etc.
When will someone finally say enough? When can I stop learning the latest re-arrangment of the same damn languages? Has anyone really come up with something New?
When Fascism comes to America, it will call itself Anti-Fascism, and tell you to give up your guns.
Slashdot is over, you're welcome to it...
But seriously, nothing is too complex to rewrite. First find the best language (e.g, maybe you need Prolog or Lisp because the app has rules) then rewrite it.
I sumbitted news reguarding C# 3.0 announcements on tuesday when it first happened, but my story was immediately rejected. Slashdot desperately needs a meta moderation system for story submission to enable wiki-like corrections in the story summaries for a short period before the story goes live and to look out for moderation abuses such as suppressing stories that lack an anti-Microsoft spin.
.NET 2005 and the .NET 2.0 run-time not even out of beta, Microsoft has released the C# Version 3.0 Specification (doc format) at their Professional Developers Conference 2005. New features include SQL-like and XQuery-like query expressions, implicit (on initialization) typing, lambda expressions and more. The primary focus of the language extensions are encompassed by The LINQ Project which aims to bridge the gap between the object-oriented and relational worlds in a simple and type-safe way.
Here is the original submission:
With Visual Studio
My feeling is that is is a bunch of extra crap that will never be tought or if they are taught will be tought incorrectly. A very large number of prorammers don't even know WTF a lambda is. They have never needed it.
.cs file requires 'multi-file assemblies'. (Some sort of weird psudeo-library system.)
I swear, I have been told that to have a program with more than one
Any sufficiently complicated C or Fortran program contains an ad-hoc, informally-specified bug-ridden slow implementation of half of Common Lisp.
These changes to C# bring it closer to Common Lisp, and therefore make it easier to include those ad hoc implementations of it.
So, in wrap up, how far does this take us to the Brooks' "Magic Bullet" for programming? Does further tying data structure into code still provide the clean separation between code and data required by good design? Can I prevent my data definitions from proliferating all through my source base so when the DBA re-does the database I'm not stuck with obsolete and broken applications?
And can I do stored procedures and give up SQL entirely or will DBA's need to learn both SQL and a new .NET language in addition to all their existing admin tools?
Can I use Reflection to inquire of the structure of the data and generate code to manage the database? Or are the older solutions still the best for this?
In what other ways will SQL-server and .NET become more tightly integrated? And when will the both become part of the Operating System like IE, with all the attending benefits?
I see the polymorphism angle (XML/Databases/Arrays) but is there a way to inherit data definitions? To subclass them?
And when will the WMI, the Windows hierarchy in a GUI application, the programs own class hierarchy through Reflection, and the HTML-DOM be accessible through these new interfaces, or have I just run aground on the shoals of logic and imagination? A bridge too far? How about the files in a directory, or is that just WMI again?
What tools and hacks will be need to deal with volatile (externally modified) dynamic data? SQL-server has some of it's own but coders still need to specify read-with-lock from read-without-lock. All the other data except for arrays and some XML is volatile (subject to modification by other threads or CPU's). Different data sources have different volatility models (db's, WMI, processes running on the OS, nodes on the net).
I18N == Intergalacticization
Here's a simple one: Developer moral. I've been writing ASP.Net with C# since Beta 1. Most of the developers I've had on my teams are happy to be writing in C# instead of VB.Net. It feels more like a "real" language, so they feel more like "real" devleopers.
Of course, Macromedia built ColdFusion to output Java bytecode. Add the proper libs, and it runs on any high-performance Java system, including J2EE systems... where all the performance optimization work is already being done. They just piggyback on top of it.
Any sect, cult, or religion will legislate its creed into law if it acquires the political power to do so.
I think there's a lot of truth in what you wrote there. That said, while specialist languages have their place, I'm increasingly wondering why no-one has yet produced the next great general purpose language.
Why can't we have a simple, elegant syntax like much of Haskell or Python, with punctuation frenzies reserved for things like regular expressions and printf formats where history shows they work well? Why can't we have a grammar that's amenable to parsing by automated tools, to make it easy for IDEs to provide refactoring aids, consistent formatting, etc? Why can't I have an imperative language that still supports higher-order functions and the like? Why can't I have proper disjunctive types and pattern matching in a language that supports OO with RTTI/reflection capabilities anyway?
I don't do professional compiler design, but I'm fairly familiar with the theory, and none of this seems to be prohibitively difficult. Indeed, most of it has been done in some form or other, somewhere. I just don't see why none of the places that invests so much in programming languages has managed to produce something like this yet. If they did, I don't see any reason we couldn't have a language suitable for a wide variety of applications, offering a clean, powerful syntax, yet still generating code that performs at a comparable speed to that from a low level language.
The technology seems to exist, it's just the language that (bizarrely) doesn't yet. We seem to be stuck in a rut where the only languages that are willing to risk major departures from common syntactic conventions and tool sets are new scripting languages and academic research, and so far each of them has had some significant drawbacks when it comes to industrial-strength, large-scale projects.
If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
Java innovates but in a different area. There is a lot of emphasis on extending Java with Aspect Oriented Programming (AOP).
.NET as well.
AspectJ is not part of the Java language. There are many AOP solutions for
There is no longer anything that can be done with computers that is nontrivial and clearly legal. -- Paul Phillips
And why do they always save the hardest-to-implement (and most necessary) features for "later versions"? I'm speaking here of transaction processing and the true ACID properties of databases. No one in their right mind would use an enterprise database without these features, and they aren't in LINQ.
With Vista requiring a PC with 2 GByte of DDR3 SDRAM and a graphics card with at least 256 MByte memory, I expect Microsoft's stock to plummet in a manner akin to IBM's after release of the PS/2. Microsoft was the last to enter the dot-com market and will be the last dot-com to fall; until that happens the dot-com correction isn't over.
Well, both languages are more or less functionally equivelent. The C# is basically modeled after the CLR (or is it vice versa? I don't know), and most closely reflects the core CLR architecture. This makes it *slightly* more efficient than VB in some cases.
My experience is that VB is a little easier to learn, and provides some nice syntactical sugar (such as the Left/Mid/Right stuff) that C# doesn't (the functionality is still there, it's just not a nice keyword). C# has some nice things like the using keyword to help with resource management.
I find that people that come from VB are most comfortable with VB.NET, and those coming from C++ and Java are most comfortable with C#. The years gone stigma of VB is still there for these people, and many of them can't bring themselves to give VB.NET much respect (even though it's a fully first class language now).
Another thing to keep in mind is availability of talent. There are more VB programmers out there than C++ and Java programmers combined. If your code needs to be maintainable by any monkey they hire down the road, VB may be a better choice.
C# is more "efficient" to program in. It uses fewer words, is more compact, and doesn't waste the programmers time. VB.NET is easier to read, helpful, hand holding (not really, but to some degree), and warm and fuzzy.
It's all about style, attitude, experience, and familiarity.
If you need web hosting, you could do worse than here
SQL-server 2005 can use C# for stored procedures. I know Vista will ship with WinFX, which is basically a bunch of
Anything that can be enumerated can be queried, so regarding WMI, my guess is that it is fairly simple to apply. The PDC-keynote uses an enmeration of processes on the system as a starting point. If the data is non-linear, it is a fairly simple thing to implement the interface LINQ uses to query the data, so you can make sure the semantics are correct.
That makes files in a directory incredibly simple to work with using LINQ, actually a lot simpler than manually foreach'ing. If you look at the PDC keynote video, you'll get info that is immediately applicable to the file system too.
Regarding volatile data, I'm not sure. We've all seen a foreach-loop throw when the collection being iterated is modified, but what the future holds I do not know. My guess is that it will not be up to LINQ whether or not it works; querying and iterating a database datasource doesn't care if data is modified, some local datacollections do. I guess the simplest and best would be just to let it be up to the underlying source and callee to handle it.
Have you ever been to a turkish prison?
Rather than allowing C# to evolve naturally, Microsoft is hoping that they can get people to buy into its intelligent design
Seriously, I've never seen anyone try to evolve a production language this quickly. They're throwing in features left and right. It's exciting! But it's also terrifying: I feel like C# is being driven at breakneck speed towards, err... I don't think Microsoft actually HAS any ultimate goal in mind for C#, as long as they can cover a lot of ground getting there.
And if you drive this fast, eventually you're going to crash, and when C# does, it will fragment into dozens of small shiny sublanguages. People will carve out their C# comfort zones containing the features they feel comfortable with and exclude the rest. Two C# programmers will no longer always speak the same "dialect," making it difficult understand each others' code.
The fact that there's a great deal of overlap among C#'s features only makes this worse. Programmer A's heavy use of generics and lambda expressions will be unfamiliar to programmer B, who never bothered to learn those features since he can accomplish the same things using implicit typing and LINQ.
And, needless to say, differing levels of compiler support will also exacerbate this problem.
I'm surprised Microsoft isn't more careful, given the cautionary example of C++. C++ is in the later stages of this disease. Large projects have to specify the C++ sublanguage dialect that they're using. And we aren't talking simple style guidelines, but the excision of large chunks of features, like RTTI and exceptions. If C# continues the way it's going, it will wind up like this.
ding! That was the sound of me reaching my metaphor limit of three per post. I guess I better end this. So to sum up:
Microsoft, you are the largest software developer and in control of the OS and development tools. You are in the unique position of being able to dictate every aspect of a new programming language. It will be used for years to come by millions of developers in all different situations. This is a blessing and a tremendous opportunity.
Don't fuck it up.
(please?)
I wonder if Sun will play the copying game as they did with Java 5 after C# came out.
I've argued that Sun might want to quietly start researching what's next after Java. I know about Fortress, but to me the description came off as more of a new distributed Fortran than a general purpose language - maybe I'm wrong there.
So Dolphin (7.0) VM is supposed to address some issues regarding dynamic languages. If I can play armchair quarterback, I would go ahead and come up with an "agile" language of their own (along with Java) and release that with dolphin (2008 or so?). Sun probably won't adopt groovy or any other open source project because of NIVH syndrome, and it doesn't have to be dynamically typed or anything, but look at languages like Python and Ruby and understand why people like those languages.
The reason I bring this up is because continually playing the catchup game with Microsoft seems to be a losing proposition. Microsoft never had the same philosophy of a dumbed-down C++ like Java did. And corporate has always liked the idea of a dumbed-down language where the programmer is an interchangeable cog.
I guess what I'm really saying is that I just see Java going into COBOL-legacy mode fast because it seems to really be a niche, server language already. Maybe it's time to start talking about what comes after Java
Can you explain to me what C# now has that Common Lisp doesn't? This is not a troll or flame, I am curious.
You apparently haven't used VS 2005 yet. It really does address nearly all of those issues. Things like tool palettes now work in both code and design modes. The design mode no longer rewrites your code. For ASP projects, you no longer have "project" files, and it no longer compiles to a big dll.
The productivity improvements in 2005 are monstrous, and it's damn good IDE even if you tend to spend all your time in code view now.
If you need web hosting, you could do worse than here
How so? In what way? Can you answer the question or are you too busy staying on message?
Is the language or tool going to stop working tomorrow?
Are the programs you write suddenly not going to work on Windows?
Then keep writing in VB6!
My Journal
Well, I get it now. I checked out the pictures, and now I see why VS.NET 2005 is the greatest of all.
Slashdot - where whining about luck is the new way to make the world you want.
You're going to have be more specific. I gave examples of how the IDE no longer interferes with you doing things the way you want to.
= 0503061 for an example
The original message was very vague about what specifically he had problems with, and I commented on a few things off the top of my head.
If you mean "How is it more productive", then just watch any of the demos over at Channel 9 for examples. Things like context sensitive intellisense in the HTML editor (ie, it will only show you valid items within a given block), the amazingly cool visualization capable debugger with datatips (yeah, I know that sounds like marketing bullshit, but they really are cool). See http://www.code-magazine.com/Article.aspx?quickid
Honestly, if you just *USE* it for a few hours, you'll be amazed. And you can download it for free too.
If you need web hosting, you could do worse than here
That doesn't matter. I've been saying java is slow and getting modded down as troll for years.
I am trolling
Java is actually moving ahead at a goodly clip - it's just that most of the work is in libraries and extensions instead of the core language.
.Net, which is still working to port all of the really good Java tools as quickly as they can.
For examples, check out Groovy, or Hibernate (complete with its own HQL for querying objecs) or Tapestry.
I would still say the Java velocity is substantially higher than
"There is more worth loving than we have strength to love." - Brian Jay Stanley
I'd actually say that it looks like it's taking a lot of Boo's features. The inferrence, the lambdas, there's only 2 features that Boo doesn't have, and they'll be taken care of within a month.
http://boo.codehaus.org/
i ported a medium sized vb6 app to vb.net in a week... it really wasnt a big deal at all.
VB.NET/C# are choices. Choices for developers, for IT departments, for commercial software companies. In the WinDNA days, you could have really expert, expensive C++ folks cranking out the critical parts of your product and a bunch of less-qualified VB devs writing features to spec and it all came together using COM as a binary-level glue. Microsoft gives you the same option today, albeit VB is less crippled now. There will always be differentiating features (VB is less verbose, C# has more 'power' syntax) to keep them apart.
It's all just choice.
Web2.0: I love when people Flickr my cuil and digg my boingboing until my google is reddit and I start to yahoo
Imagine if you took everything you knew about C, C++ and Java and fixed it. What would you have? You would have 'D'. A completely underrated language that follows on in the tradition of C/C++ non-vendor specific languages.
If you want to work like a sharecropper, keep expressing your algorithms and developing your projects in Microsoft proprietary language. If you want portability and something better than C++, check out D here.
There's just so much new crazy stuff in C# 3.0 compared to 1.0. A lot of the features seem like cool ideas, at first glance, but I think I'd get annoyed after awhile with the versatility.
For me, C# 1.0 was a more perfect version of C++. Now it's just getting weird. I'd say Microsoft is trying to push a new programming paradigm into the mainstream by introducing these functional language features.
Having too many easy methods of doing something in a language makes a programmer less effective.
For example, 40 different ways to create an array/collection is just going to slow a programmer down, trying to find the best way of doing something. Maybe some programmers don't care and pick one regardless of its merits, but when I'm faced with several ways to go about something that all seem equally appealing, I get writer's block.
That's why I like C and PHP3. The languages are somewhat inherently limited, so they don't make you go nuts trying to find the best solution. In PHP you only have one real way to store arrays - a hash. In C, you don't have to worry about defining class interfaces and making them comprehensive and perfect because there are no classes.
You have several ways of using pre-written methods in C# 3.0, which is completely amazing.. until you have to write your own method and decide whether you want it to be an Extension Method or inside an Interface/abstract class/class, and then static or instance, virtual or abstract, property or get/set, etc etc. Other languages implicitly restrict you to only a couple options.
I like having a language that dictates its own coding conventions so that I don't have to figure out which way of doing something is 'more correct'. Maybe I'm nuts. Don't get me wrong, I love C#, but adding more flexibility will drive me up the wall.
Buckle your ROFL belt, we're in for some LOLs.
How do you call a lambda expression? I'm familiar with anonymous methods in delegates, but I don't understand how c => c.City == "London" for a parameter, which returns a bool, is easier than just saying (c.City == "London"), which also returns a bool. In the first case, "c" would only be used once, so what's the point? Thanks in advance, Alek
std::map>::iterator i = mymap[j].begin();
or
var i = mymap[j].begin;
autopr0n is like, down and stuff.
well, technically its not an 'end if', just an end =)
has no real advantages over '}'
Perhaps. The alternative outcome is that whatever industry you work in finds that the UI stuff is only a small part of the application, for the bulk of it current practices using $OTHER_LANGUAGE work just fine, and this emperor has no clothes. Saying "C# and .Net will bring massive productivity benefits" is only going to work until the gaps have failed to materialise for long enough, too.
In reality, of course, there are few absolutes and most projects will appear somewhere on the sliding scale. For smart dev teams, the choice of whether to invest in C# and .Net will depend on where on the scale they fall.
If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
Well, maybe it is this week. My experience has been that applications trying to do this bring little benefit and a lot of drawbacks over old-fashioned desktop apps. Why does my word processor/development environment/mathematical modelling framework/computer game need to use a web-based interface?
The claimed advantages are mostly marketing hype from companies who are investing (perhaps unwisely) in this technology. The rest of the world will carry on making programs that work for as long as they make money (commercial) or make the programmers feel good (various free software/OSS/shareware things).
If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
I am curious as to why you might think that Python and Ruby aren't suitable for a big business application though. They may be uncommon in enterprise environments, but that doesn't necessarily mean that they aren't suitable for the job.
DLINQ wraps LINQ which wraps ADO which wraps ODBC which wraps core MSSQL api. Then write DCOM wrapper around whole program. Then make ActiveX control. Then reference from Excel VBA. Wheeeee!
Hey, I'm just your average shit and piss factory.
Languages don't really matter anymore. Java as a language isn't important, as much as Java and its innumerable APIs are. Which is why Ruby, Python, and PHP all write wrappers to the Java core API so that their languages all can do something useful. So all these features in C# aren't anything special. People don't really care about java's new language features, they just care about new APIs.
Hey, I'm just your average shit and piss factory.
I didn't see that, but I assumed MS wouldn't be so stupid to do that. No transactions? Have fun folks.
Hey, I'm just your average shit and piss factory.
Still has a meaning...
Hey, I'm just your average shit and piss factory.
Decades ago, this was THE language that was going to be all things to all people. Where is it today? Any language that has too many features in its core design will ultimately fail the test of time.
Funnily enough, most database binding libraries in Ruby seem to work exactly like that.
The way I see it, a language which pretends to be statically typed (as Java and C# do) should stick to being statically typed. If developers wanted to use a dynamically-typed language they would use one, rather than perverting another language which doesn't quite fit the programming paradigm.
It also seems to me that this battle between Java and C# is mainly to distract people away from languages like Ruby which really are a step forward instead of just an evolution on top of something else.
Karma: It's all a bunch of tree-huggin' hippy crap!
Actually, C# source doesn't resemble IL at all. The CLR is effectively a RPL engine -- if you've spent any time programming SysRPL on an HP48 or the like, you'll find it relatively easy to read.
So the purpose of the compiler is to find the most effective (and safe) way of expressing foo language into RPL, and then spooling it out with metadata. You can do this yourself, using either CodeDOM or (in 2.0) Lightweight Code Generation -- the same technique IronPython uses to achieve a compiled, strongly-typed, dynamically-typed language.
LINQ is basically list comprehensions over arbitrary objects with a sequence interface. That's actually not new either--both CommonLisp and Python have had similar constructs.
The Mono project gives you all the good stuff from .NET (the language, the core libraries), plus all the good stuff from Linux and open source (Gnome, Gtk+, other standard libraries), while avoiding all the bad Microsoft stuff (XP, Windows APIs, Windows libraries, etc.).
.NET may well become the de-facto standard for development on Linux.
So,
C# will not replace Java. It is a wonderful Java knock-off with a great IDE (Visual Studio), but it is not a Java killer.
Java is doomed whether or not C# will replace it: except for a few specialized niches, Java has failed to become a factor in mainstream software development.
http://msdn.microsoft.com/vcsharp/future/linqsamp
was this:
GroupBy - Simple 1
This sample partitions an array of numbers into groups according to the number's remainder when divided by 5. the sample uses group by to create the groups of numbers and select to create an anonymous type consisting of the remainder value and the group of numbers with this remainder.
public void Linq40() {
int[] numbers = { 5, 4, 1, 3, 9, 8, 6, 7, 2, 0 };
var numberGroups =
from n in numbers
group n by n % 5 into g
select new {Remainder = g.Key, Numbers = g.Group};
foreach (var g in numberGroups) {
Console.WriteLine("Numbers with a remainder of {0} when divided by 5:", g.Remainder);
foreach (var n in g.Numbers) {
Console.WriteLine(n);
}
}
}
Well, in C this would be something like this: