Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

C++, C# or Java

by Anonymous Monk
on Apr 02, 2004 at 17:09 UTC ( [id://342034]=perlmeditation: print w/replies, xml ) Need Help??

Dear advisers

I am a mid career Perl developer and have been doing for 5+ years. Not that my job is in jeropardy or something, but I like to learn some other language. Since I am willing to learn at depth, I like to devote my time and effort to exclusively one 'new' thing at a time.

My choices are C++ and Java and to some extent C#. My intention are to have a new career for me, may be based upon one of the 'newly' learned language.

Which way I should go?.

Thank you for your words.

Replies are listed 'Best First'.
Re: C++, C# or Java
by dragonchild (Archbishop) on Apr 02, 2004 at 17:49 UTC
    A lot depends on what platforms you want to work on. Java is good if you are doing webapps and want to continue doing so. C# is kinda the same, but limits you to IIS. C++ is more for guts development. You're going to be tied kinda primarily to Visual C++, cause that's the one I've seen more job offers for. That's going to be more if you want to develop against the Win32 API.

    Personally, I'd learn Java (to put bread on the table), then learn something like hardcore C and start hacking away at your favorite open-source project. Having opensource projects to my name has gotten me 2 jobs my last two jobs and two other job offers. (This during the "IT downturn" with a "dying language".)

    ------
    We are the carpenters and bricklayers of the Information Age.

    Then there are Damian modules.... *sigh* ... that's not about being less-lazy -- that's about being on some really good drugs -- you know, there is no spoon. - flyingmoose

      C# is kinda the same, but limits you to IIS

      No dont forget Mono. If you know Perl, you can embed it with Mono. Refs:

      How useful this is to the original question is debatable. One thing I didn't get from the original post was *what* type of work and what industry they want to work in.

      My advice would be: A) take dragonchild's advice (tactical short term) and then B)*expand* your existing skillset beyond programming into areas such as usability (strategic longer term).

      As the IT industry matures comodity tasks like programming (sigh) are being outsourced. Higher level tasks such as usability *could* (caevet emptor) be in much higher demand.

      update: looking for an open source problem? - read this article, usability and CUSP (Common Unix Printing System).
      C# is kinda the same, but limits you to IIS

      I'm not so sure the OP was talking about web development. As has been pointed out we now have mono and if one is interested in web development it will work with Apache. I have also experimented with using the MS .NET stuff with Apache on windows but that is a discussion for elesewhere

      Right now I would say C# is going to get you more work for a while as it is still relatively new with fewer programmers than c++ and Java, but with quite a lot of PHB brainshare - I see quite a few roles where they are also looking for experience with other MS software such as BizTalk and SQL Sew^hrver - but with some good rates (at least in the UK right now).

      /J\

Re: C++, C# or Java
by flyingmoose (Priest) on Apr 02, 2004 at 19:46 UTC

    The answer is, it depends. What sort of software do you WANT to write? After all, if you are learning a language to stay employed and not because you want to use it and enjoy what you are writing, you are either using the wrong language or are in the wrong field.

    If you want to move towards applications that get closer to the hardware, or even perhaps driver land, you must learn C. Learning C is a good bridge towards C++, but it is possible to learn C++ before C. C++ is essentially a superset of C, but it encourages some new idioms, some of which are good, some of which are not. In many ways, C++ trys to tack on OO in an ugly way (kinda like Perl but not really), and has some really braindead constructs like cout << setiosflags instead of fprintf. C libraries are plentiful and can bring you immense power, but it's not highly elegant. But what is... Java? Nah. Anyhow C++ OO is cludgy, but sometimes it's better than nothing.

    Java, IMHO, gets too much press. Yes, it is multiplatform, it's painful to write GUI apps in Swing, but they are shiny and get the job done. It is a very bad language to use for writing services (daemons) in, but it has a lot of usage for JSP and Servlets (web stuff) in Industry. It's a mixed bag, I tend to dislike it because it feels like I am programming in handcuffs, and a lot of stuff is not doable without JNI (the XS equivalent) -- plus, not a good selection of modules as CPAN either. I recommend reading some nice Paul Graham Java Bashing.

    Mono or no Mono, I would not consider C# unless you want to sell your soul to Microsoft. It copies Java (bad idea since Java ain't great anyway) and doesn't really do much but try to subvert it.

    So some other non-mainstream languages were mentioned (Ruby), but are there many jobs in that? No. Personally I don't like ruby, but that's beside the point. If you want a language industry wants badly, Ruby ain't it.

    Personally I am not officially a professional Perl developer, I use Perl whenever I can for build systems, command lines, etc -- often without asking management :) -- anyhow, keep Perl on your resume, as Perl is seldom the first language you are hired for, but it tends to be a huge plus. I wish I could find a mostly Perl (some C/C++) position myself, but there are hard to come by (especially in NC, USA). Most jobs on jobs.perl.org tend to be sysadmin related and/or in CA/WA/DC/NY. Or requiring massive LAMP experience.

    So that's a long answer and not much good. I'll sumarize. If I were you, and I'm not, I'd learn C/C++. C is not dying. Learn C++ after C, and if you like it, there will be positions in that for a long long time. Someone said C++ is for GUI apps, and they were probably thinking VC++. Quite widely used. Not going anywhere, and not losing share. In the interest of full disclosure, in order of favorites, my languages are Perl, C, and C++. Java comes in about 8th.

    My next language is going to be something like Haskell, Scheme (yeah, I know Lisp sort of), or Erlang -- something highly functional, borderline insane for industry usage, but screams 'this kid isn't a drone, we want him'. I'm also considering dropping a few languages from my resume just because. Yes, I know Python, but I don't want to look like I list every language I have ever used, and I don't want to land a job playing with it!

      Mono or no Mono, I would not consider C# unless you want to sell your soul to Microsoft. It copies Java (bad idea since Java ain't great anyway) and doesn't really do much but try to subvert it.

      I have to disagree with this. C#, IMO, is a major improvement upon Java. Much of what I hated about Java is fixed in C#, and having read many of your gripes about Java in various posts, I actually think you might agree with me.

      I hate Java's primative types. IMO, it's a bad attempt by Java's designers to be "pure" about things. Its a pain to upcast primatives into objects, and then the OO syntax is overly tedious. To me its a waste of resources, both CPU and programmer. C#'s approach may not be as "pure", but its alot cleaner for the end-programmer. These 2 lines are basically equivalent:

      int i = 5; System.Int32 i = 5;
      No tedious new Integer(5) syntax like Java. The simplistic explaination is that int is an alias to System.Int32, but thats not the whole story. The CLR (Common Language Runtime) manages all your types, so int i = 5 is managed as a primative up until it is needed to be an object (System.Int32), at which point the CLR will "box" the (much smaller) primative type into the (really only slightly larger) object type. And because C# has operator overloading (unlike Java), it really makes no difference to your code what it is anyway. It all for free and behind the scences. Sure, this is not okay if we are writing a device driver, but you wouldnt use Java to write a device driver either, so that is of no consequence.

      Then there are delegates. I love my anonymous subroutines, I loved them in Javascript, and I love them in Perl (and of course, LISP, SCHEME, etc too). They are the much smarter and sexier evolution of C function pointers. C#, not to be left out in the cold, has delegates. They are basically a type-safe anonymous subroutine on crack! They are too detailed to get into here, but suffice to say, if you ever found your self writing an object in java where all you really needed was an anonymous method, you should check out delegates. (Yes, I know about the Pizza compiler, but thats not Java, thats Pizza).

      Casting in Java sucks, its unsafe and a serious source of headaches. And yes, you guessed it, C# is the Extra-Strength Tylenol for your Java headaches once again. Consider the all to common, fetching from a Collection casting idiom:

      MyType i = (MyType) c.get(5);
      If i is not a MyType derived object, you are in trouble and get an exception. But in C#, you can do this:
      MyType i = c.Get(5) as MyType;
      If i is not a MyType derived object, you get null in i. Which is much easier to test for than it is to handle exceptions.

      And what about foreach, another Perl favorite of mine. C# has it too:

      foreach (MyType i in c) { # do something with i }
      Thanks to an optimization in the C# compiler this handles all your type casting for you, and just as above, if its not a MyType derived object, its null.

      These are just a few things I liked about C#, there is plenty of other cool stuff, like properties and events that really IMO go way past what Java is trying to do in its all too restrictive "pure" OO box. Give it a look, you might like it.

      -stvn
        all good info, but to be fair to my much despised java, 1.5 is finally adding generics (and foreach loopage). My "copied Java" statement is true at face value. C++, Java, and C# all follow the same basic syntax and paradigm. I'm glad to see casting made cleaner, and exceptions paired down. Casting in java is painful. Yet, it is a rip off -- I was present at several early Microsoft C# dog-and-pony shows, and the similarities were very clear. The reps couldn't even break out a "why this is better than Java" line ONCE -- and when CLR came up, the best they had was "some group in Poland is trying to make C#" work. They don't care -- they just embrace and extend as usual. However my chief beef with them, and this still remains, is they have zero interest in anything but Windows, and the Mono folks are doing their best to clone something they really don't like (Windows Forms), so we're looking at what....GTK for Mono as alternatives? Microshaft isn't going to let that fly. I suppose if you are on a Windows platform, it's probably better than Java (no doubt, hard to be worse) and it may make due if it's still as powerful as C at lower levels, but you still...ultimately...have a language that should have been compiled down to exe (no runtime) and should not be MS specific.

        How is the API? You still bound to MSDN hell? That's another big issue with Microsoft. Inconsistant API's that actually make the inconsistancies (which are many) in Java look tame. Sometimes they take Unicode, sometimes they take UTF-8, always clashing on types... The Windows SDK and DDK are pure evil. How clean are sockets? memory mapped files? authentication? Have these been cleaned up at all from the DDK and SDK? Probably not.

        And our poster is still looking for a good employer language. C# ain't there yet, except in the early adopter type of shops (which, IMHO, are the suicidal shops).

        Java is also trying to fix these things. In version 1.5, they have:

        a) boxing

        b) generic types (C++ STL)

        c) foreach

        d) bettern version of enum

        and several others

