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."
Re:How and Why C# Was Made (Score:5, Interesting)
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.
Re:does c# matter to any one (Score:4, Interesting)
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
Anders leaving Borland - a blessing in disguise ? (Score:2, Interesting)
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)?
Wake up and smell the marketing bullshit! (Score:4, Interesting)
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.
Re:Sun Should Embrace and Extend (Score:3, Interesting)
Re:Why do big companies want pseudo-compiled langs (Score:3, Interesting)
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.
Re:Checked Exceptions (Score:2, Interesting)
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.
Re:Why do big companies want pseudo-compiled langs (Score:5, Interesting)
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++.
Why does C# have redundant syntax? (Score:2, Interesting)
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.
Re:Checked Exceptions (Score:1, Interesting)
createFile("foo.txt");
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.
Re:How and Why C# Was Made (Score:3, Interesting)
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.
Re:Why do big companies want pseudo-compiled langs (Score:3, Interesting)
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... ;-)
Downloadable applications (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.
Re:Templates are strong typed in C++ (Score:2, Interesting)
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)
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.
Constraints on type parameters (Score:3, 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.
Re:"Co-opt Java" (Score:2, Interesting)
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)
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.