Subj : Re: Java vs. C++ To : comp.programming.threads From : doug Date : Sat May 28 2005 12:59 am "doug" wrote in message news:OdOle.143726$Cq2.102264@fe2.news.blueyonder.co.uk... > > wrote in message > news:1117213670.099981.66690@o13g2000cwo.googlegroups.com... >> Hi, >> >> My name is Hakim Singhji and I am currently a student at New York >> University. I am majoring in Information Systems concentrating on >> Application Development. However, I have not completely decided on >> which application langauage to concentrate on (yet!). I am fluent in >> Unix shell scripting with ksh, bash and tcsh; I know a little Perl; I >> also am very fond of SQL and Oracle's PL/SQL however I am looking to >> focus my studies on either C++ or Java and I am looking for a little >> bit of advice in this area. >> >> It appears that Java is easy to learn and it's popularity is steadily >> increase because of its speed and ease of use. However, C and C++ are >> industry standards which will undoubtedly be used for a long time. >> >> I asked one of my Unix professors this same question and he suggested >> starting with C then C++. He made a comparison between C and Java using >> an analogy of German and Yiddish as he explained, "Learning C is like >> learning German if you know German than you know Yiddish (i.e., Java) >> by default." >> >> His explanation makes sense however, he is also a C++ Professor and has >> written books on C and C++. So I think there may be a bias. Is this the >> general feeling of Java as it relates to C and C++ among developers? >> >> Please review this thread carefully, I need to firm up my decision >> before this next semester begins. Thank you all for your help in >> advance. >> >> Best, >> >> Hakim Singhji >> http://i5.nyu.edu/~hzs202/index.html >> > > This is purely personal experience - it seems to be different from > everyone else's post - that's the only reason I'm writing it. Please > discard as required! > > I started on C. I had an extremely pedantic uni professor who would > question every line of code. For example, he'd suddenly stop you in the > middle of a sentence and say things like "that's x bits of storage, > signed - what are the ranges of data you can store in there?'. It was > shit like this that drilled things like 'buffer overflow', 'arithmetic > overflow' and so on into my head. > > Having learned the basics of C, I now feel I could learn *any* imperative > language very easily. (Let's start a different thread for other types, > e.g. functional!) Then: > - C++ is just C, but with loads of new language features. Increase your > usage of them as your experiance grows - as long as you know C, you'll > never be stuck. But as you get better at C++, you can gradually > incorporate the advanced language features into your code. > - Java is a cakewalk. It's basically a dumb-man's C++, but with lots and > lots and lots and lots... of language features. There are built in things > like threading and synchronisation. But, if you've figured out C, you'll > understand how these all work from first principles - and not just take > them as some sort of language feature. For example, you'll wonder 'how is > that done under the covers?'. You're not likely to care if you just start > with Java. > > Let's use an analogy. Learning C++ is like learning to fix Bentleys. > Learning Java is like learning to fix Jaguars. Learning C is like > learning how to fix the internal combustion engine. > The latter is obviously the best thing to learn - do that, and you can > take care of the 'important' parts of the others (design, code style, > etc. - you can write OO in C, it's just not naturally geared that way). > Once you can do that, then you can extend your skills to cope with the > frilly stuff, like Bentley superchargers (in the case of our analogy, this > could be e.g. automatic C++ objects used as locks). > However, start with the Jaguar book (Java/C++), and you'll always feel a > little out of your depth when you have to muck around with that piston > (C). > > That analogy sucked, but it's grand prix weekend, so it stays. > > Have a good one! > > Doug > > > > (Too exceited about grand prix, sorry). Here's a better analogy. Well, not better, but hopefully more amusing. Pick one to learn: a) Stick Shift b) Automatic OK, ready? Now, imagine this: you get married, have a child, and realise you cannot afford the incredible expense of clothing and feeding your child, nevermind the pitiful education you have to pay for. That's before we even get to the jewellery for the wife. So you rob a bank. However, on the say out, you find your car doesn't start. You jump into the nearset car. It happens to be a stick shift. Now, if above, you picked: a) Excellent, you're sorted. Your wife will be very happy, and your child (once he cleans the facepaint from his face and puts the knife down) will have excellent schooling b) You prompty reverse back into the bank you've just robbed, get assualted in comical fashion by the airbag, and end up being colared by a guy in a suit a) is like learning C - you'll be ready. b) is like learning Java. I haven't figured out where C++ would go yet, but at the moment I imagine using a bulldozer and the army from a small third-world country in order to open a door. Doug .