Re: C++, C# or Java
by perrin (Chancellor) on Apr 02, 2004 at 17:48 UTC
    Why don't you just look at one of those surveys of job sites that compares the number of listings for different languages? If your motivations are more than just economic, you should consider what kind of work each of these languages is used for. If you choose C#, you will be working in a Microsoft environment, so you may have feelings one way or the other about that. If you choose Java, there will be a lot of backend business applications. C++ used to mean a lot of GUI apps, but I'm not sure what it means these days.
Re: C++, C# or Java
by insensate (Hermit) on Apr 02, 2004 at 19:50 UTC
    Acquiring experience in any of the languages you reference has it's pros and cons. From a career perspective, however, adding languages to your portfolio will only get you so far. As someone responsible for project management, I find myself charged with the responsibility of meeting project needs with fewer and fewer personnel. That said, when I evaluate a candidate's resume I'm looking for someone with a solid programming background + _____.

    Recently that blank has varied from OS proficiency (Sun/Linux Especially with a concentration on performance tuning) to DBA experience (Teradata has been increasingly popular... but even a slick understanding of basic SQL is a plus). Someone with design experience is always good... especially with the popularity of OLAP tools and such.

    That being said, I would advise that you should garner some experience with one of the stalwart languages you put forth (java or c++) and then concentrate on expanding your knowledge of how the OS interacts with your programs. Learn shell-scripting if you can... or get really good at writing excel macros. Point your programs at different databases and learn what makes them different. Being able to port code is huge nowadays... with x software company going bankrupt or your mgmt deciding to drop Oracle for Db2 etc...

    I hope this helps.

    Jason

