Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror
×
Programming IT Technology

How C# Was Made 391

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

How C# Was Made

Comments Filter:
  • by atlasheavy ( 169115 ) on Saturday February 07, 2004 @04:45PM (#8213750) Homepage
    Microsoft starts trying to tell people that "OO is soo... yeasterday. You want Indigo."

    You're referring to Don Box [gotdotnet.com], 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.
  • by Sabalon ( 1684 ) on Saturday February 07, 2004 @05:11PM (#8213905)
    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.
  • by gmania ( 687303 ) on Saturday February 07, 2004 @05:12PM (#8213907)
    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 [artima.com] 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)?
  • by Anonymous Coward on Saturday February 07, 2004 @05:19PM (#8213965)
    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.

  • by aled ( 228417 ) on Saturday February 07, 2004 @05:30PM (#8214020)
    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.
  • by aled ( 228417 ) on Saturday February 07, 2004 @05:35PM (#8214046)
    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.
  • by AndyS ( 655 ) on Saturday February 07, 2004 @05:46PM (#8214127)
    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.
  • by prockcore ( 543967 ) on Saturday February 07, 2004 @06:11PM (#8214284)
    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++.
  • by pbridger ( 741768 ) on Saturday February 07, 2004 @06:52PM (#8214548)
    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.
  • by Anonymous Coward on Saturday February 07, 2004 @07:00PM (#8214606)
    If the caller is not doing anything wrong and yet the request cannot be fulfilled, then the method should throw checked exception. E.g.

    createFile("foo.txt"); // assuming this creates the file correctly.
    FileReader = new FileReader("foo.txt");

    Here, user did nothing wrong. Yet, user can get error (e.g. someone deleted file before FileReader constructor called). In this case, the method needs to tell user, what went wrong. This requires checked exception.

    OTOH, there are cases, where user did plain stupid things. It is the caller's error. E.g.
    Hashtable h = new Hashtable();
    h.put(null, null);

    The api spec clearly says, that you can't have null value. The "put" method need not declare this exception. The user could have avoided this error entirely on its own. This is unchecked exception.

    I abosultely disagree with C# developer on this issue that checked exceptions are not needed. I think this is one of the most strongest features of java.
  • by rufusdufus ( 450462 ) on Saturday February 07, 2004 @07:28PM (#8214779)
    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.
  • by Glock27 ( 446276 ) on Saturday February 07, 2004 @08:13PM (#8215050)
    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... ;-)

  • by maxgilead ( 243900 ) on Saturday February 07, 2004 @09:13PM (#8215406)

    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.

  • by code_martial ( 625004 ) on Saturday February 07, 2004 @09:50PM (#8215617) Homepage Journal
    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 [dkuug.dk], for example, from the C++ Standards Committee papers.
  • Re:"Co-opt Java" (Score:3, Interesting)

    by blincoln ( 592401 ) on Saturday February 07, 2004 @10:07PM (#8215677) Homepage Journal
    Nobody uses java for "internet downloadable applications", or even intranet downloadable ones.

    Retek [retek.com] does, and it's one of - if not *the* - most popular set of apps for the backend of the retail industry in the US.
  • by Anonymous Brave Guy ( 457657 ) on Saturday February 07, 2004 @10:11PM (#8215699)

    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.

  • Re:"Co-opt Java" (Score:2, Interesting)

    by Anonymous Coward on Sunday February 08, 2004 @04:25PM (#8220174)
    Sun's Java Desktop System [sun.com] seems to be doing quite well.

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

    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 [zdnet.co.uk], and track satellites [nasa.gov].

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

    In short, I think you completely missed it with your answer.
  • Re:I'm sorry (Score:2, Interesting)

    by pmorrison ( 513514 ) on Monday February 09, 2004 @04:36AM (#8223772)
    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 [stevemcconnell.com]

    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.

He has not acquired a fortune; the fortune has acquired him. -- Bion

Working...