Catch up on stories from the past week (and beyond) at the Slashdot story archive

 



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:
  • by novalis112 ( 1216168 ) on Wednesday October 01, 2008 @09:38AM (#25217589)
    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?
  • by Abcd1234 ( 188840 ) on Wednesday October 01, 2008 @09:43AM (#25217669) Homepage

    I'm curious, what gives you the idea that C# fragmented "the whole programming scene"? As far as I can tell, C# has really just replaced C++ on the Windows client side, where Java never had a foothold to begin with.

    So, where is this fragmentation you speak of?

  • by rzei ( 622725 ) on Wednesday October 01, 2008 @09:54AM (#25217853)

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

    You currently cannot say C# replaces C++ on Windows platform as using any DirectX components for example is nightmare through C#. Which I think is a rather major obstacle if you have an application that would like to use something other than simple sound output facilities. (Reasons for this might be as simple as choosing a sound output device, on at least .NET 2.0.)

    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. This is a very sad "feature" that has been bugging as even with very simple applications. (Side note: We have tried to code using all the best practices you can find from MSDN.)

    Also, GP's point 3 sounds very interesting. Can it be a success when it cannot be used to produce major parts of their own operating system. (No, I'm not talking about writing their kernel with C#).

    Though, the GP doesn't list any sources for point 3, which at least I would be very interested to read as I seem to have missed those articles.

  • by ByOhTek ( 1181381 ) on Wednesday October 01, 2008 @09:56AM (#25217889) Journal

    I've tried a number of apps in mono under frebsd (you need lang/mono and x11-toolkits/libgdiplus). Threads, UI, Sockets, SSL sockets, etc. all seem to work fine. Compiled in Visual Studios 2003. It's not even bad as a cross-platform application.

    Conversely, in Suns own Java implementation, going between Windows and HPUX, I've run into issues simply with the regular expression parser of the /find/ function of the String library.

    I'm not saying .NET is perfect by any means, but it's certainly not bad framework either. It's decent for cross-platform apps. Everything has it's flaws, nothing is perfect, etc.

    Yes, I know, there is always a chance MS will say "No more!" to the mono project. As I said, nothing's perfect.

  • by FlyingGuy ( 989135 ) <.flyingguy. .at. .gmail.com.> on Wednesday October 01, 2008 @10: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.

  • by johnlcallaway ( 165670 ) on Wednesday October 01, 2008 @10: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:oh goody. (Score:2, Interesting)

    by Duffy13 ( 1135411 ) on Wednesday October 01, 2008 @10:36AM (#25218499)
    I'm sorry, gotta disagree right here. I absolutely hate Delphi, it feels like retarded VB compared to my work with C#. Granted this is opinion, but I know I'm not alone in this train of thought.
  • by Cultural Sublimation ( 884893 ) on Wednesday October 01, 2008 @10: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)

  • Re:oh goody. (Score:5, Interesting)

    by Tiger ( 9272 ) on Wednesday October 01, 2008 @10:56AM (#25218835)

    Having spent the last seven years using Qt and C++, and the last two comparing that with C#, I'd agree with the original poster: C# is a better choice for fast productivity to a GUI .exe for Windows.

    Throw other platforms into the mix and my decision changes, but that's not what he stated, is it?

    Qt lost a lot of points in my book for just how much time was destroyed in porting our code to Qt4. Two years later, and we're still asking for bugfixes.

  • Re:Foctothorpe FTW (Score:3, Interesting)

    by tobiasly ( 524456 ) on Wednesday October 01, 2008 @11:16AM (#25219155) Homepage

    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 cryptoluddite ( 658517 ) on Wednesday October 01, 2008 @11:25AM (#25219347)

    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 never been done before in a major statically-typed virtual machine and the interaction with other parts was not understood or simple. C# just threw it in, and now they have problems like not being able to inline more than one method deep, and only ridiculously simple methods (less than 32 bytecodes, no branches, etc). Another reason was backward compatibility, but see discussions with Bracha for instance about implementation if you think that was the main reason.

    Designers of languages like Smalltalk are enthusiastic forever. Designers of languages like Java are workers, they get the job done and done well but aren't crazy excited about it. Designers of languages like C++, C# go mad and in their warped minds 'complexity is simplicity' and they have to feign enthusiasm so they don't have to admit their mistakes.

  • Re:oh goody. (Score:4, Interesting)

    by The Mayor ( 6048 ) on Wednesday October 01, 2008 @02:49PM (#25222773)

    Yeah, that was what I thought before I started using C#. I am a 10+ year veteran of the Java world, and have spent the last year or so on a large C# project. C# has much better syntax in every way that it deviates from Java. Properties are quite clear, since VS does a nice job. Under the covers, there is *no* difference between a property with an implicit getter/setter (i.e. you didn't provide one, so you access the variable directly)--the bytecode creates a synthetic get_ and set_ method, allowing things like AOP to work even if no explicit getter/setter is provided.

    The Java method results in much more verbose boilerplate code. This also causes many developers to do more cut-and-paste, another source of potential error. The Java method makes tech like AOP much harder, as there is no synthetic method call surrounding access to public member variables. The Java method is, in short, not object oriented, as it does not properly abstract away property access, so Java tacked on this stupid getXXX/setXXX naming convention in the JavaBean standard.

    There are many reasons why Java is a superior platform than .Net/C# (maturity of 3rd party libraries, the open source community, the quality of design in the provided libraries). But the language itself is not one of them. I cannot think of a single area where Java bests C# in terms of the language itself. C# really is the next generation of Java, and has learned from Java's mistakes.

  • Re:oh goody. (Score:3, Interesting)

    by aztracker1 ( 702135 ) on Wednesday October 01, 2008 @03:08PM (#25223067) Homepage
    If you have to use legacy libraries (dll/so), then you will definitely like .Net over Java. That's my single biggest gripe with Java, is the pain that is JNI. I also find that development in VS is far easier than using any of the Java IDEs I've tried. Not to mention that ASP.Net, Dynamic Data, and MVC frameworks are easier than anything in the Java side of things to get up, running, and debugging at runtime. Java is more portable, that is a given. But I still prefer C#/.Net.
  • Re:Foctothorpe FTW (Score:3, Interesting)

    by turgid ( 580780 ) on Wednesday October 01, 2008 @03:39PM (#25223557) Journal

    What a lucky little so-and-so. But could he still distinguish flat and sharp keys if all of the instruments were in equal temperament?

    That would be an interesting experiment to perform.

  • by shutdown -p now ( 807394 ) on Thursday October 02, 2008 @03:35AM (#25230147) Journal

    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 default gives it an edge. Delegates are significantly faster that anonymous classes when it comes to implementing the Observer pattern (because implementation of delegates works directly with raw function pointers). And as far as runtimes go, .NET GC has always favored better in my tests than Java GC, by about 15-20%.

    For instance, one big reason Java did not include 'real' generics is because it had never been done before in a major statically-typed virtual machine and the interaction with other parts was not understood or simple. C# just threw it in, and now they have problems like not being able to inline more than one method deep, and only ridiculously simple methods (less than 32 bytecodes, no branches, etc).

    Inlining limitations in .NET have nothing to do with generics at all - they are just thrown in "for good measure", and are often conscious design decisions (because, you know, sometimes inlining decreases performance). Most of them were in place before generics, in fact. Some (such as no inlining for methods taking structs as argument) were just silly, but gladly they finally fixed it in 3.5 SP1.

    Meanwhile, if we're still talking about performance, try comparing the one of java.util.ArrayList<Integer> vs System.Collections.Generic.List<int>. And then come tell us why .NET generics suck because they are slow...

  • by BitZtream ( 692029 ) on Thursday October 02, 2008 @03:37AM (#25230161)

    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) go away so you can use whatever suits you or the project best, including multiple languages in the same library/executable.

Lots of folks confuse bad management with destiny. -- Frank Hubbard

Working...