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 :)"

33 of 817 comments (clear)

  1. Just Pick One and Learn it Well by byteCoder · · Score: 5, Interesting

    For an object-oriented programming language, either C# or Java will be fine. Once you learn the language of one well, you'll be able to quickly learn the simple syntactical differences and nuances when you transfer to the other. The harder (in a relative sense) thing is to learn the class libraries and how to make use of the classes and methods to write your programs. Fortunately, again, there are similarities between the two. When coupled with a good intellisense-style editor, you'll be able to move from one to the other fairly readily, I would think. My advice is to just pick one and learn it well--learning the other at a future time should be a snap. As far as post-college job opportunities, corporations use both (but each corporation tends to focus on one or the other). Perhaps you should do a little local research to see which language/class library is in more demand where you live. I have plenty of consulting friends in the Minneapolis/St. Paul area that focus on each and who are all gainfully under contract (although C# experts are in slightly more demand and can get higher bill rates, unless you're a J2EE expert). For the long term, technologies will change and evolve. Learn the commonalities and the differences between the two and continually re-apply what you know when confronted with new technologies. Be adapable.

    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. Re:Just Pick One and Learn it Well by iced_773 · · Score: 4, Insightful


      visual studio which will cost you a fortune

      Come again?

    3. Re:Just Pick One and Learn it Well by moro_666 · · Score: 4, Insightful

      wow, visual studio for free for one year man ... what should i do after 366 days ?

        and did you forget that i have to buy an entire worthless operating system just to run this damn visual studio ? and if i wanna be up to date after 3 years i'd have to buy another bloody version of windows and get another licence for visual studio ... "dam this is cheap ..."

        i'd go with java, but not because of the cost, but because java will be the same after 3 years whereas the next versions of C# will probably blow the current version away. C# is far from being a mature language. your java knowledge today is still valid after 3 years from now. but the C# you learn today may be worth less than my posting here on slashdot.

        i just recently reviewd mono on my ubuntu box, and i'm sad to say that c# doesn't impress me much. i mean it's ok but expected something much more. if it doesn't really offer anything fascinating that java already has, where's the point ?

        ps. was i just lazy while reading the c# api or did i really not spot the dynamic classloaders which open a totally another dimension in java ?

      --

      I'd tell you the chances of this story being a dupe, but you wouldn't like it.
    4. 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
    5. Re:Just Pick One and Learn it Well by LordEd · · Score: 4, Insightful

      and did you forget that i have to buy an entire worthless operating system just to run this damn visual studio ?

      The majority of the world is using that particular worthless operating system. If you program for that platform, you may want it available for testing.

      i'd go with java, but not because of the cost, but because java will be the same after 3 years whereas the next versions of C# will probably blow the current version away.

      Are you sure that Java never changes?

    6. 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
    7. Re:Just Pick One and Learn it Well by metlin · · Score: 4, Insightful

      He's learning the language, not using it for writing enterprise scale apps. There is a difference.

      If you are writing enterprise scale apps, you'd be an idiot to use the express version. If you want to write enterprise scale apps, buy it from MS - what's wrong in MS demanding that you pay them for it when after all, you are trying to make money out of it?

      *shakes head*

      Free for the first hit? Your comparison is ridiculous - they've made it free so that you can use it for educational and non-commercial purposes. If you want to do commercial development, pay them. I see nothing wrong in that - it's the way businesses work.

      But oh wait, you mean they ought to give it to you for free while you can make money out of it? Nice one, there.

    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 cduffy · · Score: 4, Insightful

      But oh wait, you mean they ought to give it to you for free while you can make money out of it?

      That's what their competition is doing.

    10. 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
  2. both -- then more -- it's fun! by Anonymous Coward · · Score: 4, Insightful

    just pick one, and then learn the other on your own. don't fool yourself into thinking that one will be more important by the time you graduate.

    the field changes very quickly so if you learn to be flexible, you'll be more ready for the new languages and systems that are around a year or two after you start working too

    remember -- languages and programming is fun! if it's not fun for you then you are in the wrong field and you should seriously think about that early on.

  3. Take whichever one... by TrumpetPower! · · Score: 5, Insightful

    ...is being taught by a better professor.

    Cheers,

    b&

    --
    All but God can prove this sentence true.
    1. Re:Take whichever one... by breckinshire · · Score: 5, Funny

      Has more ladies! Oww!

  4. Java. by dan_sdot · · Score: 5, Insightful

    Learn Java. And try to use it in the Linux environment. Basically, what is important here is not the fact that you are going to learn a certain language, but that you will learn how to write object oriented code. Once you learn that, you can pick up c#, c++, etc.
    The advantage of Java in my mind is that it can be used in a Linux environment where you will be forced to understand the "application creation" process from top to bottom, as opposed to a Window environment where you just write the code and let the OS and the tools provided do all the other work for you.
    Learning a new language is trivial. Make sure that you understand the CONCEPTS of coding.

    1. Re:Java. by b17bmbr · · Score: 5, Interesting

      I teach the AP comp sci class at my high school. I stress repeatedly that they need to learn to program first, then do it in java second. I always show them examples with python, perl, php, even c, for comparison. Learning good programming techniques is entirely different from "learning (programming language)". It's like the debate over editors, ide's, whatever, it's the best tool for the job. Me, I like java for lots of things. But I also do alot with LAMP and the same concepts apply. Whether its branching, security, speed, or features, I always design first, code second. I can never emphasize that enough with my class.

      --
      My problem? I was perfectly gruntled, until some numbnuts came by and dissed me.
  5. 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).

  6. If you are at DeVry by Anonymous Coward · · Score: 4, Funny

    Then I would pick whatever is used for french fry machines.

    1. Re:If you are at DeVry by StarWreck · · Score: 5, Interesting
      Then I would pick whatever is used for french fry machines.
      CIS majors don't deal with embedded microprocessor programming. CET and EET majors deal with that type of programming. You can use a variety of languages to program the microcontroller in a french fry machine depending on which microcontroller you use and which development platform you use to load your program onto the processor; whether its Motorola/Freescale, Zialog, Intel, or PIC.

      For example, when I added a complete computer control system to an RC Car with a 20% Nitro, 80% gasoline combustion engine I used a Motorola 6808 with 4K of RAM and programmed it entirely in C++ when I decided that it was taking to long to program in assembly.

      You can view the entire project, including all code here: http://home.comcast.net/~starwreck/FinalReport.pdf

      Oh yeah, I did this entire project at DeVry.
      --
      ... and in the DRM, bind them.
  7. Instructors Are What Matters by moehoward · · Score: 5, Insightful


    What are the instructors like? That should matter more.

    A class at that level is supposed to be about some "concept". Either OOP, or databases, or design, or algorithms... If the class is JUST about the language/platform, then don't even bother taking the class. Unless you have some industry/job specific need to learn a language, then I would avoid it.

    Some instructors end up getting bogged down in platform specific issues. For example, ADO when the course should instead be about databases.

    So, I'd figure out which instructor will offer the most conceptual learning. Language doesn't matter... unless the FCC is involved. Learn concepts, theory, good practices, etc.

    --
    "If you want to improve, be content to be thought foolish and stupid." - Epictetus
  8. EIther is fine by Rycross · · Score: 4, Interesting

    I learned Java my freshman year of college. Once I graduated, I worked with C# professionally and found the switch fairly easy. I found the transition from C# back to Java for a recent project fairly easy too. They have very similar syntaxes, and both have ample documentation for their standard libraries, so learning one will make learning the other easier.

    I think Java has more penetration in the market right now, but C# is certainly catching up. In my last job search, there seemed to be a lot of interest for C#/.Net jobs and very few Java related jobs (although most of my experience is in C#, so YMMV).

  9. Re:Diehard Linux user? by Anonymous Coward · · Score: 5, Insightful
    If you're a "diehard Linux user," shouldn't you already know Java?

    No. No you should not.

  10. Re:As someone who has taken both... by gcnaddict · · Score: 4, Insightful

    C# != MSJava;

    J# == MSJava;

    --
    Viable Slashdot alternatives: https://pipedot.org/ and http://soylentnews.org/
  11. Definitely know your job market!! by ShatteredDream · · Score: 5, Insightful

    I know Java and am fairly comfortable with C# as well, yet I put 90% of my effort into Java and C because my job market, Northern Virginia, relies heavily on federal contract work which is almost always standardized on J2EE. Be practical. If your area is very pro-Microsoft, don't waste your time with Java because it will make you less marketable. Focus your time instead on learning good OOP practices, take a few CS courses on things like data structures and algorithms and you'll be set.

    This is of course coming from a recently graduated CS major, so take it for what it's worth.

    1. Re:Definitely know your job market!! by tyler_larson · · Score: 4, Interesting
      Where I'm from, the Java market is nearly nil. The only reason I bothered to learn it was for development of cellphone games with J2ME. On the other hand, I didn't at all like the idea of learning .NET; I had thought that it was all a gimmick that would pass. But I had to learn because of the market demand.

      Now the .NET adoption hasn't gone quite as quick as Msft would have liked, but the fact remains that they're throwing their full weight behind this platform. They're not letting up like I had originally thought, but are rather pushing it even more furiously than before. The next generation of all of Msft's major (non-server) products are going to be .NET based; office already is, as is visual studio. Whether we like it or not, .NET experience is going to eventually become as in-demand as Win32 experience. Certainly not this year, not next year, but it's coming.

      Microsoft isn't giving up on this one, and it's been independantly argued that moving to this type of architecture is actually going to be better for the rest of us anyway. I don't know if I agree with all the hype, but it's pretty clear that .NET is here to stay.

      All of that aside, it's worth pointing out that C# is a very well designed language. This isn't something that was cobbled together by a couple of guys in a garage. The creators of this language did some fairly extensive research of the existing languages (including Java), and brought in the help of some of the foremost minds on the subject.

      So, is it as good as they claim it is? Probably not. However, after only half a year of C# programming, I've gone back on my original stance and decided to use it as my primary rapid-application-development platform under Windows (with Python being used for all other OSes).

      If you've got to learn one or the other, I'd go with .NET in the classroom. With it you can learn all the important concepts that you need to learn. Then, if you're any good at all as a programmer, you should be able to make the jump from C# to Java in just a few weeks at the most.

      --
      "With sufficient thrust, pigs fly just fine. However, this is not necessarily a good idea...."
      RFC 1925
  12. 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.

  13. C# by Unnngh! · · Score: 5, Insightful

    Most people will probably say learn Java, particularly on /.. Java programmers are extremely common. The company I work for had a hell of a time hiring a C# developer with any experience. .NET is the future of development on any MS platform. For an entry level position, if you're looking for jobs, I don't think it will matter, but smaller shops are not going to want to spend the time for you to get familiar with the nuances of whatever language they are using. I think that C# has a larger potential for quick rewards right now since there are so few programmers compared to a rising demand. In the long run, though, I don't think it will make much different and the two are similar in most aspects.

  14. Java at Job Fare by chiok · · Score: 5, Interesting

    Last February I was at a job fare without knowing either Java or C# and just about everyone hiring programmers at the booths told me they'd hire me if I had some Java background. No one mentioned C#.

  15. My two cents... by Savage-Rabbit · · Score: 4, Interesting

    Java on the other hand is a cross platform environment supported by multiple competing vendors. That will leave you more nimble to develop and deploy on a wide variety of systems. There are great JVM's available from Sun, BEA, IBM and others. There are several great commercial and open source implementations of java servlet containers. Can C# really say the samr thing?

    I agree, Java is the only truly cross platfrom alternative despite the fact that C#/.NET is being implemented on non Microsoft platforms, Java will remain the only really usable cross platform alternative for some time to come. That being said there are still white patches in the standard Java class libraries; like RS232 support for example which, surprise, surprise, is still widely used. The last time I looked this was only implemented for Sun and Linux but not Windows, OS.X and other OS'es (you had to install a special third party implementation of the standard RS232 interface from Sun). Although I like C# better than Java for a number of reasons I still wouldn't rely upon C# for cross platform application development which is something I see as an essential capability to have for any future software product that can afford it performance wise. I would only start implementing something in C/C++ if I really needed close control over memory usage, the ability to do heavy duty performance tuning etc. For anything else it really just pays (money wise) to throw hardware at the problem and develop in Java or C#. But since the .NET implementations for the various OS'es will be developed by different parties (Microsoft, Nowell/Ximian etc...) rather than a being largely developed and/or coordinated by one party (Sun) like Java plus I wouldn't put it past Microsoft to use dirty tricks to make sure that .NET will always be more stable on Windows than other platforms.

    --
    Only to idiots, are orders laws.
    -- Henning von Tresckow
  16. 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.
  17. Re:Java./ CS ~= computer programming by EMiniShark · · Score: 4, Funny

    "Computer Science is a subset of Math."

    You must be new here. Math is a subset of Computer Science.

  18. It's good advice... by Da+VinMan · · Score: 4, Interesting

    I've got 8+ years MS tools based experience and 2+ years with Java (and some Python and Ruby thrown in for good measure), and I would totally agree. Neither C# or Java is perfect. They're both strongly typed, proprietary, virtual machine environments. Neither one is true open source (despite the rich set of open source applications developing around both). And neither one is appreciably better or more powerful than the other across the board.

    The question comes down to economics (which one do you know you'll be able to get a job using) and preference (which tool set do you like better Visual Studio 2003 or {Eclipse | JDeveloper | JBuilder | IntelliJ | NetBeans | WSAD | ?}). You have to go with the one that meets those two criteria. Neither choice is bad and no one gets fired for choosing either of the two.

    Oh, and fer-cryin-out-loud: don't choose something because you think it will make someone else happy or make you seem more "uber geeky" or whatever. Just do it for you and the rest will follow. And whatever you may think now, you are NOT married to this choice. That "wall" that everyone seems to imagine between Java vs. .NET is not a real technical barrier; just a cultural one.

    --
    Please mod this post only if you think others should/n't read this. I have enough ego^H^H^Hkarma. Thanks!
  19. which language? by belmolis · · Score: 5, Funny

    If all the complaints here about outsourcing are correct, rather than Java or C# you should learn Hindi.