Re: C++, C# or Java
by etcshadow (Priest) on Apr 02, 2004 at 17:25 UTC
    I apologize because it's not one of the ones that you mentioned... but if you are coming from perl and want to learn something new to expand your mind, then you might want consider ruby.

    From my limited experience, it seems to be the best OO-centric language for someone from a perl background. It's clear from looking at it that the folks who made it were not afraid to admit that they learned valuable lessons from perl, but at the same time did not feel limited by it. (Contrast against Python, for example, which just screams "I was based on perl", but whose proponents appear to foam at the mouth when perl is so much as mentioned (oddly).)

    ------------ :Wq Not an editor command: Wq
      I am not looking for language because it's a great new language and has excellent features. I love Perl. I can do so many things in Perl readily. Similarly, I like to do with other language which has lots of ready made solutions available. My focus would more on accomplishing with the new language rather than 'learning the language' for the sake of its features.

        Amen. If you're looking for a new language to learn, why bother with something nearly identical?

        My recommendation would be assembly. It's quick to learn and if you play around with it enough you'll learn more than you ever thought possible about computing.

        Secondary recommendation (in case assembly doesn't peak your interest) would be Prolog. If you choose Prolog though, give it some time, there's more than what first appears. Just don't think everything that's written in it is "AI programming" (as so many do).

        Either way, enjoy.

        Then you need a language that can get you work, right?

        I recommend:

        Java, C++, C#

        You also need to lean some technologies if you want to get a job fast: such as web services, server programming and so on.

        what about XML?

        comments?

        C# is the better choice , becuse now a days C# usage is very high and lot of people shifting from their current programming language to C#. So lets a try to C# if you want to lern very simply follow this csharp.net-informations.com , c# is Object opriented and very easy to learn. Vayne
Re: C++, C# or Java
by alienhuman (Pilgrim) on Apr 02, 2004 at 21:20 UTC

    Under the reasons for learning Java category:

    • Free SDK/tools
    • Relatively simple install and setup
    • Many, many tutorials
    • A good introduction to OOP

    There's no equivalent to perlmonks.org, but javajunkies.org is trying.

    ----------
    Using perl 5.6.1 unless otherwise noted. Apache 1.3.27 unless otherwise noted. Redhat 7.1 unless otherwise noted.
      I was curious after I read this node yesterday, and went over there to check out the competition. I'm signing up to take a java class this summer, and I wondered if this might not be a good place to get a little encouragement and support, much as this site has been for me.

      When I got over there and signed up, I was THE ONLY ONE on the site. Not only that, but the NodeReaper bumped into me in the chatterbox and tried to strike up a conversation! Needless to say, I quickly returned to my own monastery, where I recited 10 Hail Vrooms and fasted for the rest of the night.....

      NovMonk

Re: C++, C# or Java
by jacques (Priest) on Apr 02, 2004 at 21:31 UTC
    I would learn C. It's a good language to know and you will find it everywhere. Perl and C are like a married couple. Perl would be the wife, since it's younger, smarter, knows what's important and has better intuition.
Re: C++, C# or Java
by stvn (Monsignor) on Apr 02, 2004 at 22:39 UTC

    I say learn C#.

    I have no love for M$, and I am a full-time LAMP programmer and think Open-Source is very much the way to go. But it sounds to me that you are looking for 2 things.

    1. A new career to carry you into the future (read: steady work).
    2. Something that will make you nice money in this new career.
    IMO, C# will give you both.

    Sure there is plenty of C++ and Java work out there, and there will certainly still be for years to come. But if you are going by that logic, then learn COBOL and you will really be in demand. But C#, along with it the CLR (Common Langauge Runtime) and the .NET platform (you can't really seperate them), are IMO the next evolutionary step for the C++/Java schools of programming. And being as hyped as it is, managers will flock to it (which in the end are the guys/gals doing the hiring, firing and delegation of work).

    Many people may not agree with me on this, but I think the future looks a lot more like C# than it does C/C++/Java. That coupled with the M$ marketing machine behind it all, and I think its the way to go.

    And if you are concerned about "selling your soul to Bill", then use Mono and release your C# code under the GPL. But of course, you'll find more work of the M$ variety, but what is "work" other than another Tool of Oppresion© used by The Man© to keep the horse-blinders on us wage slaves!

    -stvn

      A career in C#? I doubt it. I ran over to monster.com and did a quick search for C#... got 1467 results. Not bad for a java rip off. However, C++ got 4170 results. Java got more than 5000 results. (It says "1 to 50 of more than 5000")

      Of course if you really want job security, learn SQL. Databases are huge right now. Data collection is only going to get bigger and bigger. A search for oracle on monster.com comes up with more than 5000 results as well.

      I see C# as a passing fad. It was really hyped and then kindof sizzled out. Now there's a little sign of life but .NET has really failed IMHO. Probably because they really didn't make it clear as to what exactly it is. With the costs of storage and RAM drives going down, interest in databases are growing. Also with the trend of outsourcing, becoming a DMA might not be a bad idea because I think a company's data is one thing they really want to keep secure.

      I also find it really amusing that you are really the only person pushing C#. Why?

        A career in C#? I doubt it. I ran over to monster.com and did a quick search for C#... got 1467 results. Not bad for a java rip off. However, C++ got 4170 results. Java got more than 5000 results. (It says "1 to 50 of more than 5000")
        That makes sense for sure, length of use in the market being a large factor in the number of positions available. But I would guess that if you could roll back the hands of time to the mid-90's you could very easily substitute Java for C# in all that you are saying. I can remember the first time I encountered people doing server-side java (pre-servlets and such), and I laughed. They told me, you wait and see, and you know what, they were right. Java was billed as the lingua franca of the internet, we would all be using our Java applets to do everything from check our stocks to make breakfast, that marketing failed, but java lived on because it was an improvement over those that came before it. Progress marched on despite the fact that at one point it had every indication that it wouldnt.
        Of course if you really want job security, learn SQL.
        No way I can argue with that, knowing SQL and my way around some of the more popular DB packages has helped me get many a job.
        I see C# as a passing fad.
        I don't, but you are entitled to your opinion, only time will tell which one of us is right.
        It was really hyped and then kindof sizzled out. Now there's a little sign of life but .NET has really failed IMHO. Probably because they really didn't make it clear as to what exactly it is.
        I actually think you might be mistaking the real release of .NET with the BETA that came out a few years ago. M$ released a .NET Beta SDK about 2 years ago (i got a bunch of CDs in the mail at work cause of the magazines i subscribe too), and it was covered by the trade rags for a while then M$ went back to digest the feedback they had gotten, and it seemed to disappear. They now (in the last like 6 months) are back and are pushing it hard.
        I also find it really amusing that you are really the only person pushing C#. Why?
        I ammuse you, ... whattami a clown to you? eah! ;-P

        No but seriously, if you are interested I will tell you. Recently my boss has been doing alot of new biz work, we are looking to "detach" ourselves from one of our major clients as they are becoming "difficult" to work with. We are a group of consultants and we specialize in small-medium intranet/internet work, alot of what we do it LAMP oriented, but if the client says use M$ or Java or something else, then we do it. Our focus is solving the problem and not pushing/evangalizing a particular way to solve it. I myself am a full-time Perl developer (apache, mod_perl, MySQL/PostgreSQL on some kind of Unix), but I am also the senior developer here, so I occasionally have to do code reviews and sometimes even write stuff in other languages. It is important for me to have at least some knowledge of all the stuff we use or might use. Which brings me to C#.

        On my bosses recent "new biz" adventures he found alot of interest in C# and .NET experience. It actually shocked us, because we thought like you did, that it was going/gone the way of the Dodo. But it seems that alot of companies are looking into it for upgrading older ASP based intranets. So I was charged with looking into C# and seeing if it was something we want to get ourselves into. I grumbled for a few days, installed ROTOR, then installed DotGNU, and finally Mono (I work on OS X and pretty much refuse to use a Windows box for anything other than testing). I bought C# in a nutshell and started messing around.

        I was very impressed by C# and the CLR. Far more than I ever expected to be as well. Now, programming langauges are my hobby, I read books on them for fun (yes, its sick I know). I know at least 5 languages fluently, and another 5 pretty well, and then probably another 10 on top of that I am familiar enough with to be able to read and (mostly) understand code written in it (maybe with the help of a reference book). So I feel I am pretty competent to judge how good or bad a language is (of course you have the right to disagree with me on all these points of you like).

        Much of the base concepts behind the CLR are sound concepts. The idea of managed execution got its start back as early the 60s with things like LISP interpreters and VM/CMS (mainframe OS based on the concept of Virtual Machines) and evolved with the JVM. The idea of the IL (intermediate language) assembly language that all .NET languages compile down too, is not that far from GCC and its intermediate langauge it uses before it compiles native code. The idea of keeping meta-data around after compilation (which the CLR does) is really just RTTI taken to a new level to support things like class reflection and not just type information. The CLR combines these and takes it a step further.

        C# (IMO) is the "next step" from Java, which was itself a "next step" from C++/Smalltalk, which were evolutions of things like Simula, CLU, Ada and the Modulas. Progress marching on, you see what I mean? If already laid out what i see as C#'s improvements over Java to flyingmoose in here if you care to read it.

        Not everything thats comes out of Redmond is badly designed and inefficient (just the OSes). The people behind .NET, C# and ILasm are some very very smart and talented people, just because their paychecks are signed by Satan himself does not change that. And remember, Java would not be where it is (more than 5000 posts on monster.com) if it wasnt for the marketing hype that Sun dumped on it. It was dead in the water for a while, now you can't spit without hitting it. M$ has a lot of money invested in .NET and even more in their marketing budget, don't count it out quite yet.

        But hey, in the end the OP has to make his/her own decision. I am just throwing in my 2 cents.

        -stvn
Re: C++, C# or Java
by Steve_p (Priest) on Apr 03, 2004 at 06:47 UTC

    I'm usually not big on advocating learning various languages. Overall, I believe that good programmers will do well with any language you throw at them. If you learn good programming skills, you will never have a problem having a job.

    However, since you asked, I'd have to agree with the C advocates above. First of all, C can help you with your Perl allowing to create additional modules with XS. Second, a solid understanding of Perl will give you the more than enough background to understand C++, Java, or C#. Your advantage will be that you will understand memory allocation, so you'll right better, tighter code in those languages than various "experts".

Re: C++, C# or Java
by educated_foo (Vicar) on Apr 02, 2004 at 17:54 UTC
    I'd put my money on VB or C#, since Microsoft has proven time and again its ability to dominate a market. While Java is still taught at my university, quite a few undergrads are familiar with .NET, and Microsoft is pushing it pretty hard.

    On the other hand, if you're looking for a language as a step toward a new career, have you considered "business", "law", and "biology" as possible languages to learn?

    On the third hand, if you're interested in another programming career, have you considered Hindi? ;)

Re: C++, C# or Java
by stonecolddevin (Parson) on Apr 03, 2004 at 07:57 UTC
    C++ or Java. C# is Micro$haft's rip off of Java, so they will ultimately be alot alike (...) Plus, C# has a HUGE (121mb) sdk you have to download, java does not.
    I prefer C++, although you do not have the same web capabilites readily available (doesn't mean they aren't there), it's MUCH better rounded out than java.
    </two_cents>
    All posts are spawns of an archaeic and instinctual remnant of pre-neanderthalian neural synapse that, while irrevocably human, remains an anomoly to the common laws of nature.
Re: C++, C# or Java
by disciple (Pilgrim) on Apr 02, 2004 at 20:40 UTC
Re: C++, C# or Java
by Rhandom (Curate) on Apr 04, 2004 at 08:13 UTC
    Actually - if you want a fairly easy stepping stone - go with C++/Qt. Find the tutorials on Qt. Better yet, try out perlqt - get familiar with Qt while still using Perl and then jump to C++/Qt. There are so many things that have been made easier than in many other static type languages. Also, the learning curve isn't that steep. And as an added benefit, it is guaranteed to be crossplatform (well - guaranteed so long as you use the Qt classes to do all of your system operations).
    my @a=qw(random brilliant braindead); print $a[rand(@a)];
Re: C++, C# or Java
by Anonymous Monk on Apr 05, 2004 at 22:07 UTC
    I'd definately choose Java. Java is platform independent like Perl. It is also a very powerful language with many applications. Java programming skills are highly sought after by many in todays market since you can do anything from simple desktop applications to enterprise web-based applications and web services. All those applications can also be completely portable from one OS to the next. Take a look at Monster.com's search agents and you'll see that Java programmers (J2EE, JavaBeans, etc) are not lacking in opportunities.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlmeditation [id://342034]
Approved by broquaint
Front-paged by ChemBoy
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (None)
    As of 2024-04-25 00:23 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      No recent polls found