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

82 of 391 comments (clear)

  1. "Co-opt Java" by tealover · · Score: 2, Informative

    I believe that was the mandate given Hejlsberg by Gates.

    --
    -- You see, there would be these conclusions that you could jump to
    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. 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
    3. 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.

    4. 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.
    5. Re:"Co-opt Java" by tealover · · Score: 2, Informative

      I use them on my cell-phone daily. It appears you're still thinking in terms of desktop applications. You better start thinking in the now before you become obsolete.

      --
      -- You see, there would be these conclusions that you could jump to
    6. 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.
    7. 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?
    8. 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.

    9. 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,
    10. Re:"Co-opt Java" by 0WaitState · · Score: 2, Insightful

      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.

      Uh, no. Enums' existence in ansi C and C++ prompted the move, given the large number of developers who work in both C/C++ and java, who know from real-world experience that enums improve maintainability and reliability of code.

      --

      Remain calm! All is well!
    11. 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.
    12. Re:"Co-opt Java" by 91degrees · · Score: 2, Insightful

      Yeah, but Java existed because Sun wanted to have control, and was simply an attempted coup to sieze control from Microsoft. The Apple Mac existed because Apple wanted to control desktop computing.

      Most companies want to dominate the market. The difference is that for the vast majority of them, market domination is a ludicrous concept.

    13. 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!
    14. Re:"Co-opt Java" by blincoln · · Score: 2, Interesting

      Nobody uses java for "internet downloadable applications", or even intranet downloadable ones.

      Retek does, and it's one of - if not *the* - most popular set of apps for the backend of the retail industry in the US.

      --
      "...always new atoms but always doing the same dance, remembering what the dance was yesterday." -Richard Feynman
    15. Re:"Co-opt Java" by Anonymous Coward · · Score: 2, Informative

      Your arguments on Java are baseless. Java was originally designed to be as an appliance/emmbedded application development system. The problem was they couldn't get anyone interested at the time they originally developed it so they decided that "Hey, this internet thing is getting some publicity, let's use it there." Ten years later, it's finally starting to get used for what it was originally intended: cell phones, ATM's, etc.

    16. Re:"Co-opt Java" by Anonymous Coward · · Score: 2, Interesting

      Sun's Java Desktop System seems to be doing quite well.

      10,000 to the United India Insurance Company, 500,000 to 1,000,000 per year to the China Standard Software Co, and approval from the UK government for a 5 year purchase agreement.

      Downloadable Java applets seem to be doing quite well on the internet, including for games, custom user interfaces, security applications, etc.

      At the company I work at, one of our main design tools is a java application that you just copy from the server (essentially download) and run. The developers came from another company where they were doing the same thing.

      NASA is using Java to control the Mars Rovers, and track satellites.

      More and more tools built by Computer Science researchers are in Java, like this Bayesian Network tool, or are switching from other languages to Java, like this static program verification tool.

      In short, I think you completely missed it with your answer.

  2. Interesting Hejlsberg article by Anonymous Coward · · Score: 5, Informative

    There a great interview with The father of C# here too,

  3. Interview on the .NET Show by enkafan · · Score: 5, Informative

    There is a pretty good interview on the .NET show on MSDN with Anders too. It runs about one hour, so get a comfy chair.

  4. More about Anders Hejlsburg by atlasheavy · · Score: 4, Informative

    Joel Spolsky published a great article a while back on .Net, his company's strategy for the platform, and why Anders so damn cool. Also, just in case you're curious as to how his last name is pronounced, it's pronounced hells-burg.

    --

    iRooster, the Mac OS X a
    1. Re:More about Anders Hejlsburg by The_DOD_player · · Score: 5, Informative

      Also, just in case you're curious as to how his last name is pronounced, it's pronounced hells-burg.

      No, it most certainly is not!
      First its Hejlsberg, not Hejlsburg. "Hejl" is pronounced just like "Heil", as a german would in a WW2 movie :). "berg", the "g" is more or less mute, so it pronounced more like "bear".
      So its "Heils-bear"

    2. Re:More about Anders Hejlsburg by bolind · · Score: 3, Informative

      It's Hejlsberg, and it's pronounced more like "heil-s-bear", heil as in "sieg heil" or "tile".

      I should know, as we come from the same country.

  5. Here's a direct link to the Artima articles... by tcopeland · · Score: 5, Informative

    ...right here to save you a click thru the MSDN page.

  6. Re:How and Why C# Was Made by atlasheavy · · Score: 5, Interesting

    Microsoft starts trying to tell people that "OO is soo... yeasterday. You want Indigo."

    You're referring to Don Box, specifically, right? I don't think it's so much that Don is pooh-pooh'ing OOP in general, it's that he feels that a service-oriented architecture is better suited to the kind of problems we face today than DCOM or CORBA. His point is that trying to use an OOP metaphor for enormous, architecturally sound remote object invocation/data transfer systems is a terribly complex task.

    Also, keep in mind that Don wrote *the* book on Microsoft's COM technology; OOP has its place, but CORBA and DCOM are not really the place.

    --

    iRooster, the Mac OS X a
  7. How C# was made by moronga · · Score: 4, Funny

    They hit the black key to the right of C.

    1. Re:How C# was made by jhines · · Score: 2, Funny

      It sounds better than D-Flat, at least to the marketing droids.

    2. Re:How C# was made by chromatic · · Score: 5, Funny

      I thought my amplifier was cool for going up to 11, but it can't compete with a piano that goes up to W!

  8. 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 JohnnyCannuk · · Score: 3, Informative

      ...uhmm

      Go here and when you done, go here and get it.

      When you are done playing, come back and see if your post makes sense.

      --
      Never by hatred has hatred been appeased, only by kindness - the Buddha
    2. Re:Sun Should Embrace and Extend by aled · · Score: 2, Interesting

      Of all the features that C# has the only I would like to see in Java is explicit override. Fortunately there is a proposal for incorporating that with the metadata support in 1.5. The other features I want off of my projects.

      --

      "I think this line is mostly filler"
    3. 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.

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

  10. Re:does c# matter to any one by Sabalon · · Score: 3, Interesting

    C# may not be that great compared to C++ or Java. But what .net provides is pretty nice.

    My officemate wrote a function in vb.net on a Windows box, running via ASP.NET/IIS/Win2k. I wrote a small little C# program on my Linux box that calls the procedure on the windows box. It looks something like this:
    result=addup(2,5);
    with 7 being put in result. Nice and simple. Could have easily been something to add a user to a box...or I could reimplement the same function on my Linux box to add a user there and he could call it from an vb script.

    It does a great job of providing cross platform calls without adding tons of overhead or a lengthy API...the libraries do all the setup/teardown instead of the programmer, and it is a lot cleaner than parsing html output.

    It may not be perfect, but I'm just sporting a woody because I finally somewhat understand what the hell the nebulous .net is partially supposed to be...all thanks to Mono.

  11. Anders leaving Borland - a blessing in disguise ? by gmania · · Score: 2, Interesting

    Having used TP and DelpiI was kind of disappointed to see Anders join Microsoft a few years back. But now behold .... Delphi 8 adopts quite nicely to .net and is actually giving Borland a new lease on life and delivering where Kylix couldn't.

    Having used both java and delphi I allways missed some sort of generics. I found Anders thoughts to be quite interesting. Question: is it possible to change the java generics-implementation in such a way that it would loose the limitations mentioned (and changing the JVM in the process offcourse)?

  12. Checked Exceptions by po8 · · Score: 4, Informative

    Actually, Java supports both checked and unchecked throwables: the latter with the class Error. My programming style is to make throws that I don't expect to be "routinely" caught throw Errors rather than Exceptions. An Error can still be caught, but since you don't expect it, you needn't declare it.

    The checked exceptions are still useful for the case where it would probably be a bug not to handle the exception, e.g. "search found no element" or "file not found". The reason for the two kinds of throwables is exactly this: you don't want to declare that every method doing division throws DivideByZero. Unfortunately, the Java library designers don't seem to have gotten it, and so there's a bunch of things like IOException that IMHO should have been Errors.

    1. Re:Checked Exceptions by AndyS · · Score: 2, Interesting

      I think you probably want RuntimeException rather than Error - error is meant to be things like 'OutOfMemory' or 'LinkingError'

      NullPointerException is a runtime exception for example, and so is ClassCastException.

      If you want to squash IOExceptions then just wrap them in RuntimeExceptions - ie

      try {
      blah;
      } catch(IOException ioe) { throw new RuntimeException(ioe); }

      - but I'd wager that there might well be some remedial action you can take other than this.

      There are cases that go the other way - for example, Integer.parseInt() raises a RuntimeException when it should actually be a checked exception. I think there's a fairly pitched battle about this at Sun.

    2. Re:Checked Exceptions by Anonymous Coward · · Score: 5, Informative

      Java supports both checked and unchecked throwables: the latter with the class Error.

      Unchecked exceptions should be derived from the RuntimeException class. Generally subclasses of Error are not meant to be caught ("An Error is a subclass of Throwable that indicates serious problems that a reasonable application should not try to catch" - from the Javadoc for Error).

      you don't want to declare that every method doing division throws DivideByZero

      That doesn't throw an exception/error at all, it returns NaN.

      there's a bunch of things like IOException that IMHO should have been Errors

      IOException is something that needs to be checked. It can occur because of low disk space, broken network connections (including NFS mounts), bad character coding, etc. Even FileNotFoundException is a subclass of it.

  13. Wake up and smell the marketing bullshit! by Anonymous Coward · · Score: 4, Interesting
    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).

    For fucks sake, man! Wake up and smell the marketing bullshit. The most innovative impressive thing about Java was that it was successfully marketed as basically the second coming (more tangibly as the solution to 10 different huge problems), all while just being another platform. Get it? They created their own platform without hardware leverage, OS leverage, app leverage, etc. It's bootstrapping by marketing.

  14. Because pseudo-compiled languages are better.. by leerpm · · Score: 2, Insightful

    In many cases, pseudo-compiled languages, or languages that use a VM are a better choice. No worrying about memory management, buffer overflows, etc.

    There will always be a place for C and C++ in places where you *NEED* low-level control over things like memory management, or where performance is very critical. But for most applications, this is simply not the case. You want a language that can do all you need it to do, and you don't want to worry about the rest of the details. Java and C#/.Net are the next big thing in commercial programming. But they certainly won't be the last. There will be another language that is better in 10 years from now. But right now it is a good thing that we have two choices, instead of one. Competition is a *good* thing.

    1. Re:Because pseudo-compiled languages are better.. by Scott+Wood · · Score: 2, Informative

      You can get garbage collection and array bounds checking in fully compiled languages (such as D), too.

      And you'd better still worry about such things to a certain extent, or else you'll be throwing exceptions on legitimate usage cases when your fixed-size buffer turned out to be too small, running out of memory because you didn't bother nuking references to old objects, etc.

  15. Re:Why do big companies want pseudo-compiled langs by sik0fewl · · Score: 2, Insightful

    Well, pseudo-compiled languages is hardly a "big company" thing. Look at Python for instance. It's all over the place (in the open source world).

    --
    I remember when legal used to mean lawful, now it means some kind of loophole. - Leo Kessler
  16. Re:How and Why C# Was Made by cybermace5 · · Score: 2, Funny

    I think the old adage needs to be updated: If you want to eat sausage, obey the laws, and use C#, you should never watch them being made.

    --
    ...
  17. Re:How and Why C# Was Made by AndroidCat · · Score: 2, Funny
    Don wrote *the* book on Microsoft's COM technology

    Another one? But I haven't finished Brockschmidt yet! :)

    --
    One line blog. I hear that they're called Twitters now.
  18. Re:Why do big companies want pseudo-compiled langs by tcopeland · · Score: 2, Insightful

    > it is easy to see the logic by just
    > decompiling the source code.

    You mean bytecode, probably.

    > the business systems logic can be
    > EXTREMELY complicated

    If it's that complicated, having a bunch of decompiled source code is not going to be that useful. You're better off programming it yourself so you understand it and can change it when you need to.

    > Pseudo-compiled languages are slower.

    But not _much_ slower. A $3K dual CPU Linux server can serve up a lot of Tomcat hits. Need more? Buy a load-balancer and a few more servers. Not a big deal.

  19. Re:Why do big companies want pseudo-compiled langs by aled · · Score: 2, Interesting

    That's the biggest FUD I have seem so far. Your talking about "pseudocompiled" makes me think you don't know how either language really works.
    OTOH I agree that both are relative simple to decompile.
    The speed will depend of your particular use, but in some cases programs in Java are faster than C programs.

    --

    "I think this line is mostly filler"
  20. Nice language, bad motives by E.S+Taog · · Score: 2, 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.

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

  21. Re:How and Why C# Was Made by rdean400 · · Score: 2, Insightful

    Your 4.5 is wrong, and even in a world in which it made sense, it'd still be wrong. Sun's whole marketing mantra around Java was "Write Once. Run Anywhere." Allowing platform-specific extensions would break that, so it's an obvious non-starter. Sun's reaction wasn't correct, but it was an allowable one.

  22. Re:How and Why C# Was Made by thasmudyan · · Score: 2, Insightful

    .NET is usable, but Java is something horrific.

    I wonder why .NET-bashers never get modded down but anyone who dislikes Java goes to karma hell, LOL...

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

  24. They lie! by dexterpexter · · Score: 5, Funny

    Gonna burn some karma on this...

    Gandalf: This is C#. Forged by the Dark Lord and his engineers in the fires of Mount Redmond. Taken by him from the hand of evil himself. All who use it are bound to him. Gates needs only this ring to cover all the lands of a second darkness... He is seeking it, seeking it; all his thought is bent on it.

    Frodo: Alright, we put it away. We keep it hidden. We never speak of it again... No one knows its here, do they? Do they, Gandalf?

    Gandalf: Unfortunately, yes. The power of Gates is far reaching. The innocent would use C# from a desire to do good, but through them, it would wield a power too great and terrible to imagine.

    You get the idea... ;) And yes, I am just teasing.

    --

    *-*-*-*-*-*-*-*
    "We are Linux. Resistance is measured in Ohms."
  25. missing the point, but it doesn't matter by ajagci · · Score: 5, Informative

    I think on many issues, Hejlsberg is missing the point and the reasons he gives aren't necessarily the actual reasons why particular design tradeoffs are good ones.

    But it really doesn't matter. The changes that C# made relative to Java are obvious and proven (e.g., value classes, removal of statically checked exception declarations, declared unsafe code sections). Many of them had made Sun's bug parade. All of them had been in other languages before either Java or C#. In fact, C# is, in many ways, close to Modula-3.

    There seems to be another reason for some of the design decisions: patents. Sun has patents on several aspects of the JVM and Java, and if Microsoft wanted to be free of potential future claims by Sun, they had to avoid those in their own competing virtual machine.

    Keep in mind that Hejlsberg is also a salesperson for the language anyway. That means that he may not be telling you the real reasons behind design decisions, but the reasons that sell the language well.

    In any case, however it came into existence, C# is a somewhat better language than Java, and we should be happy about that: whether you are planning on using C# or not, it raises the bar for what is considered standard in industry. Without C#, Sun probably wouldn't even have made the largely cosmetic changes they made to Java in 1.5, and maybe the continued existence of C# will force them to fix other misfeatures of Java and the JVM in future versions. And C# (but not .NET) may turn out to be the free and open language that Java should have been; time will tell.

  26. Re:Why do big companies want pseudo-compiled langs by prockcore · · Score: 4, Interesting

    1) Pseudo-compiled languages are easily decompiled.

    Um, compiled languages are easily decompiled as well.
    http://hte.sf.net is a badass hexeditor/disassembler.

    Case in point, I walked through the assembly of iTunes to figure out the AES key that iTunes uses for iTMS. And iTunes was written in C++.

  27. Re:How and Why C# Was Made by Reality+Master+101 · · Score: 2, Insightful
    I don't think C# was created to compete with Java at all (as others have pointed out, interpreted languages have existed for a long, long time).

    But say it was. Who cares? Every language is based to some extent on what came before it. The question is, does it improve on other languages? Does it have a niche that it serves better than other options?

    In this case, the answer is yes. Java is horrible kludgy in a lot of ways, and yes, it's horribly slow for large applications (although, small benchmarks can hide it's slowness). And no, I don't want to debate yet again the merits of Java. I think it sucks. If you think otherwise, more power to you. I'm glad it works for you.

    --
    Sometimes it's best to just let stupid people be stupid.
  28. 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' :-))

    1. Re:worst C# drawback by enkafan · · Score: 4, Informative

      Here's your macro: http://weblogs.asp.net/jan/archive/2003/04/29/6168 .aspx
      There are plenty of people working on tons of free libraries out there. The gotdotnet workspaces are pretty good place to search for things, but your best best is to follow the weblogs on asp.net.

    2. Re:worst C# drawback by Bazouel · · Score: 3, Informative

      Ever bothered to look at http://www.codeproject.com ??

      How about you write your own getter/setter macro and publish it there ? That is how a community is built, slowly but surely.

      --
      Intelligence shared is intelligence squared.
    3. Re:worst C# drawback by aderen · · Score: 2, Informative

      You can download vs.net property generator for free from my site http://www.adersoftware.com/index.cfm?page=vsPrope rtyGenerator
      no source code included, but if you need it, I can email that to you.

  29. 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 91degrees · · Score: 2, Insightful
      It's a good point, but the language can make a difference. C has a lot of potential for error that a higher level language just doesn't have; the most obvious example being strings. In C, to concatenate 2 strings, you might type
      char *s1 = "The quick";
      char *s2 = "Brown fox";
      s1 = strcat(s1,s2);
      Which could crash, or foul up data (or possibly do nothing) because you're writing over the end of a pointer. A high level language will have strings as a built in type. Concatinating them will simply create a new string. This sort of error is simply impossible to make happpen in a lot of high level languages.

      A programming language is a lot more than just a tool. The language you choose will affect the end product quite substantially.
    2. Re:Language/tools are secondary by voodoo1man · · Score: 2, Insightful
      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.

      There is no such thing as the right process, there is no such thing as the right people, and there certainly is no such thing as the right management, because none of these things can be designed. On the other hand, tools can be designed and implemented to perform optimally, and it is not all that hard to do so. The efficiency gained by using such tools will cover their cost many times, and this is not even considering the psychological effect of craftsmanship that I will discuss below.

      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?

      A universal quality of nearly all craftsmen is pride in their tools, because almost all craftsmen are overwhelmingly dependent on them (and with some this starts to approach symbiosis). Automobile designers don't argue about wrenches, because they don't use them. Mechanics argue about wrenches. Automobile designers argue about CAD systems.

      Why do people spend so much effort fighting over which tool/language is better?

      The fact that in this case the tool is the language answers your question. Why do you think the Quebecois resist the anglicization of their language so strongly? Or how about Esperanto? Another thing you should consider is that despite computational universality, the Sapir-Whorf hypothesis applies much more strongly to most programming languages than to natural ones because there is no way to introduce new concepts into those languages.

      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.

      Just as the fact that a plumber installed your toilet improperly is seldom the fault of his tools. The question now is how do you propose to improve the result of the end product? There is only a finite amount of capable people to do the job (and I believe that this number grows arithmetically while the general population grows almost exponentially). You can't select good "management" (if it even exists), because you cannot choose your own boss. Despite what you imply, process is a function of people and tools, and not some fixed, abstract plan. The only thing you can change quantitatively for the better is tools.

      --

      In the great CONS chain of life, you can either be the CAR or be in the CDR.

    3. Re:Language/tools are secondary by globalar · · Score: 2, Informative

      "There are so many parts of the whole software development process that needs to be improved."

      Completely true.

      In a time when tools are myriad, code can be found for free, and the Internet archives and Google searches lessons and tutorials for us, software developement is crazy. And its funny and ironic that the most essential part to software developement, the developement (it's process: the drafting, coherent, problem-solving design, habitual testing and review, documentation, etc.) is seen as expendable!

      Someone somewhere once had the great idea to cut back in software developement - make an unrealistic timeline, change the project's goals and pretend the code will reflect those changes, switch people in and out during developement like nodes in cluster, outsource, skip some testing or only test what you know works, etc.

      You are right. Programmers, engineers, etc. can make wonders with far fewer resources, capable tools, and little financial incentive. But without some sense in the process, without a plan to succeed and solve problem(s) with this software (especially adherence to the plan), whatever wonders may have been created are lost in bad habit. So what happens in a lot projects (probably the majority)? Let's buy more resources, more capable tools, and dump other things into the developement.

      Fifth grade, I had a teacher who made us repeat a short sentence to her everytime we "forgot" to do our homework:

      "Mrs. H, I failed to plan to succeed."

      And everytime we said it, it was true.

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

  30. Why does C# have redundant syntax? by pbridger · · Score: 2, Interesting

    One thing I've never seen explained in any of the designer interviews on C# or Java is why they both have the redundant 'new' keyword.

    Neither language allows you to create objects on the stack, so using new to denote 'on the heap' is completely redundant.

    Also, why can't language designers take hints from the *productive* languages as well as the *popular* ones.
    I'm not saying that good programming is a speed typing contest, but modern, popular languages require far too many key presses to get stuff done.

    C#/Java
    Type varName = new Type(args);

    Python:
    varName = Type(args)

    Want static typing? Why not type inference like OCaml?
    Damn them.

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

    2. Re:Why does C# have redundant syntax? by aziraphale · · Score: 2, Informative

      Actually, it's worse than you think...

      int i = new int(1);

      No heap allocation has occurred, we've just allocated an int32 on the stack and dumped the output of the int32 constructor into it. That new keyword is really just an indicator that tells us we're calling a constructor.

      And how about this:

      int[] ints = {1, 2, 3, 4, 5};

      That just allocated a new heap object, and there's no new keyword in sight...

      (Before anyone argues that that's just like string s = "hello", it isn't... string literals are constants, they're pulled out of the interned string pool when they're referenced. Array literals like the one above are created in bytecode on the fly.)

  31. Re:oh, and what's the next release of Java have? by Panix · · Score: 2, Informative

    Unfortunately, Java gets most of these features at a superficial level, since it has to support older VMs. Sun sees that C# has these things and that developers want them, so they give them as much of the syntactic advantage as they can without "breaking" their older VMs... its really a shame.

    The Microsoft CLR has support for many of these features (and others) built into the underlying framework. As a result, things like Generics in C# are about a hundred times as functional and advantageous than they are in Java. Read the article that was linked to in this story, and it will readily become clear that Java is playing catch up at this point. The C# creators really thought of these things *up front* and designed the framework for them, and it really shows.

    One of the best examples of this in the interview is that of generics. In C#, if you declare a List of Customers (List), you can see that all the way down to the Reflection/introspection level. It really, genuinely is a List of Customers. However, in Java, because they have to live with their inferior framework, a List of Customers at the Reflection level is a List of Objects... hence, its just an illusion. You get the type checking at compile time, but lose performance advantage and true Generics support.

    Thank God for the folks at Ximian though! I really like much of the .NET development framework, and now I can use it on UNIX based systems. I am still waiting for a nice release that will fully run on Mac OS X though.

  32. Templates are strong typed in C++ by Kupek · · Score: 5, Informative

    C++ is the opposite. In C++, you can do anything you damn well please on a variable of a type parameter type. But then once you instantiate it, it may not work, and you'll get some cryptic error messages. For example, if you have a type parameter T, and variables x and y of type T, and you say x + y, well you had better have an operator+ defined for + of two Ts, or you'll get some cryptic error message. So in a sense, C++ templates are actually untyped, or loosely typed. Whereas C# generics are strongly typed.

    I disagree with that assessment. Both C# and C++ generics/templates are strongly typed. It's just that the enforcement happens in different places.

    In C++, if you try to stick a class into a templated class when that class doesn't have a particular member function defined, the compiler will yell at you, just like Hejlsberg said. But for some reason, this doesn't count as type checking? Yes, template error messages can be strange (and very long) if you're not familiar with them. But that's just a lesson in "know your tools."

    To me, "strongly typed" is strict type enforcement at compile time. C++ templates certainly do this.

    Constraints, however, are something that I think are a generally good idea. Stroustrup's reasoning for not including them in C++ was that "Requiring the user to provide such information decreases the flexibility of the parameterization facility without easing the implementation or increasing the safety of the facility." (The Design and Evolution of C++, Stroustrup, 343).

    He does, however, show an interesting way to get around this using inheritance:

    template <class T>
    class Comparable {
    T& operator=(const T&);
    int operator==(const T&, const T&);
    int operator<=(const T&, constT&);
    int operator<(const T&, const T&);
    };

    template <class T : Comparable>
    class vector { // . . .
    };

    (The D&E of C++, Stroustrup, 344)

    This technique is similar to how C# does constraints, class List where T: IComparable. One is supported and enforced by the language, the other is a natural consequence of the languages facilities. In general, I think that constraints are probably a good thing. Having an error message like "Can not instantiate class Y<T> because T does not implement z()" is probably best, and when looking at a class' declaration, it would be nice to see up front what assumptions the templated class makes.

    1. Re:Templates are strong typed in C++ by code_martial · · Score: 2, Interesting

      Constraints, however, are something that I think are a generally good idea.

      Stroustrup seems to be thinking of them for C++0x. See this paper, for example, from the C++ Standards Committee papers.

  33. Re:How and Why C# Was Made by rufusdufus · · Score: 2, Interesting

    There is history before java that matters too; Such as Microsoft had its own processor independant P-Code compiler nearly a decade before java, but kept it private probably as a competitive advantage. This is a cold irony.

    Microsoft was worried about java even before it became popular; for the simple reason that if a portable internet language did become popular, it would obviate the need for windows.

    Microsoft did not get their hat handed to them when they attempted to co-opt java: seems to have worked nicely.

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

  35. Re:Why do big companies want pseudo-compiled langs by Glock27 · · Score: 2, Interesting
    It seems to me that big companies like Sun and Microsoft like pseudo-compiled languages like Java

    I guess you've not heard of gcj, TowerJ or the other traditional ahead-of-time compilers for Java, eh?

    Java is not necessarily a VM based language - that's not to say that VMs aren't useful in lots of situations. Obfuscators also often work well. Of course, if you're doing server-side code, decompilation isn't an issue at all...

    Nice straw man though... ;-)

    --
    Galileo: "The Earth revolves around the Sun!"
    Score: -1 100% Flamebait
  36. Re:Its not redundant by hobuddy · · Score: 3, Informative

    In your example, I know with complete certainty that I am creating a new "Type" and assigning it to the variable "varName". This is not the case if it used the syntax of Python. How do you know I am not calling a method called "Type"?

    You don't know, and you shouldn't.

    Suppose at first you do, in fact, instantiate a new object via the 'Type()' call. Later, during the optimization phase, you discover that in most cases you can return a reference to a pre-existing, pooled object. In Python, you can make that change without breaking client code; not so when object creation is explicitly annotated.

    As to whether Type is a method, function, or class constructor, it doesn't matter as long as the returned objects implement the required interface.

    --
    Erlang.org: wow
  37. Downloadable applications by maxgilead · · Score: 2, Interesting

    You should be much more careful with 'nobody' word.

    As my first-hand experience I can say that we use Java for both server and client side for corporate software and yes, it's downloadable application. Excellent solution if you ask me, trivial to update, secure, portable and very nice environment for developers too.

  38. Re:Its not redundant by DrEasy · · Score: 2, Insightful
    Exactly! Alternatively, you could use the Smalltalk idea of making new() a static method. No need for a special syntax for creating an object!

    You would then have something like this in Java:

    Type myType = Type.new(); //invokes Type's static new() method

    And of course you should feel free to override the implementation of new(), just like you would do it in any constructor. No more need for messy super()... Oh but static methods in Java can't inherit behavior? Because classes aren't considered as objects? Doh! How very object-oriented... (end of sarcasm)

    In any true object-oriented language, you should be able to write almost everything as object.method(argument), and this is not the case with Java unfortunately...

    --
    "In our tactical decisions, we are operating contrary to our strategic interest."
  39. Constraints on type parameters by Anonymous+Brave+Guy · · Score: 2, Interesting

    AIUI, the major reason many of the big names in C++ don't like language-supported constraints on type parameters is that just having "derives from this base class" isn't a sufficiently general condition for good support of generic programming.

    C++ enforces any necessary interfaces at compile-time, by checking whether the instantiation of a function template can be interpreted properly with the functions available. Requiring every class that supports == to derive from EqualityComparable is just a cumbersome extra for no benefit in a generic, C++ based world, where there are more ways to define and implement interfaces than just inheritance. If it doesn't support ==, the function template will fail to compile at the point of instantiation anyway. (OK, strictly speaking export messes up the compile-time/link-time distinction slightly, but the basic point is still valid.)

    Incidentally, it is possible to use template wizardry in C++ to enforce various plausible constraints on type parameters if you really want to restrict them more than their usage within the function template does anyway, perhaps to guard against a possible misinterpretation of the template code in some cases. It's relatively straightforward to do this, and requires little more code than the formal constraints used by some of the other languages under discussion.

    --
    If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
  40. If Anders would just return the favor... by fm6 · · Score: 2, Funny

    Now we only need for Anders to write an article explaining why Spolsky is such a jackass...

  41. wrong analysis by ajagci · · Score: 2, 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...)

    It is true that there is more open source server-side web stuff for Java than there is for C#. But, against that, you have to hold that C# actually has a full-featured, high-performance, compatible open source implementation. Also, you can get a full-featured, open-source, widely-used GUI toolkit for C#, namely Gtk#.

    And all that open source Java stuff doesn't really matter as long as Sun owns key parts of the platform (e.g., the Swing implementation). Yes, you can exchange open source Java libraries all you want, but Sun has ultimate control.

    Each tiny crappy component, each crappy lib for C# out there on the net is sold,

    No, it isn't. You are thinking .NET components. .NET and C# are two entirely different things. There is a lot of open source C# software out there (check go-mono.com).

    What you should really be asking if you are interested in open source is: if I only use open source tools, how do the two software platforms compare? And if you only use open source tools, Java looks like a pretty sad platform: you can choose between Kaffe, orp, and gcj as runtimes, but none of them are anywhere near complete and most open source Java libraries don't run on them. You can't even get a working open source Swing implementation. In comparison, C# is much further along: Mono has a lot of the .NET APIs implemented, and, additionally already has a complete set of open source toolkits and libraries, with APIs that, unlike the Java stuff, are already familiar to existing open source programmers.

  42. How C# Was Made by cfuse · · Score: 2, Funny

    Wasn't it just done by covering one of the holes and blowing down the tube?

  43. Brief Historic Note by j.leidner · · Score: 2, Informative
    "After 13 years with Borland, Hejlsberg joined Microsoft in 1996 [...]"

    If you remember what happened a while ago, the story goes: Microsoft was facing competition from Borland, so they hired away all their lead developers to break the company's neck.

    It almost worked.

    PS: Don't use anything that has a '#' in it and isn't music!

  44. Re:I'm sorry by pmorrison · · Score: 2, Interesting

    There are people besides Gates who might disagree with your opinion of goto. Read what Steve McConell has to say in his -balanced- portrait of goto: http://www.stevemcconnell.com/ccgoto.htm

    Notice that one of goto's defenders (for appropriate circumstances) is none other than Don Knuth.

    I generally avoid goto like the plauge... but sometimes it's the right tool for the job.