C# From a Java Developer's Perspective
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.
well written... i wish my college would give more courses in cutting edge languages - although, we do have palm development classes...
C# is just another attempt by Microsoft to coopt the programming world. Stick with 'C', C++, Perl, Python, etc. Once C3 and .NET become entrenched you will be sorry!
Remember Lexington Green!
Low and behold... another has fallen...
What interest? irc.undernet.org number of users in C++ 100+, number of users in Java 100+, number of users in C# 1 (me) and 1 op. As of 3:30 EST.
There is a good, clean quick overview of C# here. The also do some comparison of C# to Java.
--
FearLinux.com
I doubt very seriously that any web designer is going to use a non portable language such as C# in which to code. Just an observation.
Insert sig here.
I hate sigs.
that Carnage4Life, the slashdotter's slashdotter, couldn't anticipate and survive a slashdotting?
[o]_O
any language that is completely controlled by one entity is bad for the industry.
we all know that. we should really do everything in our power to prevent PHBs from adopting them.
The Kruger Dunning explains most post on
Disregarding the fact that Java and C# are both "closed" languages controlled by large corporate entities with their own self-interests in mind, they both do an admirable job of bridging the gap between general purpose scripting languages and C++. Having used C# and Java on Win32 extensively in the past year, I have become accustomed to the automatic garbage collection, quick execution speed, and logically consistent design of both languages. The Windows compilers / runtime engines for both languages are quite amazing, and something for the fledgling gcj to aspire to.
.net (which is good for MS-only developers and bad for multiplatform programmers like myself), I'd have to pick Java if it was up to me just because of its sheer elegance. It seems like Sun did a better job designing a general-purpose language (applet "security" extensions aside), and Microsoft just tried to copy Java but add in proprietary extensions to hook C# into Windows. Thus, some of the C# features seem to be "bolted on", whereas most of Java came across as being very natural to me.
Although C# does deliver superior integration with Windows and
Just my 2c...
~wally
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
Unlike what the article says, Java does have a byte keyword.
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).
Language improvements have historicially opened the door to new productivity - in real terms - of apps getting cranked out. Higher and higher encapsulation in text or GUI worlds...but they don't all stick to the wall.
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.
with C# that "cross platform" will eventually mean Win9X, ME, NT, 2K and XP?
.NET-rix is everywhere...."
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}
If it is not on fire, it is a software problem.
On SourceForge there are already a few rather ambitious Open Source AI 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 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 and not merely the Final Take-Over of the 'Net by Microsoft.
Language wars abound, and I have no interest in propogating another.But truth is Java has become bloated far beyond its original design as a tv box controller. The best comparison I heard was Java was C without the corners, just like basic is fortran without the corners. C# seems more to me like the best of Java and C++ without many of the sharpest corners. I work in a split development world 1/2 *nix and 1/2 Win32 , none of us slashdotter want to acknowlege it but most of the desktop world is on windows, so to write a Win32 app your most viable options have been C, VB or some other monstrosity on a Win32 box like Java, have you ever tried to run a half a million line Desktop Java app on windows. Or to throw a Java app together in a nice pretty IDIOT proof installer so that the person who thinks a CDROM is a coffe cup holder can install it with one of the nice pretty MS installers, Java in those aspects , well...it sucks
....
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.
Sig went tro...aahemmm.....fishing........
Hey, I take offence to that!
I've been forced to write sites in ASP/SQLServer on a number occasions because thats what the client asks for (they figure if its all IIS and VBScript it'll run better, I know, dumb). So before you decide to look down upon someone using C# or VB or anything else, realize that there are a number of factors that go into what technology is used.
(I wish I could say my morals could standup to such a request, but low and behold, I want money too.)
Seriously, why do you expect someone to only code in a certain language? I feel that the more you know, the better a job can get done. Just because its a MS language doesn't mean that it is useless. You should do what's best for the client.
sin(6cos(r)+5A)
Please read this article with the same grain of salt you would read a Linux advocacy article from the CEO of RedHat.
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.
I don't know why anyone would be excited about C# unless they were also excited about Windows (I don't have to explain to anyone here why windows isn't too exciting).
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
A more careful reading of the article shows that the Java "byte" keyword == C# "sbyte" keyword -- Both are signed byte data types.
C# has the unsigned byte data type which it labels "byte"... Java does not have unsigned byte.
Language wars abound, and I have no interest in propogating another.But truth is Java has become bloated far beyond
....
its original design as a tv box controller. The best comparison I heard was Java was C without the corners, just likebasic is fortran without the corners. C# seems more to me like the best of Java and C++ without many of the sharpest
corners. I work in a split development world 1/2 *nix and 1/2 Win32 , none of us slashdotter want to acknowlege it but
most of the desktop world is on windows, so to write a Win32 app your most viable options have been C, VB or some
other monstrosity on a Win32 box like Java, have you ever tried to run a half a million line Desktop Java app on
windows. Or to throw a Java app together in a nice pretty IDIOT proof installer so that the person who thinks a
CDROM is a coffe cup holder can install it with one of the nice pretty MS installers, Java in those aspects , well...it
sucks
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.
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!
.. hmm. 25hoursaday.com. They may need that extra hour to recover from the slashdot effect.
The One Rule Of Chess You'll Ever Need: Don't play someone who carries a kit in their bookbag.
I couldn't get to the /. link either, but this site works fine:
http://www.kuro5hin.org/story/2001/11/18/152437/24
NOTE: The default accessibility of a C# field or method when no access modifier is specified is private while in Java it is protected. Actually, the default access modifier in Java if none is specified is package private, not protected.
Time and again ergo98 has posted comments that are heavily skewed in a pro-Microsoft light. Could he be one of billg's employees, trolling Slashdot for fun? It's worth considering at least.
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?
Although Sun engineers are handling the boards, the direction of Java is mostly influenced by the general public through the Java Community Process (See http://www.jcp.org/). Sun simply acts as an arbiter and caretaker.
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
Too bad C# does not have deterministic finalization - Java also made that mistake. Deterministic finalizations greatly reduces the amount of code you have to write, makes the code more threadsafe and you don't have to worry anout non-memory resource cleanup.
if you are a hobbiest, if you are sitting in your dorm room and want to learn something 'neat', learn java. If you want to make money, learn C/C++ in *nix or windows, or c#.
java is a toy
Didn't realize they were linking to same damn page. Sorry. Well, hell, I'm never modded up anyway, so who cares?
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.
It is quite simple
Haiku should not be funny
Try a Senryu
I've been a fan of Java since it was still in alpha, in early '95. I even wrote a piece of the Swing API. I'm still a Java fan (and developer), but sadly not for GUI apps. MS ("we own the client") and Sun ("we're not going to let this become just a better way to write Windows apps") collaborated to kill Java as a viable way to produce commercial-grade consumer GUI apps.
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.
"Those who have never entered upon scientific pursuits know not a tithe of the poetry by which they are surrounded."
How nice of you to engage in FUD. You've heard the term? Fear-Uncertainty-Doubt
.Net platform only runs on a subset of Windows products(i.e. they do not intend to support Windows 95), and there is debatable evidence that it will support other platforms.
.Net passport is absolutely false. No such requirement exists, and none shall ever exist. To make such a claim is to prove you have no understanding of what .Net is.
So allow me to eliminate some of your FUD, right here, right now.
It's true that as of right now the
This notion that it requires Windows Messenger and
It sounds like C# has some nice features that Java doesn't, but I have my doubts that Microsoft will make it multiplatform. And that is becoming more important as the range of computing devices widens.
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?
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.
Disregarding the fact that Java and C# are both "closed" languages
/ index.jshtml for more info on bugs and RFEs (Requests for Enhancements). Some of the suggestions are finding their way into the baseline - like generics (currently in development) and asserts (in 1.4 beta).
While I cannot speak for C#, I can dispute your comment about Java. You can download and view the source to the JVM and other Java tools. But Sun's so-called "Open source" disallows distribution of changes to the code. (so you're partially correct)
But users can send in ideas via their BugParade. See http://developer.java.sun.com/developer/bugParade
I dont if that can be done with C# - but given MS's track record, I would be surprised if they do.
The One Rule Of Chess You'll Ever Need: Don't play someone who carries a kit in their bookbag.
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!
Galileo: "The Earth revolves around the Sun!"
Score: -1 100% Flamebait
The absence of checked exceptions in C# is stupid. Checked exceptions are one of the correctness-helper thingys that has made Java so popular in the enterprise computing world. C# is like a Java without the Bondage & Discipline that makes Java so suitable for use for business logic. Java is great for mixed-experience teams of porgrammers, unlike C#, which combines most of the disadvantages of C++ with most of the disadvantages of Java.
How does $100K/year sound to you?
Piddling.
How does $100K/year sound to you?
Like a sad excuse at waving your small dick for the approval of a minor AC troll.
I may be mistaken, but I recall this issue being based upon the garbage collection implemented by the runtimes for the languages.
20 January 2017: the End of an Error.
In the alpha days of Java, I suggested to Sun that they incorporate some very popular Perl features, such as a foreach and containers that allowed for such things as "foreach char ch in myString" or "foreach int i in myIntVector" or "foreach int i in 30..1", etc.
The senior designers repeatedly treated such suggestions with contempt. Arthur van Hoff told me, "If you want to use Perl, just use Perl!"
The MS people I spoke to in the early stages of C# were very interested in input like this. Where Sun's attitude toward "why can't we have X?" was "because we said so", MS's was "hmm, that would be popular, I wonder if we could find a way...."
Say what you will about MS, one of their standard techniques for locking you in is to try to make what people are asking for. Contrast this to Apple and Sun ("we're your superiors, so use what we tell you to use"), and Linux ("make it yourself, luser!").
"Those who have never entered upon scientific pursuits know not a tithe of the poetry by which they are surrounded."
Ultimately the people using these languages tend to base their decisions on the platforms they wish to use and less upon the language. If you are running a Unix/Linux environment you aren't going to seriously consider C#, and for the most part doing work in Java under windows is more trouble than it's worth.
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.
This sig has been temporarily disconnected or is no longer in service
How can anyone say that IIS is good for a client? Constantly rebuilding virus infested desktops is good for no one. While you have to give the poor devil what they ask for, you might try a few predictions so that when things go south you can come in and fix thing right. Good luck.
Security sure is a bitch when you don't have real user accounts.
DMCA, Hollings, Palladium. What might have sounded like paranoia is now common sense.
Well, I'm more than happy with it.
And you respond to that? Hmmm.
I did not know that (and couldn't read the full description as the site is totally /.ed :(
.net webservices race but it is extremelly clear in my mind, J2EE frameworks will deliver with webservices easier than any C# framework will
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!
The real mnf999 always posts as anonymous coward
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.
Why choose a vendor locked in language, when you can have; write once run everywhere (these days this is more true than ever); program for the webb, 3G mobile solutions (J2ME), desktop, embedded systems etc etc and no vendor lock in! The day MS can show me something equivalent to this I will at least consider their solution!
Try to do a search of ".NET" on Google - you can't! What a poorly chosen name for a product line Microsoft!
I bought "Professional C#" (Wrox) specifically because it was a C# book and not a VisualStudio book (well there's 1 chapter on VS, but it's otherwise heavy on notepad and the commandline)
.NET!)
However, this book was based on the SDK betas was probably primarily written before VS7 betas got wide release. My fear is that the C# book market will go the way of VB and become "How to Use the Wizards".
But, there is some light at the end of the tunnel. Working in MS shops over the last few years, very few programmers use the utter crap that MS pumps out and instead stick to the core tech -- I've seen hardly any InterDev templates and VB 'web classes'. That's not to say that people don't use that shite, just that it's less common than MS asskisser club makes you think it is. (And the funny thing is that that anyone who did use that crap needs to rewrite from scratch for
...do you use a language that won't even properly exist until February next year, when Visual Studio.NET will actually be released?
If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
I've been a Java programmer since JDK 1.0 came out, though I've really done most of my Java coding with server side servlet stuff since the GUI library has, and probably always will, suck the wanker.
.. C# and the .NET framework wins hands down.
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)
--
I've done a little C# programming and I've done more Java programming. Heck, I've even done some J# (http://msdn.microsoft.com/downloads/default.asp?U RL=/downloads/sample.asp?url=/msdn-files/027/001/7 54/msdncompositedoc.xml) programming.
.NET quickly and easily and build off of a Web Service on another office's server or if you have hoardes of legacy COM code, you'll use C#. If you have a giant UNIX server farm running JSP you'll use... That's right! Java. If you're a madman who likes to make Frankensteins in your spare time, you'll use J#. :^)
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!"
It's all 0s and 1s. Or it's not.
By any chance are you related to H. E. President Olusegun Obasanjo of Nigeria? I've been getting these emails, and if they are for real these Nigerians will deposit very large sum of money into my bank account.
Can you verify if this is for real? Here is a sample of the emails I have been receiving. They seem to be very persistent, so I figure they must be desperate.
To:
Subject: ASSISTANCE.
MIME-Version: 1.0
Content-Type: text/plain;charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
CONTRACT REVIEW PANEL,
10 ADEKUNLE STREET,
APAPA- LAGOS,
NIGERIA.
FROM:BARRISTER DANLADI SAMBO.
ATTN:PRESIDENT/CEO.
First,I must solicit your strictest confidence in this transaction, this is by virtue of its nature as being utterly confidential and top secret.
I am the Legal adviser to the Contract Review Panel instituted
by H. E. President Olusegun Obasanjo to probe/review all Contracts
executed and payments made during the regime of late General
Sani Abacha. I have been mandated by my colleagues on the Panel
to seek your assistance in the transfer of the sum of US$18.5
Million into your Bank Account. As you may know, the late General
Abacha and members of his government embezzled billions of dollars
through spurious contracts and payments to foreigners between
1993 and 1998 and this is now the subject of probe by my Panel.
In the course of our review, we have discovered this sum of
$18.5illion, which the former dictator could not transfer
from the dedicated account of the Central Bank of Nigeria before
his sudden death in June 1998. It is this amount that my Colleagues
and I have decided to acquire for ourselves through your assistance.
This assistance becomes crucial because we cannot acquire the
funds in our names and as government officials we are not allowed
to own or operate foreign bank accounts. We have thus developed
a, fool proof, legal and totally risk free scheme through which
the fund can be transferred to your nominated bank account within
a very short time. The scheme is to use our position and influence
on the Panel to represent you as a foreign Contractor beneficiary
of the funds. We shall arrange all documentation to support
this claim and get Approval for the transfer of the funds for
your benefit on our behalf. The scheme is perfected to be 100%
risk free and we are sure the funds can arrive your Account
within 10-14 working days from when you agree to assist us.
You should acknowledge the receipt of my mail through the above
e-mail address so we can further discuss the modalities of your
cooperation and negotiate the charge for the usage of your Account.
You definitely have a lot to benefit from this transaction as
we are prepared to give you 30% of the total funds as
soon as you secure it in your account.
Please, endeavor to send me an e-mail indicating your interest
as to enable me furnish you with my confidential telephone/fax
number through which we can communicate with you in confidence
(in your response) as the need for secrecy is great to this
transaction.
We expect your urgent response.
Yours faithfully,
BARRISTER DANLADI SAMBO.
C# has as much (or less) cross platform as NT has/had.
Isn't it ironic that a site called 25hoursaday is down?
It seems that most of the MS IIS admins I know don't think anything of it. Here at UCLA, they bring the whole URSA (student services) website down for hours on end during the weekend for maintainence and improvements (it runs on MS, IIS). My suggestion that you shouldn't need to bring your whole site down to tweak it didn't even get a reply.
Funny, but it seems to be the culture. I wonder if most people would care whether MS's stuff stayed up even if they made it as good as a Tandem (?).
I still haven't figured this one out.
-RB
"One man can change the world with a bullet in the right place."
- Mick Travis, "If..."
Java doesn't have any unsigned types.
Stupid slashdot lameness filter. Shouldn't a geek site support a means of posting source code??
Gee, you mean like being able to generate an app that causes a BSOD using a java-like syntax?
All kidding aside, there are some cool ideas in the language. Support for enumeration is one. Currently most enum-type things in Java are done with integers, and so you have to do bounds checking whenever you get a value. The foreach operator is another nice one. It's a minor change, but it makes certain loops much quicker to write and much more readable. I also like operator overloading. It has never seemed right that in Java "+" concatenates strings, which are objects, but they're the only special object in the system. I admit that in C++ doing operator overloading properly can be hard, but it's a really convenient OO feature.
The C# way of multiple interface implementation seems like it could be good, but will mostly just cause programmer errors.
public interface ITeller
{
void Next ();
}
public interface IIterator
{
void Next ();
}
public class Clark : ITeller, IIterator
{
void ITeller.Next () {
}
void IIterator.Next () {
}
}
To me that just looks like a bug waiting to happen. Under occasional circumstances it means you can do something you couldn't otherwise do, but this just looks dangerous to me.
Mostly though I look at C# and say to myself: "Shouldn't a language that was designed years after Java be better than Java?". Java got rid of the preprocessor. This is a good thing, C# brings it back. That's a bad thing. (I know, conditional compilation is nice, but don't do it with a preprocessor, ick!) And what about reflection and dynamic class loading? Those are some sweet features, especially in a networked language, but in C# they're missing/gutted.
And then there's just wierd-ass syntax pollution:
[AuthorAttribute ("Ben Albahari")]
...
class A
{
[Localizable(true)]
public String Text {
get {return text;
}
}
}
I can accept the strange getter/setter method, though I think it's dumb. It's just vb-like, with a strange and confusing mix of methods, functions and subroutines. But what's with that array-like crap? Btw, that's also how synchronized methods are declared.
I wonder if Sun would ever agree to put some of the nice features into Java, or if the language is essentially frozen, and they're going to work on the APIs.
Btw, the MSXML parser? It's certainly MS, and certainly not XML.
Seriously. Everytime I have to write for(int i; i<a.length;i++) dosomething(a[i]); I find it so unnatural.
Note that this is not exactly a "Perl" functionality, it was avaible in ksh and Lisp languages before that.
Java (and C# as well it seems) are sooooo fucking verbose, I understand not everybody likes this feature in Perl, but there's something to learn from Perl's popularity, isn't it?
There are common idioms (such as the "for" I listed above that's equivalent to foreach) that are much more readable if they are easily told apart from more complex things.
For instance, the for(;;) statement of C/C++/Java/Perl/C# might be much more flexible than Basic's FOR var=N TO M, but the latter makes it clear what you're doing; while the former might have a subtle difference (such as <= instead of <) that's not immediately obivous.
Perl offers some very interesting shortcuts that increase readability: foreach (1..100) { dosomething } *is* more readable than the java equivalent.
And when you need greater flexibility, the more complex form is available as well.
You gave yourself away already in the title, when you used the words "revolutionary paradigm"!
My first thought was, "Oh no! Another Microsoft cheerleader."!
Fixed a few things that annoyed me.
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.
Verily, but for us, we need only the mothertongue, C, and her bastard child, C++.
Forsooth, may those who fall under the spell of the Twins of Evil be damned for all time!
Forth gcc!
Arrgh, have you ever actually built a large program?
How about this?
class Proxy
{
private ProxiedObject target;
public int size {
get {
return target.size;
}
set {
target.size = value;
}
}
}
proxy.size *= 2;
Now how nice is that? There are numerous and sundry uses for properties. I didn't know about them until I read that article and they alone are going to make me learn C#. Network, database, and adapter pattern proxying, transparent access to calculated values, all are extremely useful tools which I am dying to use. Any programmer whose life is not simplified by this is not a professional programmer, IMHO.
Acy
-- Too lazy to get a lower UID.
For those who feel like they're downloading the page over a 110-baud modem with an acoustic coupler located in the same room as a Disaster Area concert, here are some other similar comparisons.
The problem is that "the pure windows programmers" are a pretty big slice. Your assessment of VB and VC++ might be slightly overgeneralized since I'm a pure Windoze hacker (for the moment) and I only use Java.
I don't know the exact numbers but I do know that Sun has sunk a truckload of time and money into JDK development on Windows. You could argue that this is just to support applets but how many JRE 1.2+ applets have you seen?
I'd love to see M$ fall flat but I don't see it happening. The main benefit of Java on Windows was a great language with good libraries. Well, M$ stole the language and they're guaranteed to have better access to the OS. Sadly, it looks like Java may be relegated to the niche you described.
Never underestimate the power of fiber.
Every fucking story is your excuse to promote your total piece of shit Mind project, isn't it?
NOBODY FUCKING CARES!
You've never accomplished a single thing, you're a crackpot. Go do something worthwhile, like flip burgers at McDonalds.
Get it here
PS: Mirrors encouraged, so if you manage to grab it and can host it at a site with beefier bandwidth, go ahead.
You can't afford to lose even 1 point because you are a moron who doesn't post anything worth hearing.
The sooner you post at a base score of '0', the better for all of us.
That's how moderation works.
Microsoft has a history of taking a nice, simple technology and fucking it up by making it inelegant and incompatable.
...
C# is no exception.
I am starting to think that perhaps the purpose is not to be incompatible to lock ppl into Windows, rather that they have some strange breed of ppl who know no better than to make some real ugly shit. One rotten apple spoils the barrel, I guess.
Kinda feel sorry for them
here.
It'll be off the front page tomorrow, so all these mirrors shouldn't be needed...
[o]_O
The funny part is that web developers loves java (or so I understand) but hates the "speed" or lack thereof.
.1 release just kicked, because the interface was usable...let me rephrase that, usable it is, but "responsive" was needed.
.NET compliant and not the other way around.
.NET...go for it! People develop according to whatever spec is sent out, .NET is still looks, smells and tastes like beta, because it is beta.
.NET I think.
.NET.
The thinng that made "people like java's speed" on windows was window's specific acceleration.
The thing that always struck me as odd was there were no "libraries" or "includes" that were platform specific for acceleration purposes on other hardware.
Simple reason being is sometimes *perception* is the only thing that matters.
Witness os X.1.1... the
I forget who pointed it out, but the gui was slow, but the subsystems were ok.
Also the "tie-ins" like renice only affected command line utilities and not gui utilities.
I had to re-read some of the responses a second time and noticed that Microsoft and standards were mentioned in the same breath.
Maybe I am thinking too far ahead, or perhaps way off base, but people are developing, it seems, to be
The reason this "seem so wrong" is instead of "Embrace, Extend, and Extinguish" it is along the lines of "Develop, Distract and Destroy"... same, ends, different means.
IOW, Hey, here is the framework to
Betas change. And so will the "rules" of
I dunno, perhaps a slogan to plant should be:
"Didn't your parents always tell you *NEVER* run with # objects?"
Neuron misfire of the day:
MSN has a Butterfly. Passport is part of
So, when passport is needed for MSN..would that be a Butterfly.NET?
(Where did that come from? {shrug}
If it is not on fire, it is a software problem.
You don't even need a separate class to be instantiated. Just use Strings.
public final static Direction NORTH = "NORTH".intern();
public final static Direction SOUTH = "SOUTH".intern();
public final static Direction EAST = "EAST".intern();
public final static Direction WEST = "WEST".intern();
Of course the real problem is these languages do not have symbols as a data type. In Smalltalk... #north #south #east #west In Lisp... 'north 'south 'east 'west
Why pay M$ significant money for a GUI when I get Swing, Jakarta, etc. for free?
We dislike the company, not the language. C#, since it is a Java knock-off with a few extras, is like Java 2.0 as far as the language goes. It has some nice improvements--sort of like whe Interfaces were added or Swing replaced AWT. But there's the rub. The problem is the company which made it only made it to work tightly with Windows and Windows only. They have so tighly coupled Windows to the langauge, I wonder how it can be ported to other plstforms. Still I'd use a C# that ran on Unix, Linux, BSD, and OSX. When they bring out the multi-platform Swing equivalent, I'll give it a try. Until then, Java does quite nicely thank you.
Java doesn't have any unsigned types.
Actually, it does: the char type is unsigned. But Java doesn't really need any unsigned types because it has the >>> operator.
-no broken link
The only "standards" body C# has seen is ECMA which seems to be a rubberstamper for whatever MS wants to push.
Have you ever read some of the more in-depth Microsoft Press books? They are anything but "How to use Visual Studio Wizards"...
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.
Horseshoes and Nuclear weapons.
.NET brings to the table that Java doesn't is "tight OS integration". Of course, I'm not even sure what that means at times... Your VM crashing is more likely to bring down your whole system? Your VM load time will get bundled into your boot time? Perhaps your windows might load a little faster? If you think this is desirable(maybe) and more important than good competitive library support(doubtful) *and* matters more than competitive VM support, by all means use .NET.
.NET aside from being an abomination to any naming convention created is not even "code compatible" with their own products. All those poor sods who trusted their business to VB5 or VB6 a while back will have to rewrite lines and lines of code to even be able to run on this "new and improved" platform in their "language of choice": VB.NET. I mean come on, If I have to rewrite my code to get it to run, we are not talking the same language here! VB.NET is not VB7, it's .NET with a VB "skin". By the same token, C# is not a Java competitor, or an upgrade to C++, but just another skin for .NET.
.NET worth using? Maybe, but making it incompatible with all existing languages doesn't make it appeal to this developer. And quite frankly the idea that .NET will be the interface or "gatekeeper" to all future Windows components (it's the win32 of tomorrow) gets me thinking of alternatives.
"Almost the same" and "leveraging your knowledge" are nearly useless in this industry. Any programmer that can't pick up a brand new language in under 2 weeks needs a different job title(yes, mastery and "pick up" are different, but so are Java and C#!). The least Microsoft could have done when they decided to clone Java would have been to make things "code compatible".
By making them "nearly" identical, they just create an appearance of similarity that fools only those so described. Of course, to actually be fully compatible they'd have to provide a library equivalent to what Java provides. In this, they aren't even close, and don't stand a chance for several years, partly because Sun has worked so hard on this, partly because of all the third party projects in Java.
The only thing
But lets ignore design issues and look at the track records so far.
Look at Sun's track record by comparison. Sure, they haven't made Java a "standard" and they've pushed at times against the community, but when the community started pushing back, by and large they listened. You can take Java 1.1 code and run it on a 1.3 VM, or even a 1.4 VM with no compatibility problems whatsoever.
Is
Sun's goal may be to rule the world, but Microsoft's seems to be, "Make the developer's life a miserable and slow to product existence."
...then again, so is paint drying.
Some are ok, some are just marketing crap.
Excellent point. In fact, I have to say I agree with both of you. I really tried to give Carnage4Life a chance on kuro5hin, but he'd always come back and flame me, even when I agreed with him. He's so damned desperate to flame anyone who has Open Source ideals, mainly because he feels ostracised for having worked at Microsoft.
But you're right. Bob Young or (in years past...not true now) Larry Augustin aren't any more credible sources than Bill Gates. All of 'em like to spout business rhetoric. And hey, I live in America, where the "world" revolves around business.
The fact that the party in question here is Microsoft makes me question the motiviation no more than any other party.
(OT: dangit, I keep trying to middle-click-paste right now, and I'm running Win98 'cause I'm too lazy to install the silly CrossOver plugin to view a QuickTime movie trailer. Bah.)
Right. And I've got to think that there's developers working for MS scratching their heads about all the hate foisted upon C# just for being MS. Yeah, it's going to be used as a marketing tool rather than genuinely as an innovative tech tool. But how much was Linux used as a marketing gimmick in the last 3 years? And for all you people worried about C# taking over the world, look at the beating the Linux world has taken, mainly because companies used Linux as a marketing gimmick?
People, relax.
Stating on Slashdot that I like cheese since 1997.
C# being better designed than Java is no big surprise. Why? Because Sun has done very little to further the actual language itself.
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...
A jagged array is an array of arrays, a multidimensional array is something different.
Looks to me like its just another Visual Basic -- a language tightly integrated to the Windows platform. Knowing the amount of open source developers concentrating exclusively on the Windows platform... well, why the hell would anyone be interested in C#?
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.
ok, i'm nitpicking, but...
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.
Run Once, Leak Memory Everywhere
1 VM loaded per app? C'mon Sun, give us a freaking break. Make your crap work, don't make us all load several instances of a 25MB Virtual Machine just to run Calculator.
Naturally Microsoft's pet programming language will integrate well with Windows. I'd wager that a lot of .NET is written in C#, just like a lot of Unix is written in C (Guess what a unix hacker's favorite language is...).
That's not to say that your point is invalid. However, for an OS X user like myself better Windows integration is useless. The real question is: How good is C# when you're not on Windows? If C# is just for a Microsoft environment, then I see it being doomed to the same fate as Visual Basic. Put another way, it has to offer compelling features for people on other platforms or the cross-platform functionality is useless. What is in C# to make it attractive to say, Mac users?
This
I know, the truth hurts. As my civic duty I will repost the truth here: Smoke some more crack - Sun withdrew Java from both ISO and ECMA standardization after they claimed they would hand over the language. The Java language syntax and the standard Java shipped libraries are 100% controlled by Sun - NO ONE ELSE has any say in the matter. The JCP is little more than a circle jerk club for losers like yourself to feel good about being given a public forum to whine and be ignored.
I think this is a bit Java biased, in that it uses some very precise wording and fails to mention a lot of relevant features of C# until the appendix-like section D. And it contains some outright mistakes.
.NET has an attribute for marking enumerations as able to be used in bitwise combination, whereas this is always possible (whether correct or not) in a Java pseudo-enumeration with int members. On the other hand, the "workaround" in Java makes this impossible-- you can't "or" objects.
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.
Like a fucking pipe dream, speaking as a former Java programmer.
Finding God in a Dog
OK, I'll bite.
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
In every operating system I've encountered, command line parameters are not passed as a pointer to an arraybut rather as a pointer to pointersEven if you try to force matters, you still get a pointer to pointers:
It never ceases to amaze me how many self-styled programming wizards are unaware of this.
Nope, it can't - not unless the gettor and settor are trivial one-liners. And if they change from trivial to non-trivial, you have to chamge your public int foo; into public int getFoo(); public void setFoo(int fooVal); and break all the code that uses foo. Properties avoid this breakage, which is why they are a good idea.
For a non-trivial e.g. Label.font.bold = true; The settor could actually cause a refresh of the label as well.
The java method will compile/run a tad faster,
Will it? The enum is really just an int - with compile time range-checking. Compile-time checking won't make it run slower. BTW, in Java you could also write
int wall = Direction.NORTH;
wall += 43;
Which is clearly semantically dead wrong, but the compiler will never know. That is why enums were invented in the first place, not that Java's designers ever learnt that lesson.
My Karma: ran over your Dogma
StrawberryFrog
So if this technique is so good (it does look cool) why isn't the JDK coded that way? The JDK is the best-known body of java code, and is where most java programmers get thier coding cues from - you'd think they'd use what was best?
My Karma: ran over your Dogma
StrawberryFrog
int wall = Direction.NORTH;
wall += 43;
Which is clearly semantically dead wrong, but the compiler will never know. That is why enums were invented in the first place, not that Java's designers ever learnt that lesson.
And only a moron like you would use an integer to represent a direction. You're a real OO genius, aren't you?
OMG, I just realized that you are seriously advocating implicit side effects as a Good Thing.
Jesus H. Christ. Are you just stupid, or is it that you have never done a day of professional programming??
You know, I'm not entirely sure that his assertion that subdimensions of a multidimension array must have the same dimension (topic 5).
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...
Like every other post I have made, this will be moderated to 0...but even if one person reads it, I will be a happy man.
:
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
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
Replying to anymous insults (the title Coward is clearly earned here) has got to be pretty low, but i'ts a slow day at work, so here goes.
I don't code like that. The original poster gave it as an example of how it is done in Java. Sadly it is often done like that in Java. I gave an example of how it falls down, cos I don't like it. Read before replying, Mr. A Coward.
My Karma: ran over your Dogma
StrawberryFrog
Right. So my company, with ~11 Java programmers, (over 25% of our workforce,) is just playing around? I better tell the boss, because I wouldn't want us to go out of business selling cross-platform sofware when we could make big bucks selling Microsoft-only software, using beta tools, an infant language, and taking twice as long to get code finished in C++.
Jesus H. Christ. Are you just stupid, or is it that you have never done a day of professional programming Well, the Borland Delphi VCL library, whcih I used profesionally for several years before switching to Java, does precisely what I described. The VCL is widely regarded as a very good class library. Add it up yourself.
Properties are a power tool - you can do stupid things with them, but not nearly as stupid as with operator overloading. That is not a good argument against them.
My Karma: ran over your Dogma
StrawberryFrog
You're not using C#. You're beta testing a product that has changed a lot over that year, and probably will change a bit more before it's released. You're aiming at a moving target, with no fixed definition.
Furthermore, that target itself aims at another target (.NET) in a similar situation. (Please don't spin me the pathetic argument that C# is independent of .NET; C# has no standard library worth speaking about, and there is no likelihood of a serious C# implementation on any other platform any time soon.)
It is simply not possible to develop applications properly in that environment. Until C# and .NET are properly released, you're not using a language, you're playing with a toy. Real languages for real use have concrete definitions, preferably of the status of a formal standard, and they don't change every five minutes on the whim of a senior engineer at Microsoft.
If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
> Firstly, the author has this backwards: the Java language design is dictated by one organization -- Sun;
This is no longer true. Go check at java.sun.com.
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.
Great Windows SFTP Server!
dissolved into a flame war, I think that the ending evaluation is that C# will be doomed to 2nd or 3rd place unless they can address multi-platform use. If that happens, well then the gloves are OFF.
MS needs to hurry however, as Java continues to gain in acceptance (regardless of it's problems) in more mainstream sw arenas (Oracle, IBM). Let's not forget that technical superiority alone does NOT a successful product make. There are plenty of SmallTalk coders who think Java should have gone STRAIGHT to the junk heap.
I, like many others, do not particularly care for MS. I feel they provide low-quality product and user clever marketing combined with arm-twisting to maintain market dominance in the areas they control.
That said, as a Java programmer I'd really like to see some competition with Java. Who knows, Sun just may open in up to ensure that MS can't get a foothold!
Computer Science is Applied Philosophy
I think from the level of people who make decisions about what programming languages to use on commercial projects (this includes me), the technical distinctions between Java and C# are of little concern:
This belief is instilled by Microsoft Marketing, Java/C# only resemble each other on the surface, underneath they fundamentally different. This is the reason that this decision should be taken be an experienced technical professional.
the languages are so similar that they are basically interchangeable.
Whilst Microsoft are attempting to position C# against Java this is their marketing at work, technologically they are not interchangable. As you latter comment note C# it is in competition with products like C++, Delphi, VB, not Java.
Java's technological competitors are actually, Perl, PHP and Python. Since they are the only tools with any like Java's platform independence.
It looks like the writer hands over the big V to MS. I can't disagree with him more. First of all, c# clearly looks like ms copied Java and put in their nuances, it's still plagiarism. I could go out and create a new language; call it "Cheddar", add in "Checked Exceptions" from Java; and claim it's the far superior language to both Java and C#. The truth is, Java is a fine language and idea, good enough for MS to consider a "Disrupter technology", and basically invented C# to (in the words of Bill) "Undermine Java".
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.
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.
Really?
Just click on the first link of the C# results and tell me where you find C# in the job description.
Hint: Nowhere
Conclusion: Your method is completly flawed, presumably because their search engine just ignores '#' and '++'.
Btw., even if it worked, your C# and C++ results would be a subset of your 'C' results.
This notion that it requires Windows Messenger and .Net passport is absolutely false. No such requirement exists, and none shall ever exist.
.NET with be at Microsoft's whim.
Wow. We have an Anonymous Coward's assurance. Incredible.
Both C# and
Java is Sun's baby, but IBM is enough involved that I do not have to trust either Sun or IBM to have reasonable assurance that Java will continue to be usable. Both IBM and Sun have too much to lose to allow silly fun&games to be played.
Move to Saint Louis -- the market here is still relatively strong. If you're interested you can email me at yuri_gagarin@msn.com.
#include <iostream>
using std::cout;
using std::endl;
class test
{
public:
private:
};
int main()
{
}
It will be interesting to see wether fancy tools (Microsoft VisualStudio) or good software engineering practices are the better strategy.
If you want cross-platform viruses then Microsoft is definitely the way to go.
If only it weren't for the fact that golden boy de Icaza and his Ximian clan were developing an open-source implementation, you'd actually have a point. .Net the runtime platform (something Java has yet to do, no?) would be a nice step forward.
Also, being able to separate C# the language from
Easy does it!
This comment has been submitted already, 276865 hours , 59 minutes ago. No need to try again.
The using() operator. As long as a given class you're looking to use implements IDispose functionality, you can use it and completely control its scope, instantiation and collection. It's keen!
And, uh. What exactly is wrong with the MSXML parser? As long as you use the version that you can get from Microsoft (the MSXML 4.0 parser's shipping and if not, the MSXML 3.0 parser's been shipping for 6+ months) and not the version that was shipped with IE (IE was released before XSLT was a ratified W3C spec) then it certainly does adhere to the spec, minus the kludgy MS interpretation of XSLT in the IE-bundled version.
Easy does it!
This comment has been submitted already, 276865 hours , 59 minutes ago. No need to try again.
I was going to rebut this purely on the grounds that generics are a crutch for people that simply don't get OO, but after checking out your posting history it's clear that you are clearly a M$ Astroturfer, so I've leave your fate to the moderators.
http://slashdot.org/~javabandit/
An RC is a release candidate: Meaning that they're proposing that that is what they might actually release. That's closer to a real product than most products in the open source arena will ever be.
Having said that: Jesus Christ you zealots are a riot. I don't even really LIKE C#, nor am I sold on the ".NET" idea, nor have I advocated FOR it. I merely questioned what seemed to me to be a pure karma whore post because it obviously was written just to cater to the psycho zealots that frequent Slashdot.
And for all the dumb motherfuckers out there let me explain something: You "interoperate" (regardless of hilarious [sic] comments by trying-to-be-pretentious kids) with "properties" either via method, or via more abstract methods. I prefer the more abstract methods of Delphi, and also C#. It's amazing how many people will yap up their opinion on this when they have no clue.
Sing to the beat:
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 !!!"
garbage collection!
What a great toy for non-deterministic programs.
It is good that we have these toys available
for people that don't really know how to program.
If you want to use a real language, use C.
C++ is good for GUI's.
Anyone who is using D-flat is obviously
getting paid to do it by Msoft.
For real programs that HAVE TO work,
one would NEVER use toys like garbage collection.
Object Pascal is a haphazard language compared to Java. It is obvious that Hejlsberg just copied the features from Object Pascal to C# (obviously he thinks they're good, which doesn't count for much).
Properties are unnecessary syntactic sugar to the language with potentially difficult to detect side effects making the code maintenance harder.
I'm glad Java does not have properties. I'm also glad that when Anders went to Sun with his ideas they were rejected. He is just a bitter little boy. An instrument being played by BG and the company.
Actually, the equals method in java.lang.Object will return true only if the memory locations of the two objects are the same. It does not compare the internal "data".
So in the above example,
Direction.EAST.equals(Direction.WEST)
would return false. I think you are confused with the way Strings work: the equals method on java.lang.String does indeed compare the internal string representation (the "data"), so if Direction.EAST was a String, your comment would be correct. But its not a String, its a Direction.
-Mike
it's funny how trolls on /. seem to flock this topic. I find that you can usually tell a troll if their uid is > 100,000 (over half a mil is a sure thing). Nice try with the nasa.gov email address too.
I say we take off and nuke the entire site from orbit. It's the only way to be sure.
yuri_gagarin@msn.com
;-)
Are you sure it's not your previous experience that's allowing you to command such a high salary?
The Amiga is dead. The Amiga was far superior to anything of the day. Do you see where I'm getting at? Just because something is dead, doesn't mean it's not better and won't continue to be better than the competitor for a while. Bottom line, FreeBSD is still being developed and used by more people with clue than I can count.
I just wasted your mod points! HA!
*shrug* I never claimed to be. You're not exactly forthcoming about yourself, Mr Coward, so how would I know.
Object Pascal is a haphazard language compared to Java.
Of course: That's because it's been through about 14 major versions from borland pascal 1. I respect the purity of Java's design, but wait a while.
It is obvious that Hejlsberg just copied the features from Object Pascal to C#,
Of course: take the good, try to improve on the rest. Every progamming language designed since day 1 has tried to do that. You say it like it's a bad thing.
obviously he thinks they're good, which doesn't count for much.
I beg to differ.
Properties are unnecessary syntactic sugar
Yup. So's operator overloading.
to the language with potentially difficult to detect side effects making the code maintenance harder. I'm glad Java does not have properties
based on years of programming Dlephi, I beg to differ. It make code maintainence so much easier when you don't need to know or care if you are reading a public data, function return value or property gettor. The implementation is free to change while leaving the client code the same, so long as the interface semantics don't change. Sure you can shoot yourself in the foot. Idiot-proof things are only worth using by idiots. IMHO operator overloading and multiple inheritance are *far* easier to abuse and obfuscate.
My Karma: ran over your Dogma
StrawberryFrog
This report lists RTTI as a feature present in C# and missing in Java, and provides this as an example of something you can't do in Java:
Well, here's one way to do it in Java:
if ( o instanceof MyClass ) {
((MyClass)o).doStuff();
}
Like I said, I only looked at the report for 5 minutes, so I don't want to make a judgement about its overall quality. But if I understand the author correctly, then at least this item is wrong, which is cause to view the rest of the report with suspicion.
No, an RC is a "release candidate", meaning that it's a mid-late beta that they want people to test for them for free. It's a marketing tool, a name given so that people think the product is "nearly ready" and don't go out and buy into the opposition for several months.
If it's what they were actually going to release it wouldn't be an RC, it would have been released. In a competitive environment such as Microsoft is in here, you don't just leave something on the shelf for three months after you've finished it.
This is my point. People are seriously comparing a beta test product (with a flashy title) with a real product that's usable for actual work. This is absurd.
This board is full of pro- or anti-C# rhetoric all the time, most of which is hype-based and unfounded. The one thing that is clearly true is that C# is not ready yet. I can go the office tomorrow and develop a world-class application in Java. I will go to the office tomorrow and develop a world-class application in C++. I cannot go to the office and develop a world-class application in C#. I rest my case.
You should be a little less cynical. It wasn't a karma whore post at all; for a start, I've been karma capped since not far past my 100th post, months ago, and for seconds, I don't have any need to pander to slashbot groupthink anyway. On the contrary, my original post was a somewhat ironic one-liner written by a professional programmer, writing real code in the real world for real clients, who's sick and tired of hearing people spouting off about C# as if it was on a similar level to Java, C++ and other established, stable, reliable development tools. Everything since has just been responding to your replies.
If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
Well, that could be it. That and the fact that I've mastered the art of returning from the dead.
"... I'd have to pick Java if it was up to me just because of its sheer elegance."
Beg pardon? Java? Elegant? Needlessly verbose, yes. Kludgy, yet strangely popular, yes. Omnipresent, nearly. But elegant? Not hardly. It's got a bunch of interesting hooks into it's own execution environment, sure, but that's some far cry from elegance.
Ick.
(jfb)
To spur "enterprise Linux," Big Bang, the distributed two-phase commit.
Like I said, I only looked at the report for 5 minutes, so I don't want to make a judgement about its overall quality. But if I understand the author correctly, then at least this item is wrong, which is cause to view the rest of the report with suspicion.
Well if you had spent more time reading the article you would have seen a section on instanceof and the is operator in C#. Guess this goes to show you that when you assume you make an ASS out of U to me.
Orp op op ah ah.
Orp op op ah ah.
Quandy wando flu!
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.
I sent the following reply Dare. It might be interesting to others.
h tml#oopsla99_escape
---
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
You mentioned templates. What, do you think, is more effective: N instantiations of list<T> in N libraries that use it, M of these N instantiations being completely identical -- or one implementation of list that can carry pointers or values under the pointer's size, that is used heavily and sits in the cache? Can you dlopen() a shared library and look up your templatized overloaded namespaced function by its symbol name?
Yes, there are lot of areas where C++ fails, because it wasn't designed to address their requirements. In fact, it fails everywhere except small COM/CORBA/whatever components, generation of boilerplate code (the idea behind ATL is neat), and huge monolithic software systems where rapid development is on top of the list. And we on /. know how the latter sucks, don't we?
Perhaps in this case the problem is not the language, but the programmer.
Totally agree here, except with "the language" substituted for "the language that fits the job", and "the programmer" with "one that moans about how he misses the features of his favorite programming language". The Real Programmers don't hesitate doing OO stuff in C, and doing it elegantly.
My exception safety is -fno-exceptions.
I don't suppose it's reasonable for me to expect someone to read what I've posted before replying to it. After all, this is slashdot. Thanks for repeating (ok, paraphrasing) the last paragraph or two of my post; it made things so much clearer.
duh.
I've worked for years in Python and C/C++, but, honest to god, I find Visual Basic code really hard to read. I usually just give up. There seems to be something WRONG with both the syntax and what junk has to be written to make anything work. Does VB seem that way to you?