4 ms·
System.Console.WriteLine("Hi, I'm a .NET library function for the CLR being called in C#"); System.out.println("Hi, I'm a Java library function for Java being
by Goladus 19y ago
System.Console.WriteLine("Hi, I'm a .NET library function for the CLR being called in C#");
System.out.println("Hi, I'm a Java library function for Java being called in Java");
Java The Language and C# are extremely similar, and if the differences bother you that much you can use J#. Java and .NET both provide managed runtime environments. Java and .NET both provide a large library of functions for that environment.
I'd say if you're going to put Java and .NET into different categories, you should have some solid reasons, so let's hear them.
- axod 19y agoJava and C#/C++ are very similar languages as far as I know. ASP.NET seems very similar to PHP. .NET just sounds a horrible mess. VB.NET? why would anyone touch anything that has a language 'visual' 'beginners'. Don't those two words hint at anything? Comparing Java (the language) to .NET (the system that lots of m$ languages run on) doesn't make much sense though IMHO.
- pc 19y ago"C#/C++" is about as valid as "Java/JavaScript".
- DanielBMarkham 19y agoNice slogan, but fails when put to the test. C#/C++ = both OOP languages, semi-color delimited, mostly early binding, strong typing, etc. Java and JavaScript are not anywhere near as close. OOP vs prototypes, loose typing vs. strong typing, closure-functional style vs imperative style, etc.
- nkohari 19y agoNo offense, but you clearly have not used both languages. When you consider the platform in addition to the syntax, C# is absolutely nothing like C++. C# is managed, garbage collected, bytecode-based and JITted. Saying C++ and C# are similar is like saying that technically a unicycle and an airplane are the same because they can both help you get somewhere.
- DanielBMarkham 19y agoEverybody knows that Java is just C++ with the sharp edges taken off. C# is Microsoft's Java-killer. C# and C++ are directly related to each other. It's the same lineage. Where do you think you get the idea of constructors, interfaces, friends, volatile methods, etc? I understand that C# is managed, but how the runtime handles memory allocation to me just isn't the deal-killer you're making it out to be. There's lot's of ways to have managed C++ code. Third-parties have been making smart memory managers for C++ for as long as I can remember. Look -- I love C++. It's my favorite language of all, not that I'd code anything in it anymore. I've done Java, I've done Javascript (a lot of it), and I've done a lot of C#. I know the languages. C# is much closer to C++ than Java is to Javascript. You made a cute comment. I called bs on you. Get over it. Best way to get out of a hole is to stop digging.
- nkohari 19y agoI didn't make the first comment. I just showed up to say that you were completely wrong in your retort. I also don't know exactly what you're arguing about, so I'll just let you ramble in peace. :)
- DanielBMarkham 19y agoThe original comment was: "C#/C++" is about as valid as "Java/JavaScript" It was a really bad analogy. I believe I have made my point that C# is a lot closer to C++ than Java is to Javascript. Thanks for joining in, though. I take it you stand by your comment that I "clearly have not used both languages" As for rambling, one does what one can.
- Goladus 19y agoI see "Java/C++" and people generally know what it means. Fair point, though.
- Goladus 19y agoI think that normally, when people compare Java to .NET, they're either comparing the Runtime Environments, the Class Libraries, or they're comparing the whole 'development stack' which usually includes the primary language (eg Java or C#) and the primary OS (eg Solaris/*nix or Windows) and a variety of other tools like Eclipse or Visual Studio. Java is funny in that it uses the same name for like 4 different things, while MS makes a greater effort to distinguish between them. VB.NET is basically C# with a bit of syntactic sugar to make life easier for Visual Basic 6.0 programmers transitioning to a more Java-like development style. The last time I checked, most of the .NET documentation includes code samples in each of the 4 main languages (C#, VB, J#, and C++).NET Usually, the C#, VB, and J# versions are close to identical. I've heard that the C# optimizer works better than any of the others, but that was 2 years ago and I didn't follow up.
- jdavid 19y agoJava can not manage memory marshaling between win32 apps and managed code. In Java, you need to message pass with pipes, and its a pain. In Linux Piping is really fast, but in Windows, Piping is slow. I really like being able to code C++ and C# in the same solution, but in different projects, while being able to step through all layers of the code. Remote Debuging, and RPC calls are way better in .NET Also if you are doing XML, and Web Service calls (soap, get, post) .NET includes the functional layering and interface segmentation to access each of the protocols independently or together. In my opinion, if you want to set up some sort of transactional API, .NET has leaps and bounds better performance and professionals level tools. If you are trying to hack something together, .NET has a large learning curve, and requires disciplined programing to get any practical use out of it.