Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror
×
Programming Technology

Learning Java or C# as a Next Language? 817

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 :)"
This discussion has been archived. No new comments can be posted.

Learning Java or C# as a Next Language?

Comments Filter:
  • by byteCoder ( 205266 ) * on Friday December 23, 2005 @05:30PM (#14328806) Homepage
    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.
  • by TheSpoom ( 715771 ) * <{ten.00mrebu} {ta} {todhsals}> on Friday December 23, 2005 @05:31PM (#14328816) Homepage Journal
    C# == MS Java.

    At least, on a basic level. Personally, I'd say if you're aiming for broadness on your resume, Java will get you a lot further than C#. But then, it really depends on the type of company you're aiming at.
  • Python (Score:2, Interesting)

    by Anonymous Coward on Friday December 23, 2005 @05:36PM (#14328860)
    Learn Python, take whatever crap they teach at your college...
  • by cryfreedomlove ( 929828 ) on Friday December 23, 2005 @05:36PM (#14328864)
    C# was invented for one reason: locking sytems into a windows deployment. There are some attempts to port C#, but those efforts don't have 10% of the current momentum that java has from a large community of both corporations and volunteer open source contributors.

    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?
  • Definitely Java (Score:2, Interesting)

    by Anonymous Coward on Friday December 23, 2005 @05:36PM (#14328870)
    Mono is a complete non-starter. Check out how RedHat engineers now have a natively compiled Eclipse running, that also has stubs into Glade development. Check out this demo:

    http://overholt.ca/wp/index.php?p=11 [overholt.ca]

    Basically, GCJ is the future of high level OOP on the linux platform. .NET is fine for Web development, but it's essentially a better VB and ASP, so if you were never drawn to those, forget about c#.
  • EIther is fine (Score:5, Interesting)

    by Rycross ( 836649 ) on Friday December 23, 2005 @05:40PM (#14328907)
    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).
  • Re:Java. (Score:5, Interesting)

    by b17bmbr ( 608864 ) on Friday December 23, 2005 @05:43PM (#14328944)
    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.
  • by ntijerino ( 306851 ) on Friday December 23, 2005 @05:53PM (#14329007)
    Another thing to consider is the availability of useful libraries. I don't use C#, so I can't speak to the libraries that are available for that language, but there are many freely available libraries for java that do all kinds of useful things so that you don't have to reinvent the wheel.
  • Re:Neither! (Score:2, Interesting)

    by M. D. Nahas ( 901805 ) on Friday December 23, 2005 @06:08PM (#14329127)
    The cleanest languages I've used are C, Java, and OCaml. By "clean", I mean the language has a few concepts that can be completely memorized, which results in less "gotchas" and manual reading. For these languages, you'll see small manuals (e.g., K&R's book for C) which cover the complete language and then lots of pages devoted to the libraries that come with the language. I'd definitely recommend Java (or C, or OCaml) over C# for this reason. C# seems to have combined every feature of C++, Java, and VBA into a single language. It is very complex and has a ton of concepts, for which I could never memorize the whole language. I have a feeling that most programmers will use the subset of C# that is closest to the language they understand, whether it is C++, Java or VBA. You might as well learn Java's style of programming, and then, if needed, switch to C# using its Java-like features.
  • What versions? (Score:2, Interesting)

    by An Elephant ( 209405 ) on Friday December 23, 2005 @06:14PM (#14329180)
    Java 1.5 is very different from older Java versions. Likewise, C# 2.0 is a lot different from 1.0. Of the two, C# seems to be evolving in much more interesting ways (and saying this pains me, as a Unix and OSS fan). The C# 3 spec drafts (available from MS, and mentioned on Lambda the Ultimate) bring in a lot of functional programming, for example. So, educationally speaking, if you are going to learn the newer versions, I would advocate C#. Note I'm doing so mainly for its non-OO features. As long as you only care about OO (and older versions), C#'s delegates are IMO an advantage, but the difference is not that big.

    If you're asking "which is more fun", though, then you have to remember that you work in an environment, not just a language. Visual Studio .NET 2003 is downright retarded in comparison with any major Java IDE, for any purpose other than GUI programming. I don't know yet about 2005, and I have a feeling that SharpDevelop or MonoDevelop are not better than VS.NET.

  • by TheGreatOrangePeel ( 618581 ) on Friday December 23, 2005 @06:18PM (#14329199) Homepage

    I'll second this and add, "...beware the preverbial 'THAT' professor." The one that will push back all your due dates and give you (quite literally) impossible assignments until nothing is due or everyone is failing respectivly and as a result, you pass for just showing up everyday.

    I learned OOD the old fashoned way: C++. When I took the job I'm currently at they had me go through some mock developer training in which they put me in a position of a team lead. I can tell you right now that the best OOP programmers I had in my team had studied C++ first. Why? Pointers. C++ FORCES you to get all the astrisks and ampersands in the right place. Java certinly dosn't make you do that at ALL (note to nitpickers: Yes. 'References' not 'Pointers' *blinks* I don't care. Close enough.) and from what I remember of the little bit of C# I had, C# dosn't make you do that either.

    I would suggest that you learn as MUCH C++ as you can over the holiday break. Bruce Eckel has an EXCELLENT excellent excellent book called "Thinking in C++" (he also has one called "Thinking in Java" that is very much the same, so if you take the Java course, DEFINATLY get that book).

  • Java at Job Fare (Score:5, Interesting)

    by chiok ( 858005 ) on Friday December 23, 2005 @06:31PM (#14329281)
    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#.
  • My two cents... (Score:5, Interesting)

    by Savage-Rabbit ( 308260 ) on Friday December 23, 2005 @06:33PM (#14329295)
    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.
  • by WhatsAProGingrass ( 726851 ) on Friday December 23, 2005 @06:37PM (#14329315) Homepage
    Getting the right professor is much better than choosing the langauge.. I took a course called Advanced C++ back in the day and my professor worked for Lockheed Martin and only taught on the side. This guy new the field very very welland taught us industry standards etc...I have never had a CSC professor as good as this one. I to this day go by what he has taught in class. Make sure when you ask, "Which professor is better", they don't just give you the answer to this question "Which professor is easier"...because you don't want easy, you want better. I personally do not like the "easy" professors for I don't thnk I get my money's worth for school. And sadly, I do not program much at all. But from the C++ that i've learned, every other language that I sometimes fiddle with, comes very easily.
  • by 192_kbps ( 601500 ) on Friday December 23, 2005 @06:39PM (#14329329)
    The number and quality of programming tools in Java is much greater than in C# and are more likely to be open source and/or free. I find myself writing much more code in C# than I would in Java because of the enormous number of free Java APIs found on the Internet.

    Cases in point, I tried MonoDevelop a few months back but gave up since it contained no integrated debugger. I needed a neural network library and found JOONE for Java but no such equivalent in C#. Both platforms have unit test facilities (JUnit and NUnit), but the number of extensions for JUnit dwarfs that of NUnit.

    Based on the platform maturity criteria Java wins hands down. What are your objectives? I suspect you will need less aspirin completing your academic program in C# than in Java. Once you complete your program in C# you might be able to command a higher price on the job market but that is also a riskier proposition because C# is not entrenched like Java, and therefore the market for C# engineers is less stable than that of Java. Microsoft could pull the plug on C# in the future (and they've done this before with other technologies to force upgrades) and C# would quickly fade away, but Java would survive if Sun dropped support.

    Java and C# are both C++ dialects, and their differences from C++ are largely identical (e.g. intermediate code, single inheritance, interfaces, garbage collection, lack of pointers). As some earlier posts noted, learning one enables you to pick the other up fairly rapidly at a basic level, but the standard Java and .NET libraries vary considerably (not to mention the non-standard libraries). Learning APIs/libaries/frameworks is where you will spend most of your learning efforts once you work professionally.

  • Re:Java - Duh. (Score:2, Interesting)

    by EvanED ( 569694 ) <{evaned} {at} {gmail.com}> on Friday December 23, 2005 @06:53PM (#14329422)
    Sun is basically an engineering company, and they make nice clean hardware and software from a theoretical standpoint.

    OTOH, there are also a lot of rough edges. Like how you access the number of elements in a Collection with the size() method, the number of elements in an array with the length property, and the number of characters in a String with the length() method. Oh, and that length property? Essentially unique; it's the only place in the language with a read only property.

    Or how JFrame.add() used to universally throw an exception telling you to call JFrame.getContentPane().add() instead. ("Fixed" in 1.5 by just calling that method directly.) And while we're on that subject, the whole idea that the API has classes with (and condones implementing interfaces with, as is the case with the Collection interfaces) methods that always throw is smelly. If a method isn't supported, it shouldn't be there in the first place. Moving it out of the class/interface moves error detection from runtime to compile time -- and this is a good thing. (IMO the "proper" way to do this would be to have instead of Collection, have two interfaces. Collection would have only accessors. MutibleCollection would add the add(), remove(), etc. methods that change it.)

    Or the fact that Java literature doesn't talk about pointers. They're called references in Java. Except for NullPointerException. Why not NullReferenceException?

    Or the fact that String types are in a world of their own. They are more priviledged than user classes because they have operator+ defined on them, but less priviledged than the build-in types because (among other things) you can't use them in switch statements.

    I could go on with just small, little details that I think make the statement that Java is a nice clean piece of work from a theoretical sense silly. (I could also go on with things I think are substantial omissions from the language/library, but that's off topic.)
  • by autopr0n ( 534291 ) on Friday December 23, 2005 @06:55PM (#14329431) Homepage Journal
    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.

    Even more people are running Java capable OSs. In fact, it's a strict superset.
  • Re:C# (Score:1, Interesting)

    by Anonymous Coward on Friday December 23, 2005 @06:56PM (#14329443)
    The company I work for had a hell of a time hiring a C# developer with any experience.

    Not to mention all the good programmers who had a hell of time getting hired as C# developers because they didn't have any experience in it yet. You'd think that these two issues would connect up, but evidently not.
  • It's good advice... (Score:5, Interesting)

    by Da VinMan ( 7669 ) on Friday December 23, 2005 @07:27PM (#14329588)
    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.
  • by scarlac ( 768893 ) on Friday December 23, 2005 @09:27PM (#14330177) Homepage
    Like many others, I would just clearify on the differences, and un-bloat the comments made by many people that don't really seem to get what they are recommending.

    Java stands for purity. The language of 1.4 is very stripped down and contructs like foreach, generics and boxing/unboxing isn't in. In 1.5 these features were needed to compete with .NET (afaik).
    Most of the IDEs are written in Java (Swing) making their GUI slow and heavy.

    C# stands for impressiveness, "productivity" and _Microsoft_. If you ask people why they like C# many of them would (if they dare) claim that they are more productive and have an easier time developing because of the "smoothness" of the language. This, translated, means that they like the IDE, which is Visual Studio .NET, and they like the framework.

    C# and Java have many the same(/or at least very similar) features. I wouldn't critizise C#/.NET for the un/managed jumps, since they claim it as a strong feature themselves.

    Java is good for educational purposes since it's _a lot_ better documented, accepted and tried.
    C# is well for quick and dirty solutions, since the IDE is quick and the GUI quick and "integrated" (it looks a lot like native windows controls).

    So in short, my experience is that Java is a better language because of so many small things, but /really/ bad because of the lack a solid, fast IDE and an integrated windows look. If Java had just has a smoother windows integration, C# wouldn't have had a real chance.
    C# is going to be the accepted platform for developing windows apps since microsoft is pushing it out and shipping it with new windows versions. they already started developing a lot apps with it themselves.

    For the record: I know both Java and C#.
    My experience is that I was much more productive with C# because of the fast and integrated IDE, generics and the foreach construct - Absolutely nothing else(!)
  • Re:Java. (Score:2, Interesting)

    by Debiant ( 254216 ) on Friday December 23, 2005 @09:58PM (#14330275)
    Here is my 5 cents.

    I'm bit surprised that what I replied got 5 and 'insightful' and the general hostiliness towards .NET & C#.

    In work I use LAMP. I keep up Linux server for a hobby, which runs Debian. I've learned to program first with C, then with C++(OO), Visual C++ and Java. Most advanced learning in school and own time I've done with Java and J2EE. This all just to show I've not tied my fortune or past what MS does. .NET is in my non-scholar opinion elegant architechture. Can't see why I would write in Windows enviroment something with plain C++ for example, or would advocate it's general use over .NET. Far as I know, .NET tries to fix common problems windows programming has had. Maybe it presents something new problems that are far worst than current, but that's still to be seen. To my knowledge, .NET doesn't take account what abstraction level is used(programming language) but it is possible(atleast in theory) to do it with Perl too.

    Sure, I still wouldn't do my enterprise level software with .NET and/or C#. Neither would I'd like to use MS server software to use .NET. BUT, .NET is an intresting idea and shouldn't be overlooked so much just because it's Microsoft that is pushing it.

    I also feel personally that C# is more intuitive to program than with Java. Java has lot of good points, but it is clumsy. In a way that's both strength and weakness of Java. Good when learning it, but becames a drag for us more advanced.
  • by StarWreck ( 695075 ) on Friday December 23, 2005 @10:44PM (#14330416) Homepage Journal
    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 [comcast.net]

    Oh yeah, I did this entire project at DeVry.
  • by namekuseijin ( 604504 ) on Saturday December 24, 2005 @12:11AM (#14330760)
    Learn Python, instead.

    It's a nice dynamically typed OO language with crystal clear syntax, ease of programming, quite a few very handy operators and builtin types, and it runs anywhere. And i mean it: it runs on Linux, Windows, MacInstosh, *BSD and even on the .NET CLR ( IronPython implementation ) and the JVM ( Jython implementation ).

    Yes, you'll be able to transparently handle java or .net objects from it...

    Programming in C# or java feels like programming in assembly, comparatively...
  • by tyler_larson ( 558763 ) on Saturday December 24, 2005 @03:29AM (#14331318) Homepage
    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.

  • by cheesy9999 ( 750203 ) on Saturday December 24, 2005 @04:19AM (#14331409)
    Before I really had a clue what programming was about I went to a career day type thing at my high school. There was a guy speaking about computer programming, so I attended it. I asked the guy what he thought about learning to program for Macs vs. Windows (since I was really into Macs at the time).

    He said something along the lines of you don't just "learn to program Macs" or "learn to program Windows" (or "learn to program Linux" ;-) ), you learn the principles of computer science, then it's relatively trivial to learn new languages and APIs.

    So you should really focus on the core concepts like data structures and algorithms. Use whatever language the course uses.
  • by Anonymous Coward on Saturday December 24, 2005 @09:37AM (#14331946)
    When I took physics in college, one of the famous older professors (Nobel prize winner) rolled up his sleaves and helped out in the freshmen labs. My partner and I were doing some experiment to indirectly measure the speed of light, and got more and more excited as the numbers were coming out "right". The old professor came over and had a stern talk with us about error. "What's the error in your measurement? How does it propogate in the calculation?" The professor is dead now but I'm passing on that stern talk to you. Don't ever use calculator notation like "6.78167252e-6 seconds". Figure out the number of significant digits, and use them with standard metric units. For example "6.8 microseconds". Clear technical writing is critically important, and this is the first step.
  • Re:C# (Score:4, Interesting)

    by leabre ( 304234 ) on Saturday December 24, 2005 @07:18PM (#14333805)
    I forgot to say, when it comes to culture, I, by far, prefer working with Microsot programmers (.NET/C++/VB) becuase of their general attitude. In the many places I've worked and consulted, they generally (not as a rule of thumb) want to learn more, be good like that Java guys (there's a weird perception at play here) and are open to new ideas and not generally zealous and anti-linux or anti-oss.

    Working with Java people or Linux zealots, on the other hand, is not for the faint of heart. They are so anti-microsoft, anti-capitolist software market, so friggin' self-righteous, and whatnot that its annoying. Since I'm not in this camp, I prefer the more lax Microsoft sheeple-type culture over the annoying and forceful anti-everying-but-what-I-believe-in camp.

    Thanks,
    Leabre

Real Programmers don't eat quiche. They eat Twinkies and Szechwan food.

Working...