Follow Slashdot blog updates by subscribing to our blog RSS feed

 



Forgot your password?
typodupeerror
×
Programming IT Technology

C# In-Depth 499

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."
This discussion has been archived. No new comments can be posted.

C# In-Depth

Comments Filter:
  • Ads... (Score:3, Informative)

    by Dannybolabo ( 980836 ) <dannybolabo@gmail.cTEAom minus caffeine> on Wednesday October 01, 2008 @08:32AM (#25217501)
    Why must they make me trawl through 8 pages of ads?
  • by neonprimetime ( 528653 ) on Wednesday October 01, 2008 @08:32AM (#25217507)
    I beg you to use this link [computerworld.com.au] instead of flipping thru all 8 pages
    • Re: (Score:2, Informative)

      by Anonymous Coward
      Your link did not redirect me to a printer friendly version.
  • by netpixie ( 155816 ) on Wednesday October 01, 2008 @08:35AM (#25217549) Homepage

    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.

    • Re: (Score:3, Informative)

      by mbadolato ( 105588 )

      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

      Er, haven't studied much music, eh? Personally I don't recall anyone ever saying anything to the effect of "This time,let's try Bach's Bouree, but change the key to E octothorpe". E# is pronounced "E sharp" ;-)

      • Re:Foctothorpe FTW (Score:5, Informative)

        by netpixie ( 155816 ) on Wednesday October 01, 2008 @08:51AM (#25217795) Homepage

        That'll be because music uses sharps (i.e. unicode symbol 266F) rather than octothorpes (unicode 0023)

        E followed by unicode 266F is indeed E sharp
        E followed by unicode 0023 is E-octothorpe.

        • Re:Foctothorpe FTW (Score:5, Informative)

          by IIRCAFAIKIANAL ( 572786 ) on Wednesday October 01, 2008 @09:44AM (#25218619) Journal

          C# is indeed C followed by a musical sharp. But everyone uses the octothorpe for convenience.

          • Re: (Score:3, Interesting)

            by tobiasly ( 524456 )

            C# is indeed C followed by a musical sharp. But everyone uses the octothorpe for convenience.

            If I had mod points I'd give 'em to ya but instead I'll just reply that you're correct. :) In fact the C# standard (don't have the link handy) specifically states that although sharp is the "correct" glyph to use, the octothorpe is an "accepted" alternative due to the lack of the former on keyboards.

          • by risk one ( 1013529 ) on Wednesday October 01, 2008 @11:51AM (#25220897)

            Somebody should trademark C octothorpe, and sue Microsoft for every place they've used the wrong character.

    • The Roctothorpe!

      *insert headbanging graphic here*

    • by Chemisor ( 97276 )

      Hey, it's a good name! It's about time we stopped focusing on creating glistening new tools and started thinking about actually using them for something. But, of course, being an average Slashdot reader, you probably don't know how.

    • Having no musical background but a long history of using a telephone, I read that as "C-Pound" and "F-Pound"

      It was my impression that they were named in a fit of rage by noted scientist Bruce Banner.

    • Re: (Score:2, Funny)

      I can't wait until the Mono project completes their clone.

      And I can use GNU/Cocotothorpe.

    • It's kind of like printers quotes versus straight quotes. When they print it, they use the sharp sign, and formatting things convert straight quotes to printers quotes.

    • Re: (Score:3, Funny)

      by danwesnor ( 896499 )
      It never ceases to amazes me what Slashdotters will argue about. Somebody makes a reasonably funny smart-ass remark and the next 5,000 posts are dedicated to arguing about whether his premise is correct.
  • by yanyan ( 302849 ) on Wednesday October 01, 2008 @08:35AM (#25217555)

    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?

    • Re: (Score:2, Insightful)

      by SquareVoid ( 973740 )
      What impact did Java have on computing sciences? Well take that list and multiply it by several generations ahead of Java and that is what you have. And it isn't so much C# as it is the .NET framework which has done this. C# is just syntax that allows you to use the framework. C# just happens to have a very close syntax structure to the C-family of languages. 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
      • by GeckoX ( 259575 ) on Wednesday October 01, 2008 @08:57AM (#25217901)

        ehh? You do realize that VB.Net is not VB6. When you choose to not use the Microsoft.VisualBasic namespace, which merely contains an abstraction layer to allow VB6 programmers to be more comfortable in .Net, it actually hardly merits the name VB.

        For the most part, the only differences between c# and vb.net are syntax. Begin...End, For...Next control structures rather than brackets is the biggest difference.

        I wrote c# at my last job for a couple of years. At my current shop, they're a vb shop and brought me in to bring things up to .Net. Since all the current devs were vb6 devs, they wanted the easiest path for them to migrate into .Net, thus I had to start working in VB.Net. At first, I dreaded it..but very quickly realized that it's all just .Net, and the VB.Net and C# languages are very comparable, both being just as easy to work in.

        Bottom line, you like curly braces? Use c#. Don't care? Then use whichever you like.

        • Re: (Score:3, Informative)

          Actually, that isn't right either. Microsoft.VisualBasic isn't the compatability layer, it's the VB runtime. It just provides a few extra function that *look* like VB6, some of them don't even behave the same. The actual computability layer is in Microsoft.VisualBasic.Compatability, It's the library that is responsible for doing the weird stuff like giving you collections that start at 1 instead of 0 and other strange stuff. Microsoft.VisualBasic follows all the standards that any other .NET library use

        • Re: (Score:2, Insightful)

          by wtbname ( 926051 )

          ehh? You do realize that VB.Net is not VB6. When you choose to not use the Microsoft.VisualBasic namespace, which merely contains an abstraction layer to allow VB6 programmers to be more comfortable in .Net, it actually hardly merits the name VB.

          For the most part, the only differences between c# and vb.net are syntax. Begin...End, For...Next control structures rather than brackets is the biggest difference.

          I wrote c# at my last job for a couple of years. At my current shop, they're a vb shop and brought me in to bring things up to .Net. Since all the current devs were vb6 devs, they wanted the easiest path for them to migrate into .Net, thus I had to start working in VB.Net. At first, I dreaded it..but very quickly realized that it's all just .Net, and the VB.Net and C# languages are very comparable, both being just as easy to work in.

          Bottom line, you like curly braces? Use c#. Don't care? Then use whichever you like.

          So true. I use both C# and VB .Net. It blows my mind how the ignants out there blast VB.Net, while happily code away in C#, a language that at best is slightly syntactically dissimilar. Actually I guess it doesn't. Ignorance is ignorance after all.

        • Re: (Score:3, Interesting)

          by BitZtream ( 692029 )

          I had a hard time conviencing a Microsoft Developer, who writes in C# that VB.NET and C# are practically identical. Until I pulled out the URL to the MSDN documentation that uses XML and XSLT to show example code in the browser and allows the browser to switch between showing C# and VB examples with a javascript call.

          Its amazing how hard it is for some people to pick up on the obvious. Thats the POINT of .NET, to make a lot of the differences between languages and their output (libraries and executables)

    • by nschubach ( 922175 ) on Wednesday October 01, 2008 @08:54AM (#25217845) Journal

      Looks like it's down to #8 actually:

      http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html [tiobe.com]

    • by Nursie ( 632944 ) on Wednesday October 01, 2008 @08:55AM (#25217859)

      8th most widely used.

      After Java, C, C++, Visual Basic, Python, Perl and PHP. It just beats out javascript, below that you get into the obscure languages.

    • by Aladrin ( 926209 )

      How does that make any sense? Almost all programming languages work on Windows, so it comes right back to technical merit. There's nothing stopping a 'better' language from being more popular on Windows.

      If anything, the fact that C# didn't run on Linux and Mac for a long time (and still isn't perfect) should have reduced its usage, lending credit to the hypothesis that C#'s rise is based on its technical merit.

      Personally, I think C# is a pretty nice language to write simple programs on. If you need raw s

    • by johnlcallaway ( 165670 ) on Wednesday October 01, 2008 @09:27AM (#25218349)
      They can take one company off the list of users. We are rewriting all the C# (and C++) code in Java so we can gain portability. Already, our operations staff is drooling over the prospect of being able to deploy virtual Linux servers that need far less memory instead of Windoze if they want to.

      The first project converted 12 C++ programs to one, far more flexible Java program (that runs 12 times). The nightly run is now 30 minutes instead of two hours and hasn't had an abort in two months. In fact, the operations manager was very nervous for awhile because he wasn't getting paged on the weekends and kept checking the system.

      We could have done the same thing in C++ or C#, but they offered no discernible benefit and are more complicated to use for what we are doing.
      • Re: (Score:3, Insightful)

        I mean, wow, good for you, picking the right tool for the job. And 12 C++ programs into one Java program? Isn't that an indictment of C++ rather than C#?
  • by frith01 ( 1118539 ) on Wednesday October 01, 2008 @08:37AM (#25217583)

    >>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.

    • Re: (Score:2, Insightful)

      by Anonymous Coward

      The author used the words "one of", meaning *not* THE most widely used language. It is pretty common, so it's not really an arguable assertion.

    • Re: (Score:2, Informative)

      by ByOhTek ( 1181381 )

      note it says "one of computer programmings ..." not "the..."

      That means it's not necessarily THE most widely used language, but in a subset of the most widely languages...

      In the top 75%? probably
      In the top 50%? probably
      In the top 10%? maybe...

       

    • Re: (Score:3, Informative)

      by Nursie ( 632944 )

      Apparently Java is the top dog today.

      My personal favourite, good 'ol C is in second place. C# was in at number 8, and seems actually to be on the decline.

  • 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?
    • Re: (Score:3, Funny)

      Yes, it must be one of the most widely used, because it seems that every day I hear of .NET failing to scale somewhere.

      • by jlechem ( 613317 ) on Wednesday October 01, 2008 @09:00AM (#25217943) Homepage Journal

        I can feel my Karma burning here but in my office we run into this issue with a lot of MS products. SQL Server 2000 ........ Upgrading is not an option since the DoD just approved SQL Server 2005 for classified use. Apparently 2008 is the bees knees but come on 8 years to get your shit straight? And we've also run into massive problems getting asp.net applications to scale. We've found MS best practices while certainly easy are not very efficient behind the scenes and cause massive slowdown when used on a large scale. And after using their ajax toolkit I wouldn't touch that thing with a ten foot pole.

        Now I might sounds like I'm bashing .net a bit. But .net products do have their time and place. I code in C# almost everyday. But for anything Enterprise I would think twice about it.

    • Re: (Score:2, Insightful)

      by Anonymous Coward

      Yes you must be out of the loop to some degree if you have only met a handful of people developing in it. It certainly is not obscure. Where I am there is more C# work going on than any other single language.

      • Re: (Score:3, Insightful)

        by nschubach ( 922175 )

        Could that be partly due to the fact that a literal monkey could code it? Hell, most of the code you'd ever need for any program has been posted by some Microsoft programmer on MSDN so the only skill developers have to know is cut and paste. I don't know how many times I've looked through code with myObject and myHttpWebRequest because the developer was too lazy to even change the variable names to fit the purpose.

    • > Has C# truly surpassed C, C++ and Java?

      No, but it is up there with them - which is what the quote said "ONE OF the most widely used..."

      Where exactly it is will depend on which survey you read. Evans data reported something like 1/3 using C# I think. Or looking at current job vacancies, this site puts it third in the skills list: http://www.salaryservices.co.uk/topskills?expand=topskills&cboIndustry=-1/ [salaryservices.co.uk]

      Of course, YMMV and depend on location and industry segment. If you are doing eg. embedded devel

    • by afidel ( 530433 )
      Yep, I just did a quick Monster search for 200 miles from my zip, Java comes in a 525, C# at 342, and C++ at 300.
  • They should really have called the successor E#

    • Re: (Score:3, Funny)

      Well, F# is a perfect fourth up from C#, which offers better resolution than moving to E#, a major third up. At least they didn't go for G, at which point they'd have you begging for G#.
    • F for functional.

      Though here, C# is to java as F# is to OCaml, and one wonders if the selection of OCaml as the syntactic base had to do with merits or license. As to Hjelsberg, who is legitimately a language superstar, I've been reading suggestions that some of the major elements of .net 2 and greater were necessitated by the desire to get a functional language into the .net universe and the F# developers did the major work in extending the platform. C# is now tilting towards functional. Though as I have b

  • "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 perfec

    • Turbo Pascal and Delphi were popular because 20 or so years ago universities taught Pascal to their computer science students. About the time Delphi came out, things moved on and they began teaching C++ which pretty much killed Delphi off.

      That and MS's development tools got much better.

      • Re: (Score:3, Insightful)

        by dwye ( 1127395 )

        > Turbo Pascal and Delphi were popular because 20 or so years
        > ago universities taught Pascal to their computer science students.

        False, or else MS-Pascal would have become equally popular. Turbo Pascal was popular because it only cost $44.95, thus falling into the "buy it for a lark, try it, and toss it if it isn't good" buying space. Turbo C and Delphi, in their first versions, were equally under-priced, compared with $250 or so for MS compilers, and over $500 for some of the really good C compilers

    • by FlyingGuy ( 989135 ) <flyingguy@gm a i l .com> on Wednesday October 01, 2008 @09:19AM (#25218227)

      Dude, you seriously need to stop sipping the red bull or whatever your drinking...

      Turbo-Pascal was a god send to the programming world. It was an entry point for 10's of thousands of programmers and I am one of them. It was the 1st IDE, write your code then compile and run in one key press! No one had that, not a single company. Yes it was limited to 64K of code and data and only made an image ( com file ), but what you could do in that 64K was beyond anything else at the time.

      Say what you will about Anders going over to the dark side, I mean until then he was my personal hero, but there is no denying the mans brilliance. Turbo Pascal for Windows? Again, no company had anything remotely close to that and he was the architect. Delphi... Again, no one had anything close to that, and he was the architect.

      The OOP model that came out of Borland made C++ look exactly like the joke it was and is today. Their model was infinitely superior, and again, he was the architect.

      The demise of Borland was mostly about Microsoft's malevolence and monopolistic ways. If MS had wanted actual competition, more then likely we would would all be programming in Borland languages to this day, instead of the shit that comes from MS which most of Anders has a hand in, but is corrupted by the MS Marketing machine making technology decisions.

    • Re: (Score:2, Funny)

      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.

      Hey! I wrote some of those applications, you insensitive clod!

      (Whaddya want? I was a 15-year old kid with a copy of Turbo Pascal. A very dangerous thing back then. ;)

      • Re: (Score:3, Insightful)

        by argent ( 18001 )

        I was a 15-year old kid with a copy of Turbo Pascal. A very dangerous thing back then.

        Aha! "Turbo Pascal, the PHP of the '80s."

  • 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.
  • by Pants75 ( 708191 )
    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.
    • Same here. I've been doing a large project over the last 14 months in C#. I really like it.
    • What was the best way you learned to use it? I'm working through an O'Reilly book updated with 3.0 but would be much more open to listening someone who uses it to feed the family.

  • C# Usage (Score:5, Informative)

    by O('_')O_Bush ( 1162487 ) on Wednesday October 01, 2008 @08:56AM (#25217883)
    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.
  • by Seakip18 ( 1106315 ) on Wednesday October 01, 2008 @09:04AM (#25218033) Journal

    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....

    Now, you can argue that we're not obviously open source or anything, but the language is standardized, and the entire specification is available for anyone to go replicate. Mono has done so, and I think Mono is a fantastic thing. I don't know [if] you're familiar with Mono, but it's an implementation of the C# standard and the CLI standard (which is effectively the .NET standard) on Linux, built as an open source project. And they're doing great work and we talk to them a lot and I think it's a super thing.

    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

    And I guess they couldn't have done that had you not put the specifications out there?

    Well, they could have but it would have been a heck of a lot harder and it would probably not be as good a product. You can go reverse engineer it... they have reverse engineered a lot of the .NET platform... but all of the core semantics of the language, they were part of the standardization process.

    You know most recently we've created Silverlight, which is our browser hosted .NET runtime environment, and the Mono guys have built a project called Moonlight which is an implementation of Silverlight that is officially sanctioned by Microsoft that runs on Linux and other browsers. It's a good thing.

    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.

    • Re: (Score:3, Interesting)

      The fact it feels like he's faking the enthusiasm, as he did for most of this dumb interview, is slightly scary.

      Of course Anders Hejlsberg is faking enthusiasm... just like for instance Bjarne Stroustrup about C++ and C++0x.

      In both cases the language features they chose to include cause incredible amounts of complexity. At first they are all excited about all these cool features... but then when they get to the gritty, like for instance getting C# to beat Java in performance (it doesn't come close), they start tearing their hair out.

      For instance, one big reason Java did not include 'real' generics is because it had n

      • Re: (Score:3, Funny)

        by ozphx ( 1061292 )

        So if something is useful, but has a performance hit when used, it should be left out?

        Dang. There goes my bright idea about "methods" with all their wasteful pushing and popping before jmps...

      • Re: (Score:3, Interesting)

        In both cases the language features they chose to include cause incredible amounts of complexity. At first they are all excited about all these cool features... but then when they get to the gritty, like for instance getting C# to beat Java in performance (it doesn't come close), they start tearing their hair out.

        References? I don't see anything about C#-the-language that would cause it to be slower than Java in any reasonable implementation. If anything, value types and methods being non-virtual by defaul

  • I'm just curious how C# is said - anyone?
    Thanks!

  • by Cultural Sublimation ( 884893 ) on Wednesday October 01, 2008 @09:47AM (#25218667)

    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 [inria.fr] 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)

    • by SuperKendall ( 25149 ) on Wednesday October 01, 2008 @11:19AM (#25220379)

      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...

Keep up the good work! But please don't ask me to help.

Working...