Slashdot Log In
C# Under The Microscope
from the ooh!-it's-like-a-little-city! dept.
To Begin at the Ending
I'm a big fan of programming languages, possibly more than of actual programming. Every once in a while I hear about this new language that is just "brilliant", that "does things differently" and that "takes a whole different approach to programming". I typically then take the necessary time off my regularly scheduled C++ programming, learn enough about the language to get excited about the new one, but not enough to actually do anything useful with it, rave about it for a couple days, and then quietly and without protest go back to my C++ programming.
And so, when I learned of Microsoft's new up-and-comer, C# (pronunciation: whatever), I became duly excited and went forth to learn as much about it as possible.
Last things first: On paper, C# is very interesting. It does very little that's truly new and innovative, but it does do several things differently, and through this paper I hope to explore and present at least some the more important differences between C# and its obvious influences: C++ and Java. So, skipping the obligatory Slashdot "speaking favorably of Microsoft" apology, let's talk about C#, the language.
How is it like Java/C++?
In the look & feel department, C# feels very much like C++. More so than even Java. While Java syntax borrows much of the C++ syntax, some of the corresponding language constructs have a slightly different form of use. While this is hardly a complaint, it's interesting to note that the designers of C# went a little further in making it look like C++. This is good for the same reason it was good with Java. Being a professional C++ programmer, I use C++ way more than any other language. Eiffel, for instance, has a much cleaner syntax than either C++, C# or Java, and at face value it does seem as though one should bear with new syntax if this is going to lead to cleaner, more easily understandable code, but for an old dog like myself, not having to remember so much new syntax when switching to another language is nothing short of a blessing.
C# borrows much from Java, a debt which Microsoft has not acknowledged, and possibly never will. Just like Java, C# does automatic garbage-collection. This means that, unlike with C and C++, there is no need to track the use of created objects, since the program automatically knows when objects are no longer in use and eventually destroys them. This makes working with large object groups considerably simpler, although, there have been a few instances where I was faced with a programming problem where the solution depended on objects *not* being automatically destroyed, as they were supposed to exist separate from the main object hierarchy and would take care of their own destruction when the time was right. Stroustrup's vision of automatic garbage-collection for C++ sees automatic garbage-collection as an optional feature, which might make the language more complicated to use, but would allow better performance and increased design flexibility.
One interesting way in which C# deals with the performance issues involved with automatic garbage collection is that of allowing you to define classes whose objects always copy by value, instead of the default copy by reference, which means there is no need to garbage- collect such objects. This is done, confusingly enough, by defining classes instead as structs. This is very different from C++ structs, which are defined in exactly the same way; C++ structs are just classes where members are public by default, instead of privately. Another idea that was lifted directly off Java, and one which turned out to be very controversial is that of multiple inheritance. In what seemed like a step backwards, Java did not allow you to define classes that inherit from one than one class. Java did let you define "interfaces", which work like C++ abstract classes, but were semantically clearer: an interface is a functional contract that declares one or more methods. A class can choose to "sign" such a contract by inheriting it, and providing a working implementation for every method that the interface declares. In Java, you can inherit as many interfaces as you want. The rationale to all this being that multiply inheriting more than one class raises too many possible problems, most notably that of clashing implementations and repeated inheritance. On a side note, the cleanest separation between interface and implementation that I know of is that of Sather, where classes can provide either implementation or interface, but not both.
So what else is new?
One new feature that I mentioned already was that of copy-by-value objects. This seemingly small improvement is a potentially huge performance saver! With C++, one is regularly tempted to describe the simplest constructs as classes, and in so doing make it safer and simpler to use them. For example, a phone directory program might define a phone record as a class, and would maintain one PhoneRecord object per actual record. In Java, each and every one of those objects would be garbage collected! Now, Java uses mark-and-sweep in order to garbage collect. The way that this is done is this: the JVM starts with the program's main object, and starts recursively descending through references to other objects. Every object that is traversed is marked as referenced. When this is done, all of the objects that aren't marked are destroyed. In the phone book program, especially if there are thousands and thousands of phone records, this can drastically increase the time that it takes the JVM to go through the marking phase. In C#, you'd be able to avoid all this by defining PhoneRecord as a struct instead of a class.
Another thing that C# does better than Java is the type-unification system. In Java, all classes are implicitly descendents of the Object class, which supplies several extremely useful services. C# classes are also all eventual descendents of the object class, but unlike Java, primitives such as integers, booleans and floating-point types are considered to be regular classes. Java supplies classes that correspond with primitive types, and mapping an object-value to a primitive value and vice versa is very simple, but C# makes it that much simpler by eliminating that duplicity.
Personally, I found C# support of events to be a very exciting new feature! Whereas an object method operates the object in a certain way, object events let the object notify the outside world of particular changes in its state.. A Socket class, for instance, might define a ReadPossible event or a data object might release a DataChanged event. Other objects may then subscribe for such an event so that they'd be able to do some work when the event is released. Events may very well be considered to be "reverse- functions", in the sense that rather than operate the object, they allow the object to operate the outside world, and in my programming experience, events are almost as important as methods themselves.
While you could always implement events in C by taking pointers to functions, or optionally in C++ and Java by taking objects that subclass a corresponding handler type, C# allows you to define class events as regular members. Such event members can be defined to take any delegate type. Delegates are the C# version of function pointers. Whereas a C function pointer consists of nothing but a callable address, a delegate is an object reference as well as a method reference. Delegates are callable, and when called, operate the stored method upon the stored object reference. This design, which may seem less object-oriented than the Java approach of defining a handler interface and having subscribers subclass the interface and instantiate a subscriber, is considerably more straightforward and makes using events nearly as simple as invoking object methods.
Events are one example of how C# takes a popular use of pre-existing object-oriented mechanisms and makes it explicit by giving it a name and logic of its own. Properties are another example, even though they're not as much of a labor-saver as events are. It is very commonplace in C++ to provide "getters" and "setters" for private data members, in order to provide controlled access to them. C# treats such "protected" data members as Properties, and the declaration syntax of properties is such that you have to provide getter and setter functions for each property. In fact, properties do not have to correspond to real data members at all! They may very well be the product of some calculation or other operation.
And then, by far the ugliest, most redundant and hard-to-understand language construct in C# is the Attribute. Attributes are objects of certain types that can be attached to any variable or static language construct. At run-time, practically anything can be queried for the value of attributes attached to it. This sounds like the sort of hack someone would work into a language ten years after it's been in use and there was no other way to do something important without breaking backwards compatibility. Attributes are C#'s version of Java reflection, but with none of the elegance and appropriateness. In general, and especially in light of C#'s overall design, the Attributes feature is out of place, and inexcusable.
What is it missing?
Being an unborn language, there is much that C# does not yet promise to deliver, and for which it can't be criticized. First of all, there is no telling just how well it would perform. Java is, in many ways, the better language but one of the prime reasons it's been avoided is its relatively slow performance, especially compared to corresponding C and C++ implementations. It's not yet clear whether C# programs would need the equivalent of a Java Virtual Machine or whether they could be compiled directly into standalone executables, which might positively affect C#'s performance and possibly even set it as a viable successor to C++, at the very least on Windows. While there is much talk of C# being cross-platform, it is unclear just how feasible implementing C# on non- windows platforms is going to be. The required .NET framework consists of much that is, at least at the moment, Windows specific, and C# relies heavily on Microsoft's Component Object Model. All things considered, setting up a proper environment for C# on other platforms should prove to be a massive undertaking, that perhaps none other than Microsoft can afford.Furthermore, while there is mention of a provided system library, it's not clear what services such a library would provide. C++ provides a standard library that allows basic OS operations, the immensely useful STL and a powerful stream I/O system with basic implementation for files and memory buffers. The Java core libraries go much further by providing classes for anything from data structures, to communications, to GUI. It is yet to be seen how C#'s system library would fare in comparison.
One thing that's sure to be missing from C#, and very sadly at that is any form of genericity. Genericity, such as it is implemented in C++, allows one to define "types with holes". Such types, when supplied with the missing information, are used to create new types on the spot, and are therefore considered to be "templates" for types. A good example of a useful type template is C++'s list, which can be used to create linked-lists for values of any type. Unlike a C linked-list that takes in pointers to void or a Java linked list that takes Object references, a list instantiated from the C++ list template is type-safe. That is to say, it would only be able to take in values of the type for which it was instantiated. While it is true that inheritance and genericity are often interchangeable, having both makes for a safer, possibly faster development platform.
The designers of C# have admitted the usefulness of genericity, but also confessed that C# is not going to support genericity on first release. More interestingly, they are unhappy with C++'s approach to genericity, which is based entirely on templates. It would be interesting to see what approach C# would take towards the concept, seeing as templates are pretty much synonymous with genericity at the moment.
To sum it up
Many now refer to C# as a Java-wannabe, and there is much evidence to support this notion. C# doesn't only borrow a number of ideas from Java. It seems to follow up on Java's sense of clean design. It's a somewhat sad observation then that C#, purely as a language, not only provides a fraction of the innovation and daring that Java did, it also falls just a little behind Java where cleanliness and simplicity are concerned. However, if you're someone like myself, who uses Windows as their primary development platform and needs to use C or C++ because he cannot afford the overhead that Java incurs, it's possible that C# would turn out to be a very beneficial compromise.
Wrong Direction (Score:3)
C was created specifically to emulate a "universal cpu" and to make it easier to write software across platforms. C++ extended that mission with the added benefit of reusable code (cross-application). C# is a step in the wrong direction if it pretends to be a language in the same class as others with 'C' in the name.
As far as I can see it's main innovations are little more than invisible methods.
--------
Yeah, I'm a Mac programmer. You got a problem with that?
Re:Apple releases a new language called C#++ (Score:3)
(Note: Having to explain this joke means it is a great failure.)
Re:Where do functions fit in? (Score:3)
> Now, Java uses mark-and-sweep in order to garbage collect.
No, it doesn't specify any such thing. You're perfectly welcome to use any collection system for Java objects you like, including high-performance generational/copying collectors.
As it happens, the bulk of Java implementations do use mark-sweep as part of a conservative collection approach, because of the need to interact with code that is not GC-aware. That's easiest to structure as a simple mark/sweep pre-pass to the real collection phase, which can do pretty much anything it wants that doesn't involve moving or freeing the conservatively blacklisted objects.
I have a GC library for C++ I've written which works exactly like this - mark/sweep conservative phase, generational copy collector phase - and works just fine.
As for the copy-by-value/copy-by-reference distinction, template library authors already make this distinction for performance (at least I do in mine) and provide simple ways to annotate classes so templates expand to by-reference versions. That said, the biggest problem with that is that even in MSVC++6.0, the template support is still so broken that you spent more time fighting internal compiler errors that coding :-(
Back to the article being replied to:
> Part of the uniqueness of C# is its conception of code reuse - for instance, instead of purchasing a commercial garbage-collector for your C++ code, you get one for free from C#.
Huh? It's "unique" to do something that most every programming language outside the Algol/Pascal/C family has done from day one?
> But where does this garbage collector reside?
It's in the language run-time, which can be wherever the implementation gives you the option of putting it. Y'know, like malloc ().
In case you've never seen one, a garbage collector is not a big piece of code - a simple but perfectly effective one is typically much smaller than the equivalent malloc () code. For high-performance allocator implementations (like the impressive Hoard from Paul Wilson's group at UTexas, where allocation performance of all kinds are studied), expect a GC and a manual allocator to be of roughly similar overall size and complexity.
Objective-C, NeXTStep, OpenStep, Mac OS X, and C# (Score:5)
Inheritance and Interfaces
Objective-C in the OpenStep/Mac OS X environment has single inheritance from a base class (NSObject), and protocols, which are precise counterparts to Java's interfaces. I have run into situations, however, where multiple inheritance is exactly what is required, and using interfaces meant that I had re-write the exact same code more than once, as I was implementing a group of specialized collection classes in Java. There were two axes of differentiation: mutability = (immutable, mutable), and ordering (partially ordered, ordered, strictly ordered). There was a lot of code that had to be duplicated that I should have been able to inherit from two abstract superclasses, one for mutability, and one for ordering. (*grumble*)
Garbage Collection and Memory Management
Objective-C provides a semi-automatic reference-counted garbage collection mechanism that is amenable to programmer intervention to increase efficiency, through a construct called an Autorelease Pool. Every object has a retain count, which can be incremented or decremented. The object's retain count starts at one, and when an object's retain count goes down to zero it is garbage collected. Note that this happens the instant that the retain count drops to zero, not during a mark/sweep. However, you may need to pass an object on to another part of your app, but your code does not need/want to retain it. What you do instead is tell the object to auto-release. It is then put into the autorelease pool, and later on during the system's garbage collection each object in the autorelease pool is sent a release message. Some objects that are entered in the autorelease pool still have a retain count (as they are being retained by other objects) and are simply removed from the autorelease pool; others have their retain counts drop to zero and are garbage collected.
You can fine-tune this mechanism to a high degree, by putting your own autorelease pool in the stack ahead of the system's primary autorelease pool. For instance, suppose you know that you will be allocating a whole bunch of objects for use in a part of your program, and after you exit you will never need them again. Well, you can put your own autorelease pool in for the system's autorelease pool at the start of that section of your code, write normal code, then remove and release your private autorelease pool and put back the system autorelease pool, which release all of the objects you created in your little section of code. Conversely, if you want an object to stick around, just don't ever release or autorelease it.
However, from a business standpoint, I find that the automated garbage collection and never having to worry about memory allocation issues is a strong point of Java. It allows me to code more complex applications and avoid memory debugging issues that invarable bedevil complex Objective-C and C++ programs. I can get a WebObjects application to a customer much more quickly using Java than using Objective-C, with quicker turnaround and more feedback cycles.
Events, Notifications, and Delegation
The OpenStep and Mac OS X operating systems (viewed separately from the Objective-C language, as these features are available from Java as well) have long had notifications and delegates. There is a system-wide notification center, objects can define notifications that they will post in response to certain events, and objects can register to receive particular events or classes of events. This mechanism has been in place for a long time.
Delegation is a bit more tightly tied to Objective-C, as objects in Obj-C can pass messages (i.e. method calls) onto to other objects, and objects can "pose as" other objects. An object can register to be the delegate of another object (in Java, the delegator object needs to make special provision for this), and there are "informal protocols" or "informal interfaces" defined that indicate the possible messages a delegate might receive from its delegator. Again, this is not new, and its assembly into a single OS is not new.
Primitive Types
This is one feature that I like very much, and wish that Java had. Objective-C, of course, will always have to support native types such as char's and int's, as it is defined as a superset of C. However, Java had the opportunity to remove this artificial distinction, and has caused lots of cursing from yours truly over the past couple of years.
Compiling to Native Code
I would point out here that compiling to native code may not result in the fastest execution. Review the HP Dynamo project [arstechnica.com], as written up on Ars Technica, for the reasons why JITC can actually exceed the speed of native code. The whole Transmeta Crusoe architecture is built around this theory of operation, and no one will claim that it's too slow.
Genericity
Amen to this. The fact that genericity is missing from Java is a serious gripe of mine, and the fact that it is missing from C# is a serious omission. This business of casting objects coming out of arrays is a pain the in neck, and it is often tough to find out where an object of the wrong type went into an array, although on the cast coming out you get a ClassCastException. Far better to catch the problem when the object goes in, which often gives you a better idea of where your design is broken. One of these days I am really going to have to start using the stuff coming out of the GJ project [bell-labs.com].
Conclusions
Overall, I find that the "new" stuff in C# is really old stuff. Furthermore, this is not the first time that all of this has been pulled together in one place. Almost all of this has been in the NeXTStep/OpenStep/Mac OS X family for a long time, and the implementations there are quite mature. I suspect that the implementations in C# will require several revisions before they reach the levels that programmers can really use.
Just so everyone knows, I am a Consulting Engineer working for Apple iServices, a part of Apple Computer, specializing in WebObjects development. These opinions are my own, however, and not those of Apple.
--Paul
Re:java's overhead (Score:4)
This was not sloppy code. I made extensive use of caching, pre-rendering and Java2d to make the most of the platform. Java simply has performance overhead -- the overhead of Swing (sloppy, sloppy -- it's not even well built, consider for instance that affinexforms were hacked on but don't apply heirarchically and thus can't zoom Swing UI elements) is huge, but there is overhead in JAva2d (JNI is slow, especially for copying chunks of data back and forth) and some additional overhead in the basic design.
In Java, it is almost impossible to write cache-friendly code. If you build things in an OO fashion, you cannot force locality, since object refs force you to essenaitally chase pointers for every object. If you write degenerate code that isn't OO (sort of misses the point) then the array bounds checks hammer you anyway (and no, I have yet to see this eliminated by "smart compilers").
Java has some inherent problems with performance. These are real, they exist, and they are fundamental to the platform.
Consider that in JAva, you have to have a thread per socket connection. Yes, I'm serious. There is no select, there is no poll. This means that a messaging server on Java can maybe serve 3000 clients before it starts to fall apart, but something in C++? Trivial to serve 20,000. You don't even need to optimize it to get that level of scalability that even optimized JAva can't do.
Consider the weirdness that Java can spawn a child process but not attach to a process that's already running (easy to do in C [C++, C, C#]). How do you write a watchdog process in JAva whan you can't kill a process that's hung?
Java is great. I've used it extensively. But it is seriously warped in some ways.
RSR
Instead of a Microscope... (Score:3)
From all the reviews I've read, "See Sharp" doesn't.
Re:Ack! Significant whitespace! (Score:3)
You may not always be safe in C++ [att.com]. (Acrobat format ;)
___
Re:For all the bashing C# gets here... (Score:3)
Other than that, you're just regurgitating the typical boring Slashdot opinion set in a highly overdramatic style. To call a language dangerous, a corporation evil and to literally identify a real manager with the PHB from Dilbert is at best inaccurate, and at worst displays a shocking seperation between you and reality. The world is not as black and white as you would like it to be.
Not really a VM (Score:3)
What it seems like is a cross-platform distribution but with native compilation upon installation. Sorta a best of both worlds kinda thing...
It should have been called. (Score:3)
C~1
Marajuana explaining Windows Errors? (Score:3)
Microsoft says it's supposed to be pronounced C (sharp). But I've almost always heard "#" called the hash mark. Regardless of what the PR folks say I believe that M$'s developers really meant it to be pronounced see-hash. Could this indication of an obsession with pot among Microsoft's developers be an explanation of the buggy history of Windows? I don't know but it does explain things...
Totally agree - when will OO die? (Score:3)
I've done extensive Java programming since it was v0.9, and C++ programming for about six years, and my opinion is that most of the OO stuff is complete mumbo-jumbo that only serves to confuse the core programmer and others who try using their code.
One rule that has served me well throughout the years is that one should never use a tool more complicated than the problem demands. Many OO programmers throw this rule out the window, and spend weeks playing with Factory patterns, polymorphism, huge inheritance hierarchies, and all sorts of other junk that creates bloated, useless code.
At the very least, C++ allows me to limit the amount of OO I introduce into programs. Java seems to be as retarded as Smalltalk when it comes to this.
Even for "internal" programs that don't require full-out performance, I can bang out a perl solution in half the code it takes a Java programmer do write. I have to wonder how Java programmers keep from going insane. The language and object hierarchy are so verbose that it takes at least twice as many lines of code to get anything done as any other language, and then the speed sucks. Rant off.
Re:IL is the key... (Score:3)
Of course, Microsoft isn't exactly the only group doing this. As much as I may like the looks of OS X, the development environment is, once again, highly dependent on a number of proprietary, platform-specific libraries and services. Linux and the rest of the UNIX-esque system benefit from the basic POSIX standard, but I think what we're seeing more and more lately is that that's not quite far enough these days. If the UNIXes of the world can't come up with a system that's as brainless to use as Visual Basic, Microsoft will continue to lure developers who can't, don't want to, or don't need to learn the intricacies of OO, and just want to quickly build applications with the benefits of pluggable components.
Generic Java (Score:3)
I've used GJ quite a bit, and I'm quite happy with it. Furthermore, there's reason to hope that code written in GJ (the syntax of which is similar to C++ templates) will be compatable with future versions of Java, since Sun is looking into adding genericity to Java, and looking at GJ in particular.
Re:A look at C# (Score:3)
Uhuh... right...
The runtime for
Simon
Borland already did C# in C++Builder (Score:3)
Personally, I found C# support of events to be a very exciting new feature
C++Builder has been doing this since day one, with what Borland calls a "closure". You use a new keyword, __closure, to declare a pointer which points to a member function of a specific object instance. Not surprisingly, Borland uses this to drive the entire event system in their GUI framework. It rocks.
Properties are another example, even though they're not as much of a labor-saver as events are.
Again, Borland has been doing this since day one. The keyword __property can be used to declare object members which appear to be simple variables to "outsiders", but do magic when read or set.
Once again, Microsoft fails to innovate, but instead steals from elsewhere.
Events used to drive Garbage Collection? (Score:3)
Back to C... (Score:4)
And it's a shame to not see good template (genericity?) support in C#. Or any language, for that matter.
I think choosing a good type system is where a lot of languages fall flat, and I'm not a big fan of the huge C++/Java Object/Type/Library approach, although I haven't seen a truly good solution to this problem yet. C, Pascal, Java, Perl, Scheme... They all have different ideas and solutions, and I haven't seen a "Right Way" yet. Although I think Scheme has the right idea with its first class data types, it still all needs some work.
---
pb Reply or e-mail; don't vaguely moderate [ncsu.edu].
This level of language... (Score:5)
If I want to use a medium-level language because I want absolute control and optimized speed, I'll use C. I don't want an "almost-medium-level-but-a-little-higher-than-tha
Granted, there's a need for these "weird-level" languages, and some people love them - but I think that C++ and Java nicely fill the niche. So, my first thought, which is even more valid, I think, in the face of this review, is "Why does Microsoft feel almost obligated to make an M$ version of *everything*??"
For GUIs and money managers and anything else aimed at "my mom", Microsoft is guaranteed to reign supreme, because "my mom" doesn't really care about performance issues or security or any of that. But my hunch is that, in light of some of the bugs and general ickiness covered in this review, few people are going to want to switch over to C#. I mean, what would be the advantage?? If you already write C++ and/or Java, why would you want to start writing stuff in C#? I just don't understand.
What's the point? (Score:3)
C#: Answer to the DOJ? (Score:5)
It seems to me that creating a new 'standard' language, which neverltheless relies heavily on COM and
Let's say that C# is simply a better language to program for Windows than C++ is. Let's also suppose the hypothetical case where new Windows functionality comes along in future Win versions, and that this functionality is more easily taken advantage of using this new C# language. This gives developers the incentive to code new Windows products in C#. Note that C# has substantially different enough structures that porting from C# to C++ would not be trivial.
Now suppose that Linux (or another OS) starts gaining prominence in the next 2-8 years. As with any new OS, its main barrier to entry is lack of software. (The only reason Linux is viable is because of all the UNIX software it inherits.) In this time, Microsoft's pushing of C# has created a new software base for Windows that is relatively locked into place, unable to be ported to other platforms without significant effort.
Now I'm not saying this is evil. I'm not saying it's a conspiracy. Often languages built for specific environments are superior tools in those environments specifically because they're specialized.
It's just something to be aware of.
Kevin Fox
IL is the key... (Score:3)
Why is IL the key? Consider:
They are going to submit C# the language as a standard - but I don't think that includes IL. That means that even if you make a C# compiler based on the standard, they could change how IL is structured to shut you down.
They have stated IL will be compiled to native code in one pass. That can happen before it's deployed, or on the target platform. But by doing that, they loose the possibiliy of dynamic optmization (one of the things that makes HotSpot fast, and better than just a straight JIT). By allowing the compilation to happen before deployment, you also risk a bad choice for target platforms and possibly reduced performance of distributed components.
It effects all other languages. Using Visual Studio, pretty much all languages will compile into IL. That means the workings of IL affect your code to some degree, really regardless of language.
C# is an interesting language, and I like some of the features - but for all that, would it be impossible to compile C# to Java bytecode? I don't know the answer to that myself for certain, but really the development and capabilites of IL as a platform are really more interesting to watch than whatever language is on top.
Another interesting question to consider - C# allows you to have native (unprotected) code blocks. How does that work in relation to IL? Does the code get bundled with the IL, to be compiled when the IL is compiled? Or are the native parts compiled to native code when the other code is compiled to IL, and transported as a mix of IL and native code? The answer has some implications for optmization of native code blocks.
COM and C# (Score:3)
Which is probably how most of this functionality (encapulation, events and call-backs) will be implemented. I'm getting the sense this is going to turn out to be something of a quazi-language, which was in the end what Microsoft's Java implementation became (Just try and do something meaningful in it without invoking a COM object.)
In the end, C# really does not seem to offer anything meaningful that VB does (or will) not, and for the same reasons will not be any less portable.
Re:Back to C... (Score:3)
Re:C#: Answer to the DOJ? (Score:3)
Java may not be the ultra-portable platform it originally claimed to be, but at least companies who develop with it are not signing their eternal soul (and support contracts) away to a single vendor. If you start down the road of .NET, you are now committing not just your desktop applications and documents, but all your business logic and data, to the benevolent guidance of Microsoft.
The silver lining to all this is the fact that there will be those business analyst-types who will realize the same thing, and say so.
What _I_ Like about C#.. (Score:4)
C# is highly typed, so you don't spend hours looking through code trying to find a type mismatch.
It is early binding instead of late binding, meaning it is quicker! With Java (late binding), a file search and enumeration of 8000 files on our servers here at work took an hour and a half, and 50000 files with a C(early binding) app took 4 minutes, so C# takes the best of both. Also, because it is early binding, you don't have to worry about references to non-existant objects, when you are using DLL's for instance. C# automatically loads and reviews the routines contained in a DLL automatically, before compile, so a reference to myDLL. will bringup a popup list of the routines availible in that DLL.
Very cool stuff! It will be interesting to see if it takes over as the new, trendy programming language of 2000/2001, as Java has been for a few years.
Re:Totally agree - when will OO die? (Score:3)
now, where it got interesting was when we actually examined the software engineered by novices. the o.o. paradigm forced more thought to be placed into the structure of the application's design, thus typically resulted in easier to maintain software.
that software written in c, cobol, basic, pascal, you name it, that was easy to maintain was only that written by the really experienced. the novices in the crowd made our lives very painful. my experience seems to show me that o.o. languages are less lenient toward rush-jobs at design-time.
just my 0.02
Peter
Re:C#: Answer to the DOJ? (Score:4)
Which gets to a more theoretical problem. The purpose of COM, and models like it, is fairly specific. It is interoperability between seperate running programs, either locally or across a network. But who says I want to share every single object in my program with the outside world? What's the point in having a string class that could potentially be shared between programs if I've got no need to share it between programs?
It seems to me that people are going to find that to get C# programs to perform acceptably, they are going to have to design with big, heavy kitchen sink classes. And that worries me because that sort of design is, in my opinion, one of the biggest downfalls of most Windows software. (Especially Microsoft APIs.) I'm sick of having to instiatiate five classes and code a hundred lines of code just to find out if the damn CD player is in the "playing" state.
It seems to me that this is a case of having a hammer (COM) and seeing every problem as a nail.
If I were designing C#, I wouldn't make every object a COM object. Instead, I'd have some kind of "COMmable" attribute that could make some objects COM objects with little fuss. Put the control in the hands of the programmer.
For good "template" support: try ML (Score:5)