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:"Co-opt Java" (Score:5, Insightful)
Sun Should Embrace and Extend (Score:5, Insightful)
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.
Re:"Co-opt Java" (Score:5, Insightful)
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.
Re:"Co-opt Java" (Score:5, Insightful)
As a bonus, Gtk# has the best API I've ever used in a gui toolkit.
Why do big companies want pseudo-compiled langs? (Score:3, Insightful)
It seems to me that big companies like Sun and Microsoft like pseudo-compiled languages like Java and those in
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:
Java Decompilers [program-tr...mation.org]
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.
"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.
Re:"Co-opt Java" (Score:5, Insightful)
Re:"Co-opt Java" (Score:3, Insightful)
That C# takes ideas from java is irrelevant.
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.
Re:"Co-opt Java" (Score:5, Insightful)
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.
oh, and what's the next release of Java have? (Score:0, Insightful)
real enumerations, like C#
real attributes and program metadata, like C#
real foreach, like C#
generics, like the next version of C#
Face it, if C# borrows from Java, the next release of Java is a ripoff of C#.
Because pseudo-compiled languages are better.. (Score:3, Insightful)
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.
Re:Why do big companies want pseudo-compiled langs (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).
Re:"Co-opt Java" (Score:5, Insightful)
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
I've used both and the both work and they'll both change... for a while
I wounldn't try to find religion in a programming language, they come and go too quickly.
Re:Why do big companies want pseudo-compiled langs (Score:3, Insightful)
> 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.
Re:Sun Should Embrace and Extend (Score:5, Insightful)
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.
Nice language, bad motives (Score:2, Insightful)
Re:How and Why C# Was Made (Score:3, Insightful)
Re:How and Why C# Was Made (Score:2, Insightful)
I wonder why
Re:oh, and what's the next release of Java have? (Score:4, Insightful)
Re:"Co-opt Java" (Score:4, Insightful)
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
Wonderfull logic.
Your prison/Gates metaphor-pun is wonderfully melodramatic as well.
Thanks for play,
Re:"Co-opt Java" (Score:3, Insightful)
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.
Re:"Co-opt Java" (Score:4, Insightful)
Re:How and Why C# Was Made (Score:3, Insightful)
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.
worst C# drawback (Score:3, Insightful)
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'
Language/tools are secondary (Score:4, Insightful)
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?
Re:"Co-opt Java" (Score:2, Insightful)
Most companies want to dominate the market. The difference is that for the vast majority of them, market domination is a ludicrous concept.
Re:"Co-opt Java" (Score:3, Insightful)
Fanatical no. Cynicism spawned actions of Microsoft? Maybe.
Despite whatever wonderful attributes C# and
I'll believe the hype when I see a workable, usable, and complete implementation of
Microsoft wants developer writing Windows-only applications.
Re:Nice language, bad motives (Score:5, Insightful)
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.
Re:Language/tools are secondary (Score:2, Insightful)
A programming language is a lot more than just a tool. The language you choose will affect the end product quite substantially.
Re:Why does C# have redundant syntax? (Score:3, Insightful)
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.
What did they miss about checked exceptions (Score:5, Insightful)
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.
Re:Its not redundant (Score:2, Insightful)
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...
Re:Language/tools are secondary (Score:3, Insightful)
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.
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.
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.
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.
wrong analysis (Score:3, Insightful)
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
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
Re:What did they miss about checked exceptions (Score:4, Insightful)
Re:Language/tools are secondary (Score:3, Insightful)
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?
Re:Nice language, bad motives (Score:1, Insightful)
Bzzt. Mono does not support the entire language, much less the than the entirety of the implementation that Microsoft uses which has many significant parts not submitted for standarization.
People will use whatever is in the class library. Windows-specific classes will yield Windows-specific apps. It's only delusional Microserf cheerleaders that think that C# is not designed to lock you in Windows.
Any idea how far along GTK# is at implementing the WinForms API? I've got new for you: not far at all. And no one should be expecting an implementation any time soon.
To give you an idea of how in-depth this one specific API is, last I read on Mono's page, they are thinking about implementing WinForms with wine(a tremendously large C application+library) and then reimplementing parts of it in GTK+(a somewhat smaller, but still large toolkit library) . If this doesn't scream man-decades of effort and gazillions of platform inconsistencies to you, you aren't familiar with the technologies involved.
No, there's a whole world of reasons why C# is furthering Microsoft's own interests, to the detriment of non-Microsoft platforms. It would be absurb to believe otherwise. This is why C# sucks if you are using one of those platforms -- it is not the Messiah language we all hope to deliver us from the horrors of C/C++. It is a false prophet designed to ensare all to its will to dwell in Hades or dwell not at all.
interesting quote (Score:1, Insightful)
I found this particular statement from Anders insightful. Just because he and his peers are not aware of CORBA systems scaling to geo-scale, they assume it can't. Although anders and his co-workers are experts in language design and building compilers, they are obvious detached from the world of application development. The requirements of application development are seldom as clear cut as designing a language.
Most of the top 20 financial firms use CORBA and other ORB drivers to handle geo-scale applications. I believe anders needs to get out into application development and spend about 10 years in the field. Once he does, he will realize CORBA is there for a reason. The simplistic examples and views of anders definitely provides insight into many of .NET's short coming with handling complex processes. Doing distributed objects is because large institutions have to integrate with numerous systems. Handling that in a transactional manner isn't appropriate in a stateless Webservice or simple SOAP. what you really want is data + behavior. Just the values isn't enough to know what else to do in case a process fails.
I can't help but feel microsoft and .NET have taken a huge step back in terms of getting into enterprise backend applications. Trying to update data in multiple database isn't easy and never will be. Forcing webservices on these types of applications if foolish and doomed to failure.