Slashdot Log In
C# From a Java Developer's Perspective
Posted by
timothy
on Mon Nov 19, 2001 03:30 PM
from the curve-before-a-meeting-of-lines dept.
from the curve-before-a-meeting-of-lines dept.
Microsoft's C# has raised eyebrows, interest and debate since its official announcement last year. The prolific Carnage4Life (Dare Obasanjo) has completed a detailed comparison of C# and Java, outlining the things that are identical, similar, nearly the same, or completely different between the two languages. If you're considering learning or applying either one, you might benefit by reading this paper first. There are some other excellent comparisons to be found linked from the Open Directory Project as well. Update: 11/20 03:35 GMT by T : Note: here's a mirror; interested readers who mirror the mirror get good seats in heaven.
This discussion has been archived.
No new comments can be posted.
C# From a Java Developer's Perspective
|
Log In/Create an Account
| Top
| 507 comments
| Search Discussion
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
Some more information (Score:3, Informative)
Non Portable (Score:1, Funny)
Insert sig here.
how is it... (Score:3, Troll)
Alternate Site For Article... (Score:4, Informative)
PS: Mirrors encouraged, so if you manage to grab it and can host it at a site with beefier bandwidth, go ahead.
The lesser of two evils (Score:5, Insightful)
Although C# does deliver superior integration with Windows and
Just my 2c...
~wally
Re:The lesser of two evils (Score:5, Insightful)
Also, you'll be able to use all the newest 'must have features' that MS tries to shove on the consumer in C#.
For now, I'll stick with Java because it's libraries are much better. Not just the ones that Sun wrote, but more importantly, the ones that other people have written.
Come on now: Have you ever really used C#? (Score:5, Insightful)
Seriously though, have you? From your vague, unsubstantiated, no example posting it sounds like you use and know Java, therefore you can proclaim yourself knowledgable about C#. Your claims about the "bolted on" aspects of C# are particularly suspicious given the "hooks" into Windows are simply objects instantiatable from the .Net Framework (they're not "bolted on": Just like Java you include the unit and create objects from it). If anything C# takes some of the goofy aspects of Java, such as the interoperation with properties via methods, and cleans them up to make an abstract behind the scenes property handling system (ripped straight from Delphi's object pascal I would guess).
Re:The lesser of two evils (Score:4, Funny)
Agreed - but Java at least attempts "write once, run anywhere," (with debatable success) whereas M$ C# attempts "write once, run on Windows XP, with Windows Messenger and a
I have a lot more faith trusting my applications and business to a company that isn't trying to take over every purchasing decision we make. If you have read the fine print that comes with Windows messenger - the other half of
One day your app or service isn't going to run, and all you see in your logs will be "Call Miscrosoft to obtain a license to run C#"
C# and .NET vs. Java Enterprise APIs and tools (Score:4, Insightful)
I spend most of my time in the Java world (I have written 5 Java books, the latest of J2EE, and almost all of my consulting is done with Java.)
That said, C# and Visual Studio.Net are very cool.
Since Java is not my language of choice (hey, I would use Common LISP more if there were more consulting jobs requiring LISP!), I would not be too bothered if I had to use C# and the .Net stuff.
Really, what really matters is finding interesting jobs to do, not the development platform.
I also have high-hopes for interop between the Java J2EE world and .Net using SOAP. (I am working on SOAP support for Common LISP in my spare time so Lis can play nice with .Net and J2EE.)
Best regards,
Mark Watson
Correction (Score:2, Informative)
Standardization? (Score:3, Insightful)
One cannot always tell beforehand how big the impact will be. Small movements have exploded once given a niche to fill... and then die once it was swallowed up by a new contender.
If the benefit of C# is only whats in this article, then I'm not convinced its going to change the world. I'll keep to my "unsafe" code blocks and maintain interoperability with non-Gatesian worlds.
I'll wait for at least a committee for standardization to form for this mess.
Why do I get the sinking feeling (Score:4, Funny)
Or in some ominous "Morpheous" like voice:
"The
Or maybe I'm just reading too much into it... after all, Microsoft is doing it for the good of the community and Developers (developers, developers, dev....).
BWAAAAHAHAHAHAHA...I actually kept a straight face while typing that...heh.
{sniff, wipes tear from eyes..heeeheee}
Re:Why do I get the sinking feeling (Score:4, Insightful)
But will they be standardizing the libraries or just the language (and the CLR for that matter)?
The beauty of Java is that you write your code once to a set of libraries that are available on a lot of platforms. Even if you had to recompile the code on each platform, there would be no problems because there's a standard library to which you code.
But, if only C# the language is sent to the ECMA, won't we have another C/C++/ with different features? The code you write will still be specific to the libraries you choose to use (and thus the platforms those libraries are available).
C# for Artificial Intelligence? (Score:1)
On SourceForge there are already a few rather ambitious Open Source AI [sourceforge.net] projects in the C# language, but there is not yet a Mind-to-C# liaison page, for several reasons.
Since the various C# AI projects are also using a more open and more traditional language along with C#, the projects are being included in the liaison pages for the non-C# languages. Microsoft has such a tainted history of skulduggery, FUD (fear, uncertainty and doubt) and illegally monopolistic practices, that it may be not only unwise but unethical to jump upon any Microsoft bandwagon.
Therefore it seems safer to include the polyglot C# AI projects in the Mind-to-VB [sourceforge.net] and other liaison pages.
Since " Codito, ergo sum " types must give up waiting to trade in VB 6 for VB 7 and migrate instead to VB.Net (q.v.), we AI enthusiasts have some hope that the Microsoft .NET initiative will lead to Internet iMinds advancing the Technological Singularity [caltech.edu] and not merely the Final Take-Over of the 'Net by Microsoft.
C# is really kinda cool stuff (Score:2, Insightful)
....
Of all the MSVC programmers I worked with once they all had a good chance to work with C# they said theyll never write another line of C++ again. For the windows platform it may indeed be great stuff, the one thing that piques my interest is its cross plattform future. MS included help files and other pices parts refrence Linux, no whether its MS or someone like Ximian with their mono project. The C# stuff is definatley cool. native speed and you can writer in any of the dot net languages you want VB C# and yes TCL and PERL have ports to the Dot NET runtimes, heres the deal even M$ says it, from a performance standpoint on a Win32 machine they will all run the same the language choice will be a matter of style.
Some slashdotters out ther perpetually bash MS and I do too from time to time, I run Linux at work and home, but the fact is Im in computers to make money PERIOD, If I could make a living out of racing my motorcycles full time Id never touch a computer again other than to surf for parts or events.
To the ends of making money at computers, C# will do great I am sure , the coders I know that have actually worked with it on a daily basis love it, and to all the NAYSAYERS out there that say "Oh just another MS product to have bugs" sure probably but the wholde of the VS 7 IDE and tools are written in C# , Im sure by the time its released it'll be pretty good. And best of all it will make ME MONEY, I write desktop apps , if its quicker and easier.more interoperable, which it is it has full inheretence.Im all for it. The fact that 3rd parties are already vigilantly porting the runtime to *nix systems tells you its not another Bob
MS languages for the most part run superbly on MS systems, they suppert both sides of the enviroment. Guess what C# is another example, in XP there are already kernel optimization routines for the DotNET stuff,
If you HAD to program and app for a MS system in a MS language, which would you preffer, C++, VB, VFP, well..... Or C# that even C++ programmers who use it on a regular basis say , (and from experience it does) rocks as far as MS languages go.
C# doesn't make any sense... (Score:1, Insightful)
C# basically is a clone (some would say rip-off) of Java with none of the benefits.
The Java world is actually doing very well now. We have a lot of solid Open Source projects (Jakarta, Tomcat). The standards that do exist are very robust (Servlet, standard API, etc) and there is a lot of brainshare here.
There are tons of JVMs available. Can I run C# on Linux? FreeBSD? Solaris?. And if so can I port this code to another alternative non-MS platform? Linux and FreeBSD have had modern JVMs for a while now.
We are also making significant progress on Java integration with GNU/Linux (AKA not the proprietary SUN Java VM but a Free Software VM meeting the same spec level).
GCC 3.x will include support for 1.2 class JVMs (except for AWT but we are working on this). This means that all newer modern GNU/Linux machines will be able to execute Java code.
I liken this to the proprietary SSH vs OpenSSH relationship. There is the proprietary Java VM from SUN which can be used on Windows, Solaris, etc. The Free Software community now has GCC (with GCJ), Jikes RVM, Manta (all OSS VMs), that they can use and still remain free (all of these examples are under the GPL)
No thank you. I will stick with Java.
Kevin
Power of Java, Functionality of Windows (Score:5, Insightful)
I admit that Microsoft is once again trying to dup Java, but, if you like Java and wish to work with platform-dependant API's that do more with Windows than Java, C# is your answer!
As the article mentions, C# has almost the exact same syntax and keywords that Java has (plus PERL's foreach operator...kudos). There is almost no learning curve. You can leverage the functionality of Windows with C# however, and it has great XML support; so, if you've worked with the MSXML parser, you'll have no problems working with XML in C#.
C# deserves a little more credit than many give, at least if you're working in a strict Windows environment. It's worth a look.
That's all I have to say, but I'll pile on the on wood for the flames that will arise!
it's slashdotted...... (Score:1)
Access Privileges (Score:1)
But what if.... (Score:1)
It doesn't have to be based on Microsoft's code, you know. IANACW (compiler writer), but I think that sort of thing can be done. It's only a language. Look at python, or better yet, Jython (or whatever it's called nowadays). A Python byte compiler that creates java bytecode. Surely that can also be done with C#, I think
Or even better (and probably harder to do) would be a C# compiler that creates machine code.
Is this a good idea or is it just dead wrong?
Big companies... (Score:4, Insightful)
I have a feeling that C# will be adopted by Microsoft's technology partners, but why would any firm that has spent time and money moving away from Microsoft products go running back because of a new product offering? Its not the products we're trying to get rid of, its the company.
I'm impressed by C# -- the language (Score:5, Insightful)
We need a modern, productive system for producing new high-performance GUI apps: apps that look and feel as if they'd been written in C++ -- without the crashes and slow dev cycle. I'd give up some of the flexibility of C++ (you can write drivers, create an OS, build a browser, it's a dessert topping AND a floor wax) for something truly optimized for what matters most in creating superb GUI apps quickly and well.
I've had high hopes for Eiffel and some others to evolve into the successor to C++ for GUI apps, but it never happens. The inertia of programming languages is immense.
The next to step up to bat is C#. I like the language a lot and think it lends itself to great dev systems. I'm suspicious of the bytecode aspect, though. ("Faster than compiled!", "It actually is compiled!", etc. Yeah, so why isn't Solaris written in Java?) I'm afraid that aspect will still require that "serious" apps be written in C/C++.
I like even less that it may remain Windows-only. If it does remain Windows only (for all practical purposes), I suspect the blame will belong just as much to MS haters dismissing it primarily out of bigotry as to MS for optimizing it for their own platforms.
I'd like to see the open source community look at it with the same eyes as if it had come out of some smelly hacker's basement.
Multiplatform increasing in importance (Score:4, Insightful)
Servers tend to run Unix or legacy OSes. Embedded devices run Palm OS or a free Unix like Linux or BSD. Phones run all kinds of custom software. The only platform that Windows rules is the desktop, and that market segment just shrunk for the first time in history. How can C# dominate if it only runs on one type of device?
my $0.02 (Score:5, Insightful)
For pure Windows programmers, C# wins there and will probably be picked up by lots of VB and VisualC++ programmers. But people who live in that world are already not using Java. For everybody else, Java seems to win hands down. I think C# will neither be a complete failure nor will it do much harm to Java.
Java vs. C# (Score:1)
Regardless of the technical issues, I think everyone involved in software development should think long and hard before committing to a Microsoft-inspired approach. Microsoft's track record on getting people to buy into platform lock is clear. It is in your company's best interest to avoid Microsoft lockin in almost every case.
One of the saddest things that's happened in some time is the Mono team's committing to C#. It should have been gcj. Shame on them for encouraging the use of Microsoft's platform. IMO, Ximian can be well assured that Microsoft will either change, patent or extend things until Mono is irrelevant in the end - after lots of Open Source energy has been expended on that dead end.
On the other hand, Java continues to gain momentum in almost every area. There are good VMs available on every important desktop platform (as well as most embedded and server platforms). Go forth and code! ;-)
299,792,458 m/s...not just a good idea, its the law!
Interesting, but there's an error... (Score:3, Informative)
In the end, does it matter? (Score:1)
I think you'll see that in the long run VB, VC++ shops are going to use C#, and Java shops are going to run Java regardless of the inherent capabilities of the languages.
w00t? no dynamic class loading? (Score:4, Informative)
I design JBoss, the leading J2EE server and at THE HEART of it is the capicity to dynamically deploy new applications on our application server. I mean that is what application servers are ALL ABOUT.
in fact (plug) in JBoss we go the extra mile and allow you to hot-deploy (dynamically add classes) the server classes themselves, which neither IBM nor BEA, nor Oracle do.
So I was curious to know who would win the
Why? well imagine that ANY time you change your class in C# YOU NEED TO REBOOT THE APPLICATION SERVER, yes, boys and girls that is the simple thing that "dynamic class loading" affords you, without it, the VM is tied to whatever you have at startup.
GEEEEZZZ!
Having used .NET (Score:3, Informative)
The first release of .NET will still be 2-3 releases from full fault tolerance and enterprise level computing. There are alot of complicated processes in enterprise computing and Microsoft's .NET platform as it stands today is far from meeting those needs. Microsoft has yet to define really useful modules and standards for complex processes that span multiple systems which include legacy VMS systems and modern solaris 8 applications.
SOAP is great for simple processes, but it is far from adaquate to handle distributed and transactional processes. Using standards like UDDI is a great step towards easing multi-platform integration. Instead of having different divisions of the same company design different API for publishing resources, it will be easier to have a common way of doing those things. It is not uncommon for financial institutions to store information differently. Take a simple think like address. Some places may store the number in a separate field, while others may replace "jr" with "junior". Anyone who has worked with large mixed environments knows this fact. SOAP is a message centric way of doing things. It is not designed for complex processes. The stuff IBM is building around SOAP is more complete than Microsoft's offering, but then again IBM has been at services longer.
Java all the way! (Score:1)
My take (Score:5, Interesting)
I just recently picked up C# about a month ago. The learning curve from Java was pretty damn low, only with a few different naming conventions and new language constructs. Things such as indexers, delegates, and the like (all of which I feel are positive additons to the language.) The event model, to my surprise, is better than Java.
Then after learning the language itself I started looking into Windows Forms and nearly spooged my pants. Finally Windows progammers get a clean framework of GUI controls with a powerful modern language behind it (ie, not C++ or VB.)
Usually if you wanted to make a powerful Windows app you were forced to use C++ since VB didn't really cut it. Now you can use C#. Complex Windows apps are going to be a whole lot easier to write now, nevermind the fact that they'll be able to do remote method calls via SOAP, and be deployed effortlessly (ie, create a Windows Installer in like 3 clicks or something.)
I have to say, for the stuff I'm writing that I don't need cross-platform compatibility (which I did surprisingly find to work in the case of servlets)
Langs the same. Companies differ. (Score:4, Interesting)
The things that make these two different as a language are pretty trivial. As a Chem. Eng. professor told me when I asked if I needed to bother with FORTRAN when I already knew Pascal, "They're all different dialects of the same langauge".
The only real difference is that you'll want to use the dialect best suited to your particular programming task. If you want to leverage code written in
The biggest difference isn't syntaxical. It's the mindset of the companies behind the code. No matter how many times MS wants to claim C# isn't a Java clone, the point is it's a well-done language based on lessons learned by programmers who are familiar with Java. My only fear is that C#, an excellent language in theory by anyone's measure, is going to be wrung through Microsoft's "profit maximization machine" and be made to do things that, in practice, aren't the best.
The neat part is that people familiar with C#'s concepts will also be able to quickly learn Java! I wouldn't be too surprised to see some VB programmers turned C# developers start to think, "Hey, you know it wouldn't be that hard to run this on [Linux/OS X/etc] by implementing this idea in Java!"
Ironic (Score:1)
C# is slightly better than Java (Score:2)
However, this doesn't justify establishing an entirely new, closed language system for developers to have to deal with. I am disgusted that Bill and Scott could get together to resolve their differences. Now they've forced tens of billions of dollars of wasteful duplication on the world.
Slashdotted! (Score:3, Informative)
The author has it backwards (C++ vs Java) (Score:1, Funny)
Firstly, the author has this backwards: the Java language design is dictated by one organization -- Sun; thus, akin to French. C++ is the result of broad-based popular demand (the C++ Standards Committe).
Secondly, C++ is in many important ways significantly more modernized than Java. Most important is templates and the STL, supporting generic programming. Also important is multiple inheritance. While C++ doesn't "have garbage collection", it is no problem to design a programming framework in C++ which supports it (and you can design a much more sophisticated garbage collection system than comes with Java). Besides, with STL-style programming, it is becoming ever-less important as an issue. Meanwhile, Java suffers from its inability to precisely control when objects are destructed.
Java certainly has its uses. It's a fantastic platform for rapid cross-platform development. However, it's not in the same league as C++. You'd write Java in C++, but not the reverse. It's somewhere between a scripting language and a "serious" language.
C# is what Java developers really want... (Score:5, Interesting)
Java really hasn't changed much since its inception. All we have are a few more libraries, a GUI framework that blows ass, and a server-side framework that we didn't really need to begin with. But we have no real additional language FEATURES.
Like a lot of people, I've been using Java since the beginning. I look at the C# language and I see everything I want in Java. The great majority of differences between C# and Java are purely syntactical sugar -- compiler candy. AND THAT IS WHAT WE WANT.
We've been asking for support for generics and parametric types since JDK1.1. And they still aren't in (they were removed from 1.4 at the last minute). We've been asking for A REAL CONST. We've been asking for assertions -- and finally got them.
But all in all... most SEASONED Java developers aren't happy with the progress. Java has been plainly behind the curve when it comes to evolving new and different features. Instead, Sun poured all of their effort into their bullshit J2EE framework which is a complete shambles, IMHO.
Its obvious. Microsoft simply went to Usenet... read a bunch of Java posts... and saw that Java was stagnant. They took advantage of it. They created a new language... based upon Java... adding everything that Java developers were complaining about. Voila! C#!
I wonder if this would have happened if Java were open source. Probably not.
But one thing for sure... Microsoft is an EXPERT at catching a company while it is asleep at the wheel... ripping of its product... making it better... and seizing an entire market.
They just might be doing it again...
C# just a rip-off of Java? (Score:2)
I'd like to congratulate Dare Obasanjo on his extensive comparison between Java and C#. After reading it, and my anti-Microsoft bias aside, I've come to the conclusion that C# is basically a rip off of Java, with a few extra features that might make it an interesting development platform. As always, I feel that Microsoft has implemented a system designed as an integrated part of Windows, to keep the development community (and, therefore, the user community) at Microsoft's mercy.
I say this for the following reasons (and, again, I'm trying my best to place my anti-Microsoft bias aside):
Well, whatever. Forget it. I'll probably just get flamed by a bunch of people, and moderated as a troll or something. Oh well. My karma has been going down for the past few days because some really crappy stories have been posted on the front page, and when I read crappy stories, I write crappy comments. Or something like that. Oh well.
array error (Score:1)
From the article:
"In languages like C and C++, each subarray of a multidimensional array must have the same dimensions. In Java and C# arrays do not have to be uniform because jagged arrays can be created as one-dimensional arrays of arrays"
In C, C++, or any other language that allows pointers and runtime memory allocation you can set up jagged multidimensional arrays almost as easily. You have to use pointers, but that's no biggie.
Laundry list of corrections (Score:4, Insightful)
My corrections:
A.2: Java doesn't have an "unsafe" keyword; C# and Java have a "volatile" keyword that is strangely missing. And don't you think it's strange that he doesn't equate C#'s "extern" with Java's "native"? They're approximately the same.
A.5: Neglects to mention here that C# has square *and* jagged arrays, it is stuck in section D.
A.10: The phrase "both languages have an inheritance hierarchy where all exceptions are derived from a single Exception class" is a tautology, because "all exceptions" *are* exceptions because they extend Exception! Whereas if he meant to say "all objects that can be thrown are instances of types derived from a single Exception class" he would be wrong, because in Java these all derive from java.lang.Throwable.
The sentence two sentences after that one, starting "Finally, both languages..." does not make sense.
B.8: The last statement in this paragraph is incorrect. Isn't it possibly in Java to simply write ArrayList.class, if java.util.ArrayList has been imported? Likewise in C#, where if System.Collections has not been using'ed it is necessary to write typeof(System.Collections.ArrayList).
C.1: This really should mention delegates here. It was inner classes v. delegates that heated up the Sun vs. J++ debate. Thus C# doesn't suffer a "lack" of inner classes, rather it suffers an ideological difference with Java, don't you think? And likewise, Java doesn't suffer a "lack" of delegates.
C.3: The criticism that, for example, it is possible to overload "", and this makes overloading bad, and C# has overloading, hence C# is bad-- is nonsense! In C# it is illegal to overload, for example "", or "==" but not "!=".
It also says "()" (I assume meaning cast) and "[]" can not be overloaded. This is again very precise and misleading language. They can not be overloaded, because custom conversions and indexers can be used instead!
It also fails to mention that "&&", etc. will call "&". The blanket statement that "&&", "||", etc. "can not be overloaded" is very misleading.
C.4: You can "fall through" in C#, with goto. Except unlike Java, in C# it is explicit (and more flexible).
Fails to mention Java's limited range of "switch" statements, whereas e.g. C# can switch on a ulong.
C.5: Seems to miss the distinction between *assemblies* and *modules*.
C.6: Some of these criticisms are unfair, e.g. that Java has thread-safe collections. In C#, a reference to a synchronized wrapper can be kept and the un-thread safe reference be let go out of scope!
Not mentioning boxing and unboxing here is a failure: one of the chief gripes with Java's collections is that it is necessary to wrap the primitive types in their class equivalents.
C.7: Java has a labeled goto of sorts-- break and continue. Thus some of the criticisms of the weakness of languages with goto may also be applied to Java.
C.8: Is this section intended to confuse? The fact that marking a method final in Java means that subclasses cannot contain a method with a similar signature is a *coincidence* arising from the fact that (a) final means methods can not be overridden and (b) Java does not have new/reintroduce semantics and relies instead of the name and parameters. Thus C#'s final achieves exactly the same as Java's in terms of dynamic linking and dispatch-- that a particular method can not be overridden.
D.3: Should probably mention that
Well, that's my $0.02. Apart from those glaring problems, the discussion is not bad.
Jagged arrays (Score:2, Informative)
After all, in C, I'd use:
int* array[2];
array[0] = (int*)calloc(sizeof(int), 3);
array[1] = (int*)calloc(sizeof(int), 9);
True, this doesn't use heap-based stack, but to me, the functionality is the same...
C++ is the best, if you know how to use it... (Score:1)
Here is a garbage collector for C++ which does not use threads. You just have to use a special template pointer class, and your garbage collected objects should be derived from a special object class, that contains a reference counter.
When a pointer is assigned the object, the reference counter of the object increases. When a pointer is assigned to another object, the previous object's reference counter is decreased. When it reaches 0, the object is deleted, because no pointer in the program refers to this object any more.
Here is the link to the code...as you can see it is almost 100 lines of code, heavily commented...no need for garbage collector threads or other stuff...
C++ garbage collector [geocities.com]
My point is that if C++ was properly used, Java/C#/VB would not be needed.
And for a very good C++ GUI toolkit, use Qt [trolltech.com]
C# may be very good for Java (Score:2, Insightful)
2. Many VB and C++ developers will move to C#. They will then be in an ideal position to transition to Java with little effort if they have a requirement for cross-platform apps.
Stability, Adoption, and Java (Score:1)
But I'm reminded by something that Bill Joy said at the first or second JavaOne conference. He was relating his experience with NFS. It took years for everyone to make compliant implementations. He concluded, probably correctly, that the most important factor to securing adoption of the Java language is to not change it.
Having watched the evolution of Java and the JDK since the alpha2 release, I'm inclined to agree. It wasn't until JDK 1.2 that WORA became a matter of discipline, versus somewhat hard. And JDK 1.4 (now in beta) is truly boss.
Stack-Based Classes (Score:1)
---
Hi Dare-
Thanks for writing and posting your comparison. Eventually, I'll need to get some project experience using C# -- your article will surely prove helpful.
I do have an initial comment. I believe C#'s exposure of low-level machine constructs to be misguided and ultimately counterproductive.
C#'s "stack based classes" {see section 4, "Value Types (Structs)"} is one such feature. As with garbage collection, the decision to allocate objects on the stack or heap is best left to the runtime (virtual machine). Note that nothing in the Java Specs disallows allocating objects on the stack; that's an implementation detail.
Jalapeño is IBM's research Java Virtual Machine (recently released as the open source Jikes JVM). Here's an interesting paper detailing their technique for determining when objects can be allocated on the stack:
Escape Analysis for Java
http://www.research.ibm.com/jalapeno/publication.
(The paper also covers the elimination of unnecessary synchronization; also very cool.)
So if C#'s "struct" keyword (for stack-based classes) isn't necessary, neither is the "boxing" hack for wrapping "struct" objects in a class.
Escape analysis and the like could probably be applied to C# (and the CLR). But why provide the language feature if it's unnecessary?
The worst part, though, is that C#'s stack-based classes feature focuses attention on the implementation instead of on the problem domain. I'm sure there's a quote about premature optimization that applies.
Again, thank you for posting your comparison!
Cheers, Jason
Re:It doesn't matter how good it is (Score:1)
Re:Resist the Urge! (Score:1)
This is about the relative merits of C# vs. Java. Better the programming world should be coopted by Sun?
Java != Sun (Score:5, Informative)
If there are any good ideas in C#, there's really no reason it couldn't be adopted by Java. Someone just has to submit a request
Re:It doesn't matter how good it is (Score:1)
Re:Run Away Run Away (Score:1)
One should always be aware of any vested interest or bias of opinion from a news source. There are very few truly impartial third parties. The fact that the party in question here is Microsoft makes me question the motiviation no more than any other party.
Re:It doesn't matter how good it is (Score:1)
Go Here: (Score:1, Informative)
Re:C# is really kinda cool stuff (Score:1)
Least you could have done was fix my spelling errors, I suck at spelling. and math, thats why I became a programmer. With the minor sytax changes in C# I should be right on course from my C++ typos
And to the MODERATORS , I AM THE ORIGINAL AUTOR OF THIS ARTICLE !!!, be kind....
Re:urm yeah, 'up and coming dev guys' take some ad (Score:2, Informative)
Re:C# is a revolutionary paradigm (Score:1)
My first thought was, "Oh no! Another Microsoft cheerleader."!
Re:History (Score:1)
You're either with us or against us.
Re:urm yeah, 'up and coming dev guys' take some ad (Score:1)
Check yer facts first, mate. I'm sorry that you didn't make the cut, but don't state pure horse dung like this.
Consider also the relative age and maturity of the three (four?) languages you're posting about. A quick poke through dice.com lands the following results:
Search on "java" keyword returns 3969 hits.
Search on "C++" keyword returns 7645 hits.
Search on "C" keyword returns 7645 hits.
Search on "C#" keyword returns 7645 hits.
Java was released to the public in late 1995/early 1996. C++ was "released" sometime around 1984, I think. C was "released" roughly around 1970.
A couple noteworthy points:
Notice the *identical* number of hits for C, C++ and C#? Obviously a flaw in the search on dice. However, it's probably safe to say that none of C, C++ or C# produces more than that number of hits legitimately.
Also, a large percentage (perhaps 75%) of the job listings and descriptions I see in my travels lists both Java *and* C++. Most PHB's think that if you know C++, you're good for Java too.
cheers,
BM
Bad Conclusion (Score:1)
The writer totally discounts the value of Java's far greater "maturity" as evidenced by the much more extensive container class libraries. These libraries aren't more extensive because somebody at Sun was smarter, no, Java simply has the jump on C# and its maturity shows. I'm not going to throw away my confidence in Java for some Johnnycomelately knock off. And oh by the way, I've got 14 years of C++, and don't miss anything about it with Java.
Another bites the dust (Score:1)
Another one bites the dust.
{dum dum dumb}
Another one bites the dust
Another one dies, another one dies
Another one bites the dust
HEY!
{dum dum dumb}
REMEBER THE 80s!
"WONDER TWIN POWERS, ACTIVATE !!!"
Re:interest? (Score:1)
Re:Brit'ny Spears confirms BSD is dead (Score:1)