Slashdot Mirror


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

28 of 499 comments (clear)

  1. a bunch of questions by yanyan · · Score: 5, Insightful

    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?

    1. Re:a bunch of questions by SquareVoid · · Score: 2, Insightful

      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 in C#.

    2. Re:a bunch of questions by Anonymous Coward · · Score: 1, Insightful

      As always it's an issue of tools for the job. When working on Windows, C# allows a serious programmer to develop quality applications quickly and avoid a lot of the boilerplate code that C++ will require you to do.

      It has the complex expressiveness that programmers need yet the nice integration with the OS that allows the developer to concentrate on functionality and not technical integration.

    3. Re:a bunch of questions by GeckoX · · Score: 4, Insightful

      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.

      --
      No Comment.
    4. Re:a bunch of questions by wtbname · · Score: 2, Insightful

      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.

    5. Re:a bunch of questions by Bright+Apollo · · Score: 2, Insightful

      Actually, COBOL is more widely used than any of those. Not sexy, but it literally pays the bills.

      -BA

    6. Re:a bunch of questions by TheDreadSlashdotterD · · 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#?

      --
      I have nothing to say.
  2. C# is not the most widely used comp language by frith01 · · Score: 4, Insightful

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

    1. Re:C# is not the most widely used comp language by Anonymous Coward · · Score: 2, Insightful

      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.

  3. Re:One of the most widely used languages? by Anonymous Coward · · Score: 2, Insightful

    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.

  4. Re:One of the most widely used languages? by nschubach · · Score: 2, Insightful

    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.

    --
    Every time I start to have faith in humanity, I ruin it by driving to work between 7 and 8 am.
  5. Re:amazing what doesnt get asked by Abcd1234 · · Score: 4, Insightful

    Well there is fragmentation produces as they introduce YET another language.

    So? That's a problem for Windows developers. Why should a Java programmer care? In the realms where Java is popular, C# has had basically no influence. So MS has, at worst, fragmented the Windows development ecosystem... big deal. :)

    You currently cannot say C# replaces C++ on Windows platform as using any DirectX components for example is nightmare through C#.

    ...

    More on the major downside of writing .NET applications is that you cannot guarantee that the stuff I work on my Vista workstation works on my co-workers XP workstation.

    But none of this has anything to do with fragmentation to begin with. You're getting off-point. And that's ignoring the fact that, once again, this is a problem for MS... the rest of the programming world doesn't care one whit how hard DirectX is to integrate with C#.

    Can it be a success when it cannot be used to produce major parts of their own operating system.

    Last I checked Java wasn't being used to write operating system components, yet no one claims it's a failure. Now, that's not to say C# and .NET are unbridled successes, but that's a pretty crappy metric for making the call.

  6. Re:oh goody. by ByOhTek · · Score: 1, Insightful

    Yeah, but people hated C# and love Java about like they do now before Java was open sourced.

    --
    Self proclaimed typo king, and inventor of the bear destroying coffee table (patent not pending).
  7. Re:Foctothorpe FTW by Waffle+Iron · · Score: 1, Insightful

    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.

    If a sharp sign is the same as an octothorpe because it has a similar (but not identical) shape, then a flat sign must be the same as a lower-case "b". As it happens, however, neither pair of symbols have ever been interchangeable.

  8. Re:One of the most widely used languages? by Anonymous Coward · · Score: 1, Insightful

    Behold, the "coding standards company" whose web site requires javascript.

    What a bunch of clowns!

  9. Re:oh goody. by Anonymous Coward · · Score: 1, Insightful

    Java hasn't been an interpreted language in a long, long time.

  10. Re:oh goody. by Goaway · · Score: 2, Insightful

    Yeah, it only took twelve years for that to happen. I guess C# just won't get around to it for another five years.

  11. Re:oh goody. by bigstrat2003 · · Score: 1, Insightful

    Oh goody. Another mindless Microsoft-basher who wants to try to whore up some free karma by saying untrue things like "slightly altered" and "nonstandard" about C#. Oh goody.

    --
    "16MB (fuck off, MiB fascists)" - The Mighty Buzzard
  12. Re:oh goody. by tjwhaynes · · Score: 4, Insightful

    The implementation is about the same in both languages, but using it is much nicer and cleaner in C# than in Java.

    That really is a matter of opinion. In Java, it's pretty clear that you are requesting or modifying a property of the object. 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. To me, the Java method is more explicit and therefore less prone to error.

    Cheers,
    Toby Haynes

    --
    Anything I post is strictly my own thoughts and doesn't necessarily have anything to do with the opinions of IBM.
  13. Re:Foctothorpe FTW by Ed+Avis · · Score: 2, Insightful

    On a piano keyboard to play E# you press the same key as for F, so it gives the same sound. But I *think* this is not true for every instrument. Some instruments can produce different sounds for E# and F. Then there are the considerations of music theory and notation which others have pointed out.

    --
    -- Ed Avis ed@membled.com
  14. Re:oh goody. by denoir · · Score: 2, Insightful
    Actually, with the latest incarnation of C#, it gets much more compact. I don't know how to get indentation to work within the ecode tag but you should still get the idea:

    class foo
    {
    public int dontTouch { get; set; }
    }

    class bar
    {
    public void someMethod()
    {
    foo ourFoo = new foo() { dontTouch = 5 };
    int asdf = ourFoo.dontTouch;
    }
    }

  15. Re:oh goody. by Anonymous Coward · · Score: 1, Insightful

    ISO's meaningfulness is diminishing.

  16. Re:Oh, well, that explains everything... by dwye · · Score: 2, Insightful

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

    The really good, independently produced, compilers died away as Borland's cheapness and MS's standardness (not real standards, THEIR standards, but they wrote the OS, so *surely* they had the best tools? NOT) gradually undercut their niches. The first Turbo versions were crippled from the POV of professional programmers, but were good enough for students, amateurs, etc., and Borland then introduced better compilers for higher prices, until the best version was about as expensive as MS C, but slightly better (following the old GM strategy of cannibalizing yourself, rather than letting competitors do it, by covering all the price points). GNU C also helped kill them, as it was also good enough to make the other compiler companies' offerings redundant.

    > About the time Delphi came out, things moved on
    > and they began teaching C++ which pretty much
    > killed Delphi off.

    Actually, the programming market had only moved from Pascal to C, but Delphi was very wed to Pascal and its idioms. It also ran into the wall, in that the REALLY complicated stuff that professionals did was beyond it, and Borland didn't have a follow-on product.

  17. Re:oh goody. by digitig · · Score: 2, Insightful

    Better than C#? Well, how many platforms can you name that C++ is not available for? If you're willing to go back to an early version of C++ it compiled via C (may be possible even for current versions, I've never bothered looking into it), so at least some version of C++ would run on anything that runs C (and had enough resources).

    --
    Quidnam Latine loqui modo coepi?
  18. Re:oh goody. by molarmass192 · · Score: 2, Insightful

    "C# ... is very popular ..."

    By "very popular" I take it you mean less popular than Perl or Python, but more popular than Delphi.
    http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html

    --

    Good people do not need laws to tell them to act responsibly, while bad people will find a way around the laws-Plato
  19. Re:Oh, well, that explains everything... by argent · · Score: 2, Insightful

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

  20. Re:oh goody. by maestroX · · Score: 4, Insightful
    I like neither way.

    Java: Properties are private variables/methods exposed through a public method. Seems unnatural and tedious when accessing a guarded variable, e.g.

    Line.GetWidth(); Line.SetWidth(10);

    Two different calls for accessing a single property.

    C#: Properties are private variables/methods exposed through a public variable. May be cause for surprise e.g. when

    Line.Width++

    increases width and executes statements outside the scope of width increase.

    For exposing a (guarded) private variable I prefer the C# way, but it's too easy to mix data with flow.

    I don't feel a property can be accessed as either a variable or a method, because it isn't and adds to confusion.

  21. Re:Python by zuperduperman · · Score: 3, Insightful

    Here are some problems with Python:

    * significant whitespace does not play well with common development practices (merging, diff'ing, copying, pasting code, esp. on web pages)
    * GIL makes it very hard to scale or completely unscalable in some situations
    * no support for static typing makes large projects harder to manage
    * not truly cross platform - a lot of common libraries are implemented in C and thus you have to install native code for them to work - bad luck if there isn't a binary for your platform.
    * no common standardized GUI toolkit
    * poor commitment to backwards compatibility - Python 3k is going to break compatibility in major ways as did releases before it
    * awkward and ugly object oriented semantics (declaring "self" in class methods, ugh)
    * poor IDE support
    * poor adoption - not sure what makes you think the labor pool for Python is better than other languages

    I'm sure a dozen python supporters will jump up and object to all these - there is hardly anything revolutionary about these criticisms and most of them have been fought to death in enormous flame wars in the past. But the end result is, Python is not great for a lot of "enterprise" type situations due to these things (and you will quickly see how sensitive pythonistas are to this snub since they constantly mock the word "enterprise" on mailing lists etc.). In other situations it can be brilliant.