C# In-Depth
Bergkamp10 from ComputerWorld writes "Microsoft's leader of C# development, writer of the Turbo Pascal system, and lead architect on the Delphi language, Anders Hejlsberg, reveals all there is to know on the history, inspiration, uses and future direction of one of computer programming's most widely used languages — C#. Hejlsberg also offers some insight into the upcoming version of C# (C#4) and the new language F#, as well as what lies ahead in the world of functional programming."
Why must they make me trawl through 8 pages of ads?
Give a man a fire and he's warm for a day. Light a man on fire and he's warm for the rest of his life. - Terry Pratchett
I beg you to use this link instead of flipping thru all 8 pages
All the latest news on Microsoft's slightly altered and nonstandard and proprietary version of the c++ language. Oh goody.
I am a sad case and find much amusement in the fact that the "correct" name for the # symbol is octothorpe, which means "C#" should not be pronounced "C-sharp" but Coctothorpe.
Imagine my joy on discovering that they've scoured the alphabet and have managed to find a new initial letter that makes an even funnier name.
Ladies and gentlemen, let us welcome the new language, F# or Foctothorpe.
Could it be that C# is one of the most widely used simply because of the installed base of windoze machines all over the world and not because of any technical merit? Most current languages have compilers and interpreters that run on windoze; what makes people choose C# over the others? Just how much impact has C# had on computing sciences as a whole, anyway?
Talk about softballs, some of us would like the answers to these questions:
(1) How much did Microsoft have to pay you to switch from the side of the angels to their side?
(2) Who decided to make C# just enough like Java to fragment and muddle the whole programming scene?
(3) How can you consider C# to be a success when Microsoft tried using it to replace large parts of Windows and ended up throwing the whole mess away?
>>one of computer programming's most widely used languages.
I highly doubt that a language that has only been around for a few years is the most "widely" used computer language. Cobol, fortran, or standard C , maybe.
Really? Is that actually true? I thought it was still relatively obscure. I'm not sure I've ever even met more then a handful of people who have done any real work with it. Am I just totally out of the loop? Has C# truly surpassed C, C++ and Java?
They should really have called the successor E#
Today's weirdness is tomorrow's reason why. -- Hunter S. Thompson
"Microsoft's leader of C# development, writer of the Turbo Pascal system, and lead architect on the Delphi language..."
Well, that explains everything. Turbo Pascal was the source of endless problems on the PC, and not just because it was really "Turbo Something Kind Of Like Pascal". It seemed like 90% of the time when I came across a badly behaved application that ignored command line redirects because it went straight to the BIOS just to write its copyright banner, and wouldn't run on anything but a perfect clone, or wouldn't run under DoubleDOS, or (later) required the most stringent DOS emulation under Windows, it was in Turbo Pascal.
Why anyone thought that was a good thing to happen by default, I don't know, but it drove me bonkers. No wonder C# and .NET is its own little universe that only deals with other software at the end of a ten foot pole.
wasn't vista being written in C# + .net for 2.5 yeats before they gave up and went back to C++ ?
if thats the case , why the hell would anyone want to use a platform that M$ can't use themselves ?
More like Java. Plus has has been pointed out time and again. The CLR is a standard.
I think C# is one of the better languages I have used. I think M$ has done a good job (as they usually do) of stealing the concept and making it easier for the user (in this case, developer). I do understand that as far as M$ is concerned, it is only meant for Windows. However, that does not diminish the fact that it is a good language. I have friend who work solely on Java. Their target deployment servers are linux. But they do all their development on Windows.
C, C++, Java, javascript, python, perl and PHP are widely used languages. Pascal was an also ran back in the day, C# is the modern day equivelent of visual basic and unlikely to gain serious traction outside Windows development. The world wasn't exactly crying out for a Java clone.
The Roctothorpe!
*insert headbanging graphic here*
and a very nice language it is too! (coming from someone who pays the bills using it) I've still got a soft spot for c++ but I haven't had to use it in an age, and probably wouldn't unless I needed absolute technical control over a project, for perf reasons.
According to this: http://www.langpop.com/ , C# is only the 9th most popular language, only competing with scripting languages.
It comes nowhere close to the more popular programming languages in terms of usage.
while(1) attack(People.Sandy);
Like Silverlight? http://raghuonflex.wordpress.com/2008/09/23/silverlight-app-uses-flash-to-work/
Every time I start to have faith in humanity, I ruin it by driving to work between 7 and 8 am.
I'm a little surprised at the ease to attack C# but not much. It actually does a few of the things that C++ folk would like over Java, but I can understand the comparisons with Java.
Anyways, I've been fooling around with it for a while via an O'Reilly book and so far it's not too bad. That said, I don't see it much use beyond the Windows .Net Framework. Then again, that's all employers seem to want to see on the resume nowadays when it comes to development. And who can blame them?
I do have a cause for concern though....
The fact it feels like he's faking the enthusiasm, as he did for most of this dumb interview, is slightly scary. The followup question confirms that
Lastly...
It is possible to build alternate implementations. We are not building .NET for Linux, because the value proposition that we can deliver to our customers is a complete unified and thoroughly tested package, from the OS framework to databases to Web servers etc.
Ummm....just because it's possible to build an alternate implementation doesn't mean it will work the same way. It would absolutely kill me to use a language that implements two things differently because MS wants to hold back special class $VERY_IMPORTANT_FUNCTION that is the paramount to the language, such as database or socket connectivity.
I seriously hope that Java being opened helps chop block this. With open code, my hope is more places will buy into the language, showing MS that a "industrial-strength" language can be free.
import system.cool.Sig;
I'm just curious how C# is said - anyone?
Thanks!
Be careful of your thoughts; they could become words at any minute...
There was a DARPA challenge not too long ago for a team to build a self guided vehicle. Roboticly automated to avoid obstacles, readjust heading, etc. Carnagie Melon won the competition. One of the loosing teams had a vehicle that would just loose its instructions and drive off in a straight line forcing the team to hit the kill switch. After a month or so of line by line code inspection the team discovered that the C# code they used had inherent memory leaks and the problem was not repairable.
We use history to look back on our mistakes and choose an educated path toward the future. That being said when is microsoft going to fix the problems with its existing offerings instead of pulling the wool over our eyes in advertising the next updated solution. ie internet explorer 6 -> 7, vista -> NT7 and ..... oh yeah everything they sell.
I think that one of the most interesting developments of C# and most mainstream programming languages is that they keep borrowing long-established elements of functional programming.
All and all this is a positive development. The only irritating aspect about it is the number of Microsofties who think M$ is inventing new stuff and being "innovative(TM)". A good example of this is F#: while the language is basically an adaptation of Ocaml to the .NET environment (to the point that simple programs are indistinguishable), I've seen plenty of people touting F# as the best thing since sliced bread, but completely failing to mention its roots, or the fact that Ocaml is a well-established language with a long history, and perhaps the most successfull (in terms of actual usage in the industry) of functional programming languages.
(Though I give credit to the interviewee in this particular article for being an exception to this rule, and for acknowledging F#'s pedigree).
Incidentally, this has long been a burning question for me: why is a language like Ocaml ignored to such an extent within the mainstream open-source community? It already has a small but vibrant community, excellent coverage in terms of libraries, performance comparable to C++, and the safety and cleanness that comes with functional programming. I even see Linux people excited with F#, seemingly oblivious to the fact that we *already* have a language better than F# that runs natively under Linux!
(Note: I consider Ocaml to be superior to F# because in the process of transforming Ocaml into F#, Microsoft removed two of the most interesting and powerful features of Ocaml: functors and polymorphic variants)
For anyone interested in programming in C# but don't know any good reasons to actually get into it, I give you one: http://www.runuo.com/ - You're welcome. =)
I use Windows... like a two dollar wh.. why don't I just go ahead and not finish that sentence.
> one of computer programming's most widely used languages -- C#
Any link to back this ?
(no, I didn't RTFA)
Votez ecolo : Chiez dans l'urne !
A quick search yielded this site:
http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html
After a month or so of line by line code inspection the team discovered that the C# code they used had inherent memory leaks and the problem was not repairable
Actually, they did fix the problem... since it was an issue with their code and not C#. C# was doing what it was supposed to.
First of all, C# is a Java competitor, not a C/C++ competitor. It has an underlying layer of middleware, garbage collection, and just-in-time compilation, like Java. It exists because Microsoft didn't like developers using a Sun-developed standard. Something was needed for business application developers that wasn't as hard as C/C++, and was closely tied to a Microsoft platform. That's C#.
We still don't have a good replacement for C or C++. The big problems with C are 1) the language doesn't know how big arrays are (the cause of most of the buffer overflows in the world), 2) the language has no clue about concurrency or locking (the cause of most of the race conditions in the world). Those aren't fundamental problems of a low-level language; Ada and Modula 3 addressed both problems.
C++ doesn't fix either of those problems; it just papers them over with a layer of templated wallpaper. The mold underneath keeps seeping through the wallpaper. C++ has hiding without safety, the only major language in that space.
The original article has some interesting points. It had never occurred to me that a programming language should be designed to support command completion. Personally, I think an environment that displays the parameters of a function when you start to type a call is more useful.
I gotta say it - Python (and Ruby) is the best language to date. I don't see why you'd ever invent another language that scores lower on the benchmarks of what makes a language good.
Those are:
Those are just off the top of my head.
Speed isn't a concern because it is often cheaper to buy faster hardware than it is to use an unproductive language. When you think about it, one day of developer time can justify a CPU upgrade that is 2x as fast. How many hours a year do you spend updating headers, tracking down bad pointers, missing memory de-allocations?
Slashdot's rate-of-post filter: Preventing you from posting too many great ideas at once.
We still don't have a good replacement for C or C++. The big problems with C are 1) the language doesn't know how big arrays are (the cause of most of the buffer overflows in the world), 2) the language has no clue about concurrency or locking (the cause of most of the race conditions in the world).
Objectve-C fits both criteria. You use the found class NSArray for pretty much everything so you don't get buffer overflows, and you have a decent threading model with runloops and Java style @syncronized statements for threading, along with a lot of useful functionality to do common things with threads (like detaching a thread, having a thread run a method after a short delay, etc.). Further helping desktop aps at least is garbage collection, but even when you can't use that the memory model of release/retain is still more easy to use and less prone to having issues.
And, you can always fall back to C or C++ as needed.
"There is more worth loving than we have strength to love." - Brian Jay Stanley
Pretty sure that music precedes unicode, dude, and they write the sharp sign using anything that looks like a tiny smooshed tick-tack-toe board.
At any case, you're both wrong. "E#" is pronounced "eff" - there is a half step between E and F, and the "#" sign denotes "do this note, except take it up half a step."
E#==F.
That's actually not entirely true.
It is true that going a half-step up from E gives you F. However, in certain keys you'd still refer to the note as E#.
Bow-ties are cool.
Incidentally, this has long been a burning question for me: why is a language like Ocaml ignored to such an extent within the mainstream open-source community? It already has a small but vibrant community, excellent coverage in terms of libraries, performance comparable to C++, and the safety and cleanness that comes with functional programming. I even see Linux people excited with F#, seemingly oblivious to the fact that we *already* have a language better than F# that runs natively under Linux!
(Note: I consider Ocaml to be superior to F# because in the process of transforming Ocaml into F#, Microsoft removed two of the most interesting and powerful features of Ocaml: functors and polymorphic variants)
I can't exactly answer why other languages don't get more play - but I can lament that the .Net platform has been responsible for draining some of the life out of every language they touch. I still remember a very excited Eiffel proponent being very excited about Eiffel# when it first came out - not realizing it was a gateway for Eiffel users to flow to pure C# programming.
Perhaps F# is a true move by Microsoft to switch everyone to functional programming, but it could just as easily be a trick to get people using the .Net platform and then through convenience get them to move naturally to C# from there...
"There is more worth loving than we have strength to love." - Brian Jay Stanley
Does anyone here know anyone that uses C#? The one I always here about is Java.
If you are going to code applications with .Net use IronPython or IronRuby, C# I will let it just for low level tasks in the .NET, C# is verbose, bloated and messy and Im getting to dislike all those curly braces.
Also do you know that you can code XNA, Winforms, ASP.Net, Silverlight 2 and WPF in IronPython, who needs C# for application development?.
Actually, they did fix the problem... since it was an issue with their code and not C#. C# was doing what it was supposed to.
and in related news, C++ is not hard, its just that you're not intelligent enough to use it. And javascript is not slow, its just that you're using it for applications with incorrect performance requirements, and java isn't memory-hungry, you're just running it in a constrained environment :-)
If you say that C# is working fine, its a problem with the coders, then my points above are equally true.
I've been looking through stackoverflow recently, and there are a lot of questions along the line of "my .net app uses too much memory", its one of the inherent problems of a GC architecture that you need to be aware of, just like C#'s other language features. I believe its a big issue that needs more visibility - as you say, its not the GC that's at fault, its the whole understanding of how to properly code in a GC environment.
Unfortunately, most .NET coders are drawn to the language because it has features like this that are designed to make it easier for them to code, so they don't usually want to know that it is harder than they expected.
C# is not the best language for all sorts of problems, but when it comes to banging out a GUI .exe for windows users to use quickly, I don't think there are better choices.
Yes, basically, if you're in a situation where you would been stuck with VB, you now have C#, which appears to be somewhat less unpleasant.
If you're not in such a situation, there doesn't seem to be any good reason to use this language.
"Not an actor, but he plays one on TV."
more ignorant posts about how a language works then nearly all the posts about C# in this thread.
You people are just talking from brief sound bytes, ignorance, and misinformation.
Morons.
The Kruger Dunning explains most post on
Turbo Pascal might have been great for a DOS-only programmer, I don't know, I didn't use it because I needed to write software that would work on more than just DOS... that's not the point.
And, though this is not the point either, I would say the first IDE was Smalltalk, and Interlisp-D and UCSD Pascal both provided an IDE before Turbo.
The point is that the resulting program you got after you pressed that button was a badly behaved program. The end user doesn't give a damn whether you built the program by pushing a single button, or even if that button was pushed at the factory before you got it.
The end user had to deal with the fact that Turbo Pascal programs crashed on their computer because they didn't have one of the three video cards or two UARTs that Turbo's "too hell with MS-DOS and the BIOS, we're gong straight to the hardware" runtime knew about. The end user had to deal with the fact that when they ran a Turbo Pascal program, it clobbered their TSR text editor and wrote all over the other screen of DoubleDOS. The end user had to deal with the fact that Windows stuttered whenever they were running a Turbo program in a COMMAND window because they had to use a PIF that let the Turbo "I own the computer" program write straight to the hardware. Because whether or not Borland provided a way to build well behaved programs, no Turbo programmer in creation bothered to use it. Turbo was its own little world.
TextWriters closing the underling steam when they are disposed is just plain crazy
thank God the internet isn't a human right.
Im getting to dislike all those curly braces.
De gustibus non erat disputandum. A lot of people have big problems depending on indentation alone for nesting.
Lisp is the best language to date, and it's been the best language since the '60s. I don't see why you'd invent a language that isn't derived from Lisp.
On my ATARI ST :
_GFA Basic (automatic syntax correction, automatic indentation, folded procedures, etc ...)
_Omikron Basic (reset resistance)
_or even 68000 assembler were light years ahead in terms of ease of use that the MS-DOS Turbo pascal 3.3 I had the utter disgust of using.
Showcase :
_Turbo Pascal 3.3 on 8MHz 286 dual 3"5 floppy
Aim : display math graphics on screen.
After the 3rd time the program runs, error message : graphics not initialized.
WTF ? What do you mean not initialized, what the hell did you just display 10 seconds ago ?
_Reset PC
_Reboot MS-DOS from floppy
_Reload Turbo Pascal
_Reload program source
_Recompile & run
_Try again another equation.
Compare with this :
_Omikron Basic on ATARI ST, 68000 @ 8MHz
Aim : Screw around with the xbios functions about display addresses
ATARI ST crashes
_Reset ATARI ST
As soon as your finger leaves the reset button :
You are still under the OS
You still have the Omikron Basic interpreter loaded
Your source code is still in memory
All you have to do is run it again.
Similar results could be obtained with GFA Basic and a reset resistant RAM-disk.
And why, oh why the heck did that piece of crap turbo pascal had to use only ONE fricking pass for compiling ?
Even my 68000 assembler used two :
First one for syntax error, second for actual compile.
The first pass will list you ALL syntax errors and you will navigate from one to the other at will (not to mention with mouse and GUI).
Compare this with (TEXT mode) Turbo-Pascal that will STOP compiling on the very first syntax error it encounters.
30 semicolons omitted in your source ? That's 30 recompiles, one correction after the other.
AMIGA and ATARI ST were light years in almost all respects compared to the clunky and pain in the ass platform that was the PC.
i dunno, call me a fan boy but if microsoft is too heavily involved with C# and F# i'm kinda hoping that they'll Bb.
I stand by my comment that Python is the best OOP
There's OO Lisps.
But if you want a good object oriented language, and you aren't interest in Lisp, you're going to have to try pretty damn hard to beat Smalltalk.
Why does being born at the same time God was conceived make you an expert in C%?
It's meaningless. C# is used a lot in the enterprise application arena. I don't know why you would think "TIOBE" would have any insight into what Fortune 500 companies are developing internal automation and business software on. I get the hiring thing, but it doesn't mean a lot.
Answer: F#%$
Or is System.IO.Directory.GetFiles not what you're looking for? I can't think of any kind of file system-related calls that aren't somewhere in System.IO.
Perl - $Just @when->$you ${thought} s/yn/tax/ &couldn\'t %get $worse;
I think the java community has been talking about this kind of syntax for a long time but still not get it. does anyone know why? is it because of some MS patent on it?
In the fine article, it says:
So C++ I think is a fantastic example of a very appropriate evolution of an existing language. It came right at the dawn of object oriented programming...
Well, lets see, according to wikipedia C++ appeared in 1983. Smalltalk started development in 1969 and was publically available in 1980. And simula appeared in 1967.
So I guess that means that 1983 is the dawn of 1967... I think this guy forgot what object oriented means, and has drank too much C++ coolaid.
Man, you are so nineties ....
Langage of the XXII century is .COBOL - pronounced COBOL staccato - lamers read it dotCOBOL ...
C# == Db
Depends on one's metric. In terms of potential jobs C# is about par with C++, and well below Java.
Hotjobs, title search
Java: 577 jobs
http://hotjobs.yahoo.com/job-search?kwchanged=1&kw=Java&search_title_only=title&ui_kw_type=kwall
C++: 246 jobs
http://hotjobs.yahoo.com/job-search?kwchanged=1&kw=C%2B%2B&search_title_only=title&ui_kw_type=kwall
C#: 213 jobs
http://hotjobs.yahoo.com/job-search?kwchanged=1&kw=C%23&search_title_only=title&ui_kw_type=kwall
Monster, title search
Java: 2016 jobs
http://jobsearch.monster.com/Search.aspx?re=0&brd=1&jsnonreg=1&q=java&rad_units=miles&pg=1&vw=b&jto=1
C#: 889 jobs
http://jobsearch.monster.com/Search.aspx?re=0&brd=1&jsnonreg=1&q=C%23&rad_units=miles&pg=1&vw=b&jto=1
C++: 806 jobs
http://jobsearch.monster.com/Search.aspx?re=0&brd=1&jsnonreg=1&q=C%2B%2B&rad_units=miles&pg=1&vw=b&jto=1
If you are a glutton for punishment go to VB.NET and code in that horrendous language structure, but still be able to do all the things you could in C#.
Actually, there are quite a few features of C# that aren't supported by VB .NET. E.g. anonymous methods/types, implicit getters/setters, a *real* ternary operator, etc.
Mostly its stuff that you can still do, but takes longer/more code. But it can be very annoying when you're writing a program in VB.NET and discover that you have to do a lot of stuff the long way - VB.NET is bad enough even with the missing features.
Most human behaviour can be explained in terms of identity.
Unfortunately, most .NET coders are drawn to the language because it has features like this that are designed to make it easier for them to code, so they don't usually want to know that it is harder than they expected.
Trust me, I know... I've worked with people like this :-)
In C#, you are using assignment to represent that mechanism so you might be accessing a public member variable directly or calling a method to achieve that end.
Welcome to the wonderful world of C-derived languages like C++, C# and similar language where you can make up as you go new meaning for any operator you wish. Let's play our favorite game : "Guess what is this week's meaning for '&' operator !".
Disclaimer: I like C++ and like the line-noise alike structure it enables. I felt deeply deprivate now that I can't create operator ? with GNU.
PS: Love Perl too.
"Sufficiently advanced satire is indistinguishable from reality." - [Tips: 1DrYakQDKCQ6y52z6QbnkxHXAocMZJE61o ]
You know, I'll just call it Fucktothorpe, because getting 3/4 the way past sly innuendo and then turning back just makes me irritable.
The real story is that "professionals" (here in the U.S.) lost interest in Pascal. The people behind the FreePascal and Lazarus projects seem to be Brits, Germans, Russians, and so on.
The one area I would fault Delphi/Pascal is not keeping up in the area of collections (the domain of the STL) and other libraries. What enhancements to Pascal have come out of Borland have made it more of a Windows-specific language than something that could run elsewhere. This is probably more driven by waning interest in Pascal rather than the lack of such things driving people away from Pascal.
I haven't programmed in neither language and I can't tell code in Pike and code in C# apart. Is this just a superficial similarity or is it something more? I've never had the same trouble with all the other C-like languages.