Slashdot Mirror


Learning Java or C# as a Next Language?

AlexDV asks: "I'm currently a second-term, CIS major at DeVry University. This coming term, I will have the choice of studying either Java or C# for my Object Oriented Programming class. Now I'm a diehard Linux user, so I'm slightly conflicted here. Which should I take?" "I know C#.NET is primarily a Microsoft language, but, with Mono gaining momentum, it could very well become a major development platform for Linux as well. Novell has really been pushing it lately, and there seems to be a lot of very cool Linux apps being developed with it.

Java, on the other hand, is inherently more Linux-friendly due to its intentional cross-platform nature, but at the same time it doesn't really seem to be inspiring the same kind of developer enthusiasm as Mono. However, it's clearly not an insignificant OSS development language, with the recent news that Java has surpassed C++ as the #1 language for SourceForge projects.

Anyway, I though I'd toss that out there and get some opinions from other Slashdot readers. Any thoughts, advice, and/or rants are appreciated :)"

9 of 817 comments (clear)

  1. Re:Just Pick One and Learn it Well by theGeekDude · · Score: 5, Informative

    Well if you choose Java, then you can use free Eclipse IDE which is excellent. Otherwise if you choose c#, the ony decent ide is visual studio which will cost you a fortune.

    --
    Dont waste you time reading stupid sigs like this.
  2. It doesn't matter too much by RailGunner · · Score: 4, Informative
    Syntactically, C# and Java are extremely similar, so it doesn't matter too much which one you take - you'll be able to pick up the other one fairly quickly. My advice: Learn the OO concepts, as the underlying language is less important. For example: Learn why derivation is a good thing, learn inheritance, object re-use, etc.

    The language (whether C# or Java) is just how you express what it is you're trying to accomplish.

    Now - With all that said: I'd take Java, for one simple reason: It's been around longer and there are more free resources out there to help you with it.

    But remember - as much as 90% of what you learn in Java will apply to C# and vice versa, as long as you focus on the base language (and not API's like SWT, Swing, or WinForms).

  3. Re:Just Pick One and Learn it Well by Armour+Hotdog · · Score: 3, Informative

    Yes, the command line c# compiler (csc.exe) is part of the free .Net SDK, as are the VB.Net compiler (vbc.exe) and JScript compiler (jsc.exe). There's actually a lot of cool stuff bundled in there, including a debugger and an IL assembler and disassembler.

  4. Re:Java.. by defkkon · · Score: 4, Informative
    C# AFAIK has no web services components anywhere near Java's

    The exact opposite, actually. .NET has an excellent framework for web services.

  5. Re:Just Pick One and Learn it Well by Durrik · · Score: 4, Informative

    I have to agree to Eclipse. I had some co-workers who had to learn Java for various courses they wanted to take, mainly for continuing education. They both came back with the same comment, Eclipse made programming fun again. Just because of that I would promote Java over C#. Most IDEs get in the way of programming, Eclipse actually helps, especially for new Java programmers. My experience with Visual Studio is limited to 5 and 6, and I never could get my head around it properly and always found myself frustrated with it, always going back to emacs.

    The biggest problem with leaning Java is the class libraries. Eclipse makes it easy to learn them, especially with the ctrl-space completion.

    --
    Software Engineer & Writer of Military Science Fiction and Fantasy Blog: petermwright.com Twitter: WrightPeterM
  6. Visual Studio is Free! by MBCook · · Score: 5, Informative

    It doesn't matter. As a DeVry student he gets a free software bundle that includes:

    Windows 2000 (or was it 2k3?)
    Windows XP Pro
    Microsoft Office Pro
    Microsoft Visio
    Microsoft Visual Studio .NET
    and something else.

    Price is not an issue in this.

    --
    Comment forecast: Bits of genius surrounded by a sea of mediocrity.
  7. Re:Just Pick One and Learn it Well by geekoid · · Score: 4, Informative

    And your reading cmomprehension is also pretty low. It is for the express version; For practical reasons, it is useless for the professional evironment.

    Also, it won't work whjen the comeout of the next .net framwork, and you will have to buy in order to continue development that includes the newest framework.

    Express editions are NOT compatible with different .net versions. so when you want to clients that may have upgraded, and some that haven't, you will need to keep a different branch of code, and a separate version of VS express, for each .net version.

    So, the first hit is free.

    --
    The Kruger Dunning explains most post on /. http://en.wikipedia.org/wiki/Dunning%E2%80%93Kruger_effect
  8. Re:Just Pick One and Learn it Well by Trepalium · · Score: 5, Informative
    Yes, you were just lazy. They're called assemblies in C#, and you can dynamically load them via the System.Reflection.Assembly.Load() method. It'd be pretty silly to be missing something like dlopen or LoadLibrary in C#, wouldn't it? You typically have to combine that with an application domain so you can unload the assemblies.

    .Net's reflection capabilities are quite a bit more extensive than Java's (there is native support for outputting byte-code and even entire classes at run time). If you want to pick on C#/.Net, pick on it's limited exception handling (unchecked exception handling only makes 'black box' use of objects more difficult), or simply the fact that C#'s feature set is obviously derived from Java.

    As for features that C# offers that Java doesn't... Wikipedia has a list and links to other sites with more. Whether or not you find these features useful or painful is a matter of taste, though. Many of the features of C# were created to make Visual Basic-style GUI creation easy and painless. C# offers operator overloading, true multidimensional arrays, delegates and unsigned types. Unless you have the pleasure of running in an entirely Java/managed environment, those unsigned types are a life saver (or at least a sanity saver). Delegates (multicast function pointers) make wiring up event-based GUIs a little easier. True multidimensional arrays are either invaluable or useless, depending on the kind of software you write. Operator overloading can also be useful, provided it's used carefully (and can cause no end of confusion if it's not).

    --
    I used up all my sick days, so I'm calling in dead.
  9. Re:Just Pick One and Learn it Well by ForumTroll · · Score: 4, Informative
    I use Eclipse more than Netbeans so let me give a few examples from an Eclipse developer's point of view. Note that some of these issues may have been addressed as it was a while ago when I looked at Visual C# Express. Also, remember I'm talking only about the *free* Visual C# Express and not Visual Studio.
    • Obviously, unlike Visual C# Express, Eclipse is free and comes with no restrictions.
    • Eclipse is open source, so it's far easier for developers to customize and build a platform around.
    • Due to the way Eclipse is structured it's very easy to write plug-ins and because of that Eclipse has a very long list of available plug-ins. Plug-ins exist for practically everything a programmer would normally require. Not only does Visual C# Express not have plug-ins but it doesn't even have macro capabilities.
    • Eclipse has far better refactoring capabilities. It makes it very easy to restructure your code, and it can handle the vast majority of the details (renaming, extracting interfaces, encapsulating fields etc.) itself with no worries.
    • If you're programming in Java, Eclipse's code assist can be linked to the source code and the documentation for not just the standard library but ANY library that the project uses. IIRC, you can do this with Visual C# Express but it's a pain in the ass and it makes you jump through hoops for everything other than the standard library. In Eclipse, this feature is also available for other languages through plug-ins. Another thing that sucked about Visual C# Express was that the code assist would only show one option at a time so you would have to scroll through the list one by one.
    • Eclipse also has a wonderful Javadoc engine which can make writing good Javadocs extremely simple and less time consuming.
    • The code formatter in Visual C# Express sucks and it's not consistent enough that it can be used on large projects. I like to check out my project from SVN and use the code formatter to make the code appear in the style I would prefer. Then before checking the project back in, use another code formatter template to make sure the code that enters the repository in one uniform style. Not only is the Eclipse formatter extremely consistent but it's also is very easy to switch between templates and has nice simple hot keys.
    • Regardless of the language, it's much easier to change compilers/interpreters with Eclipse and it supports many more compilers/interpreters.
    • Eclipse has built in CVS AND SVN support while Visual C# Express has no source control integration built in.
    • I can use Eclipse with a large number of different languages and still continue to use many of the features.
    • Eclipse can be used for building, testing and running Web applications with a number of different server architectures.
    • Eclipse uses ant as the standard for building projects. It also has nice configuration utilities for monitoring the execution of a build file, and for creating/modifying a build files.
    • Eclipse has excellent JUnit integration which makes testing your code easier, while Visual C# Express has no unit testing integration at all.
    • Eclipse has very nice database integration plug-ins available. Including plug-ins that generate diagrams, UML etc.
    • Eclipse has good support for Hibernate/Spring/Struts/JSF and a variety of other popular frameworks.
    • Eclipse has superior debugging support for a wide array of debuggers. Note that I said "support for a wide array of debuggers". Debugging in Visual C# Express, from what I saw in my brief experience with it, is actually very well done and maybe on par (or even possibly better) than Eclipse.
    • Eclipse has better hot keys. Simple refactoring operations almost always have convenient "what you would expect" hot keys.
    • Eclipse has navigational hyperlinks that I can use without touching the mouse.
    • Visual C# Express doesn't have any support for re
    --
    "A Lisp programmer knows the value of everything, but the cost of nothing." - Alan Perlis