Slashdot Mirror


How C# Was Made

prostoalex writes "Bruce Eckel (from the Thinking in C++/Java/Patterns/Enterprise Java fame) and Bill Venners have interviewed programming legend Anders Hejlsberg. After 13 years in Borland and joining Microsoft in 1996, Hejlsberg now leads the development of C# language and talks about the development process, reasons some things exist in C# and some not, as well as future directions."

21 of 391 comments (clear)

  1. Re:"Co-opt Java" by tjmsquared · · Score: 5, Insightful

    I don't know why Java developers always feel the need to point out that C# took a lot of ideas from Java. I don't see C++ developers always pointing out that Java's mandate was to "co-opt" C++. Of course C# took a lot of ideas from Java (I don't think Microsoft has ever denied this), because Java got a lot of things right. C# also made a lot of improvements (event handling is MUCH improved in C# for example) and is a great language to program in. I think it would be even better if there were a .NET runtime for an OS other than Windows, but the good people on the Mono project are working on that already.

  2. Sun Should Embrace and Extend by gurustu · · Score: 5, Insightful
    It's very easy for Java devs (and I'm one) to sneer at C# as just another MS ploy to lure people away from quality, but I think that there's no question that C# has some language features that should be migrated into Java.

    It's well known that the C# designers paid a lot of attention to Java, but more importantly, it's also quite clear that they also spent a lot of time paying attention to the experience of developing in Java.

    So while I might not entirely agree with the uncaught exceptions or the way methods aren't virtual by default, I do think it would be a good idea for Sun to take the lesson from MS, and take what is best about C# and move it into Java.

    1. Re:Sun Should Embrace and Extend by gurustu · · Score: 5, Insightful
      I've been following the 1.5 release pretty closely for a while now, and it has some excellent additions. I'm especially pleased with the generics, the enumerated constants, the ability to define a method as accepting an undefined number of parameters, and the improved monitoring. The amount of code I'll be able to remove from my codebase will be large.

      However, that doesn't invalidate what I said initially. 1.5 isn't a response to C# (well, maybe the enumerated types are), but seems to be kind of orthogonal to C#. It is a distinct improvement to the language, but that isn't the same thing as "embrace and extend". Those improvements don't give Java evangelists the ability to say "The C# language has no good feature that Java doesn't."

      I'm also making an argument about intellectual honesty. Java (like any other piece of software) will never flower into its full potential unless the people who believe in it are willing to acknowledge the strengths of its competitors, and then adopt those strengths where it can.

      It isn't a sign of weakness to do that, but a sign of strength.

  3. Re:"Co-opt Java" by tealover · · Score: 5, Insightful

    In a sense, Java was designed to co-opt C++. But co-optinging C++ was not made as a business decision to lock in Sun customers, it was made as part of Sun's vision of "The Net is the Computer" (or whatever they called it).

    Sun embraced the internet years before Microsoft and looked out into the future and realized that desktop computing and huge, standalone applications were going to be increasingly replaced by device computing and small, internet downloadable applications would be prevalant.

    To that end, they tried to design a language that was simple, that had built-in libraries to handle basic internet protocols and to a large extent, their vision was spot-on and Java was hugely successful.

    Without Microsoft spending years trying to undercut them it's very conceivable that Java would be the lingua-franca of the internet right now.

    --
    -- You see, there would be these conclusions that you could jump to
  4. Re:"Co-opt Java" by prockcore · · Score: 4, Insightful

    Fine with me. A java-like language that doesn't gobble ram like no tomorrow? Sounds good.

    As a bonus, Gtk# has the best API I've ever used in a gui toolkit.

  5. Why do big companies want pseudo-compiled langs? by Futurepower(R) · · Score: 3, Insightful


    It seems to me that big companies like Sun and Microsoft like pseudo-compiled languages like Java and those in .NET like C# for two reasons:

    1) Pseudo-compiled languages are easily decompiled. If a small competitor writes an especially useful program, it is easy to see the logic by just decompiling the source code. In business programming, the business systems logic can be EXTREMELY complicated. It's easier to copy it from a competitor who has proven success. See these links for information about decompilation. Of course, the best methods of decompilation are not made public:

    .NET Decompilers

    Java Decompilers

    A friend wrote this:

    "I regularly use decompilers for Java classes. The last library I decompiled is TupleSpace from IBM, a library for network communication (useful if doing clustering). The result was of a shocking clarity. :) Thank you IBM.

    "That was especially easy because the code had few local variables (in the bytecode, local variables have an identifier that is a number) and no obfuscation."

    2) Pseudo-compiled languages are slower. That raises the cost of hardware. Sun makes most of its money from selling hardware. Slower software requires more expensive hardware. Microsoft makes most of its money selling operating systems. The customers most important to Microsoft are not you and I. Microsoft's important customers are the systems builders like Dell and HP. Systems builders want slow software so they can sell more hardware. Microsoft wants slow software so people buy more systems and therefore more operating systems licenses.

  6. Re:"Co-opt Java" by yomegaman · · Score: 5, Insightful

    What are you talking about? Nobody uses java for "internet downloadable applications", or even intranet downloadable ones. Their vision of thin-client computing was shown to be a pipe dream, to everyone except you anyway.

    --
    ...wearing a skin-tight topless leather jumpsuit, with cutaway buttocks and transparent crotch panel.
  7. Re:"Co-opt Java" by 1010011010 · · Score: 3, Insightful


    That C# takes ideas from java is irrelevant. .Net and C# exist for exactly one reason: Bill Gates wanted to stop Java. Bill likes to have control. He couldn't tolerate Java, because it didn't allow him to have control.

    Maybe you like C#, maybe you don't. maybe it's useful for your project, maybe it's not. Those are side issues -- its role as a tool is secondary.

    DotNet performs the task for which it was designed very well. That task is, of course, to contain programming talent and effort within the Windows world. That DotNet better than VB and Win32 is fundamentally a testament to how awful VB and Win32 are.

    I'm not bagging C# or DotNet on their technical merits. They are not bed in that respect. But C# and DotNet's utility as development tools for Windows are only secondary to their utility as a means for maintaining Microsoft's control of the market.

    C# and DotNet are beautiful Gates on the prison of the computing world.

    --
    Napster-to-go says "Fill and refill your compatible MP3 player", which is a lie. It's not MP3. It's WMA with DRM.
  8. Re:"Co-opt Java" by kyz · · Score: 5, Insightful

    Java was designed to co-opt Smalltalk, or at least Sun brand it and bring it up to date.

    Think about it... Smalltalk's main points were the single root object heirarchy, the bytecode compilation, and the large runtime library including full GUI. Did C++ have this? No. It was more "object oriented concepts ported to C" - lean and mean, machine dependant and no standard GUI. The C++ generics and the STL weren't standard when Java arrived.

    --
    Does my bum look big in this?
  9. Re:"Co-opt Java" by matchlight · · Score: 4, Insightful

    But people DO say that Java was co-opted C++, including you and now .. me. Languages naturally progress from those that already exists like every other technology. Why reinvent the wheel and find out that squares don't work... over and over.

    Java is taking ideas from C# as well, just take a look at 1.5 with enums, yes I know they existed before C# but I think their existence in C# prompted the move.

    I just find it funny that pro-MS people often don't like to hear that C# could even possibly be an evolutionary step off of Java. And unlike older languages, Java itself is still evolving. The .NET runtime concept that works so much better than Java on a Windows machine is something that could exist for Java some day. C# might actually have a legitimately supported OS other that Windows, and although the Mono project is great, it ain't by MS.
    I've used both and the both work and they'll both change... for a while ... then another will come along.

    I wounldn't try to find religion in a programming language, they come and go too quickly.

  10. Re:oh, and what's the next release of Java have? by Shados · · Score: 4, Insightful

    Bingo...and in the end, we programmers don't have 1, but -two- improved languages, as they try to improve to each other. MS trying to lock in their customers or not, Sun trying to control java or not...doesn't matter... Now we have 2 languages that try to improve on each other as fast as possible, and we win!

  11. Re:"Co-opt Java" by malakai · · Score: 4, Insightful
    Those are side issues -- its role as a tool is secondary

    Your comment is a fascinating insight into a fanatical mind. You may not yet be as bad as the guy that lives on the corner of my block, with the foil under his NY Yankees basball cap, but the distinction is small.

    You've esentially said C# and .Net may be a great language and framework, may make a developers life easier, may generate better application for our clients (internal and external)... but you don't like Bill Gates and therefore any and all points are moot.

    Wonderfull logic.

    Your prison/Gates metaphor-pun is wonderfully melodramatic as well.

    Thanks for play,
  12. Re:"Co-opt Java" by __past__ · · Score: 3, Insightful
    Without Microsoft spending years trying to undercut them it's very conceivable that Java would be the lingua-franca of the internet right now.
    Then thank god for microsoft. I am rather confident with an open-standards-based, multilingual internet as it is, even if it could have been better.
  13. worst C# drawback by iezhy · · Score: 3, Insightful

    most serious C# drawback is that it doesn't have (and probbably will never have) so rich and wide open source community like Java does (Apache group, Object Web group and many many many more...).

    Each tiny crappy component, each crappy lib for C# out there on the net is sold, and sometimes for outrageous prices (a month ago seached for a plugin to generate properties from variables - something like getter/setter generator macros, so common in most Java IDEs - found it for 100$ per seat! OMG!). there is no idea of sharing, neither the source nor experience, and this IMHO will be the main cause of C# setback.

    And oh, most computer literate people pronouce '#' as 'hash', not 'sharp' :-))

  14. Language/tools are secondary by teetam · · Score: 3, Insightful
    Why do people spend so much effort fighting over which tool/language is better? The whole question is secondary to me.

    The truth is - existing software quality sucks. There are a few exceptions, but there are too many poor quality products being shipped everyday sometimes costing millions of dollars. The fault is seldom with the tools or the language of choice.

    There are so many parts of the whole software development process that needs to be improved. With the right process, people and management it is possible to make great software regardless of the language.

    When automobile engineers argue, do they argue about the quality of their cars, their features and design or do they childishly bicker about which wrench is better?

    --
    All your favorite sites in one place!
    1. Re:Language/tools are secondary by Haeleth · · Score: 3, Insightful

      A higher level language does not make a program much saver or of better quality if the programmer is an idiot.

      So because a language might not prevent every stupid mistake a programmer might ever make, there's no point trying to help any programmer ever avoid any mistake?

      That makes no sense.

      Of course it's always possible to break a program. The point of higher level languages is that they make it harder to break programs. This is not so they can serve as a crutch for incompetent programmers - it's so that they can make competent programmers more productive. Sure, a good programmer isn't going to make many mistakes with pointers, but if the language they use provides ways to do things without using pointers at all, then they aren't going to make any mistakes with pointers.

      (Now, it's nice if the language also provides the pointers so they can use those where it's useful, but most of the things pointers are used for in C - array traversal, say - can be done just as efficiently with higher level constructs.)

      Want an analogy? Someone really skilled, with a really sharp eye and a really steady hand, could probably draw a perfectly straight line with pencil and paper. But professional draftsmen use rulers. I wonder why that is?

  15. Re:"Co-opt Java" by Brandybuck · · Score: 3, Insightful

    Your comment is a fascinating insight into a fanatical mind.

    Fanatical no. Cynicism spawned actions of Microsoft? Maybe.

    Despite whatever wonderful attributes C# and .NET have, they do not override the fact that the language and framework are under the control of Microsoft. All the people bitching at Sun's control of Java seem to just look the other way when .NET is mentioned. Who gives a rip that they've submitted it to some standards committee? Do you think Microsoft can't "embrace and extend" .NET? Do you think they don't have several dozen submarine patents ready to go?

    I'll believe the hype when I see a workable, usable, and complete implementation of .NET on any other platform besides Windows. I can take a Java app developed on Windows and run it on Linux, FreeBSD and Solaris. I cannot do the same for *ANY* .NET application.

    Microsoft wants developer writing Windows-only applications. .NET is one tool they are using to accomplish this.

    --
    Don't blame me, I didn't vote for either of them!
  16. Re:Nice language, bad motives by prockcore · · Score: 4, Insightful

    why trust your development to a language designed to lock you in to Windows? C#, for all its niceities is just a way of getting you to buy more Windows 2003 Server licenses.

    C# is just a language, it doesn't lock you into Windows at all. Mono supports the entire C# language.

    It's the classes you choose to use that lock you onto a specific platform.

    You can't blame C# if people want to use classes that aren't available on other platforms.

    Its like saying that C++ sucks because DirectX doesn't work on Linux.

  17. Re:Why does C# have redundant syntax? by ctlajoie · · Score: 3, Insightful

    Personally, I like the 'new' keyword. It makes it very clear where an object is being instantiated, and not just assigned through a function (that's what var = Type(args) looks like to me).

    Also, C# allows the core types to be allocated on the stack. Here is a line I pulled from my code:
    byte* buffer = stackalloc byte[256];

    stackalloc can only be used inside an unsafe context.

  18. What did they miss about checked exceptions by 21mhz · · Score: 4, Insightful
    I must say he doesn't seem to grok exceptions very well.
    Anders Hejlsberg: The scalability issue is somewhat related to the versionability issue. In the small, checked exceptions are very enticing. With a little example, you can show that you've actually checked that you caught the FileNotFoundException, and isn't that great? Well, that's fine when you're just calling one API. The trouble begins when you start building big systems where you're talking to four or five different subsystems. Each subsystem throws four to ten exceptions. Now, each time you walk up the ladder of aggregation, you have this exponential hierarchy below you of exceptions you have to deal with. You end up having to declare 40 exceptions that you might throw. And once you aggregate that with another subsystem you've got 80 exceptions in your throws clause. It just balloons out of control.

    Well, if you're a Java programmer worth your salt, you DON'T propagate every exception class the underlying modules might want to throw. You make your code catch exceptions rising from below and either handle them or massage them into the exception set your module exports. This is much better for the upper-level users because they want to deal only with situations raised by, and meaningful for, the APIs at hand, and they don't have to care about what would brew beneath.
    If you don't want to lose exception stack information, as of J2SE 1.4, you can chain an original exception to your higher-level exception, so that everything would be rolled down nicely in a trace printout.
    --
    My exception safety is -fno-exceptions.
    1. Re:What did they miss about checked exceptions by aziraphale · · Score: 3, Insightful

      Oh, he understands, alright. Object oriented programming is all about exposing clean programming interfaces, and what exceptions your objects' methods throw are as much a part of those interfaces as their parameter lists and return types. The point of interfaces is that they abstract you away from implementation. When I call a method called getWeatherForecast(), I want it to return me the weather forecast, or throw me a WeatherNotAvailableException. I don't want it to sometimes throw a DbException because it had to go and talk to a database, or sometimes an IOException because it's reading from a cached file, or sometimes throw a NetException because it's talking through a socket, or sometimes throw a SoapException because it's trying to reach a web service. None of these things are of any possible interest to my code - I have no interest in considering how that component is going about its business of getting me a weather forecast. Were you never taught to consider objects as black boxes? The implementation of an object's method is not the concern of the calling code, and that is why we wrap exceptions. All the time. Now, it may be that the WeatherNotAvailableException might have some information attached to it that could be of use to a human troubleshooting the source of the lack of availability - but this information should be contextually relevant. Randomly propagating exceptions from inside the black box of a method are not contextually useful. so, I call getWeatherForecast() and I get back a SocketException: 'The host could not be found'. Great. That's meaningless to my code. It doesn't know what host the method was trying to reach, nor is it really interested. A WeatherNotAvailableException saying 'The weather service at http://weather.example.com/ could not be reached' would be a lot more useful.