«Home

C++ Or Java: Which Way To Go?

I am a CSC student in one of our univerisities last semester we were taught C++. I'm kind of getting into it nw but having probs with GUI programming though. But I am hearing C++ does not sell in the market anymore that JAVA rules. pls wat do i do? i dont want to be left behind after my year in school. should i forget C++ and go for JAVA? Plz i want unbiased details on the pros n cons of both languages I have googled but what i get is biased comments,

Avatar
Newbie
44 answers

The most important thing is to know whichever one you choose to learn very well

do not just be a mediocre

0
Avatar
Newbie

In programming and no matter the language the following are the same

a) an if will always evaluate to true/false

b) a while will always evaluate while a condition is true

c) a for will always evaluate from the start to the stop

d) an integer variable will hold a variable that is an integer. Scripting languages try to make this statement a little vague allowing an integer variable to hold a date, but you are warned about the consequences

e) division by 0 is not allowed

f) 1 + 1 will always be 2

g) to get data from a database:

i) connect to the database

ii) give ur selection command be it SQL, OOP, etc

iii) do what you want with the data

iv) whilst there is data, retrieve the next record/tuple/resultset/recordset/etc

h) whether u create the memory and free it or the OS/JVM/Runtime does it for you is immaterial, as long as you ensure it is freed. When its done depends on your applications needs

i) Everyloop must have a terminating point, else you have recursion

j) Every program can be written with every other programming language, just like every motor car can take you to any destination.

k) Every programming language you learn can earn you a job in any place in this world.

My point::

Forget the HYPE, learn programming and the job will come, whether in Nigeria or else where.

My 2 kobo worth.

0
Avatar
Newbie

@wazobia-ng - He has basically hit the nail on the head.

@Chf.Priest - to add to what he has said,

Programming with:

A) C++ is like building a house with sand, cement, water and gravel. You have full control but it will take you more time

B) Pascal/Object Pascal like building a house with blocks/bricks. Pick the block size you want and start laying them. You still have control if you choose the right block size.

C) VB/.NET/JAVA is like building a house with prefab. You are stuck to the particular type of prefab you choose. Choose the wrong one at the beginning and you will have to restart if you are changing the pattern of the house.

All said learn programming and the language you use will not be a problem.

0
Avatar
Newbie

Forget the fad.

If you truly want to be a real programmer. Then do this

Learn C++ and Object Pascal.

After that C# , Java , Ruby, PHP and the rest of them will become a piece of cake.

Dot Net is just a fad.

JAVA is just a fad.

Why didn't Microsoft write Office 2007 using C# and Dot Net? It is a pure C++ code

The entire Linux is running on C++ infrastructure.

All the mission critical financial applications out there are running on either C++ or Delphi's Object Pascal.

All medical system out there are written with either C++ or Object Pascal

Skype is written with Delphi

Yahoo TV To go is written with Delphi

Quake is written with C++

JAVA is written with C++

All the textbooks on algorithm , data structures, compiler design are written for either C++ or Pascal

All the browsers out there are written with C++

To survive in this industry learn the hard stuff and do anything later. That means C++ or Object Pascal. Don't be deceived.

I am the Chief Priest, I run Nigeria's sexiest Software development firm- Eresoft Ltd. Eresoft Ltd develops with C++ and Delphi for all our applications, including our browser based applications. We are the only company in Nigeria that builds Cross Platform apps from a single code base. Linux, Windows and Mac OS X. Only a real language gives that power. We would not employ you if your first language is JAVA or C#.

Oh by the way checkout our web application at http:\\online.ndu.edu.ng it is pure Delphi code

No JAVA NO Dot Net No VB NO C#

0
Avatar
Newbie

to choose between the c++ and java requires knowledge of what ur direction is

even though the two languages have a lot in common

still there are great differences in terms of what they can be applied to

if wanna write applications that are platform independent u can use java

but for hardware programmers C++ is ever the best

0
Avatar
Newbie

I support @kodewrita 100%, i just did not want it to come from you. By the way i code C++, but not java. I kinda prefer C++ [first oop lang i learnt to use, after coming from vb 6.0]

0
Avatar
Newbie

My dear, you see I have heard a lot of argument about programming languages that it bores me and I feel like farting in response. For this one, I must say something. If you feel programming is stressful, then forget it. Else, there's no difference in programming languages. I've seen secure applications written on so called insecure languages, and beautiful applications springing from the least expected languages. I could only wonder. Ego. When a man talks about programming, it always has a shade of ego, not excluding yours truly.

But yet, it should be noted that at a particular programming age, if you cannot pick up a new language and start programming in it within 24 hours, you never actually made it as a programmer.

What am saying, its not the language, its the understanding of software development.

Whatever you are learning, learn the standards, read rfcs where necessary.

And finally, if you learn a language for money I will not blame you, life is hard. But eventually, you will find that like women, you should date quite a number to really understand one. But then like women you learn one at a time. Do not be greedy and try to learn another when you cannot yet solve a real world problem with the previous.

My advice, love programming, not the language. Period!

Au revoir.

0
Avatar
Newbie

Man,U have to look first at what u have in mind, ur area of specialization, and ur ability to stick to problem solving procedures.C++ is good for general programming introduction but Java is gradually overtaking the market. Better still C/C++ is the still the mother of all!!!

0
Avatar
Newbie

I am not necessarily preaching about Fortran. I am just emphasizing something that a lot of folks(including me b4 i started my program here) dont know about recent Fortran developments. Anyway, perhaps Lisp and Ada95 are more powerful given the might of those who started them. My argument is based on the High Performance Computing Journals i have read as well as conferences i attended. Everyone seem to be using MPI with Fortran for parallel computing. I will find out more about the above alternatives. Thanks

0
Avatar
Newbie

I have to disagree with the fortran preacher about fortran being the most efficient language for technical computing and parallel processing. Try LISP or better Ada95 which the US Department of defence initiated, just that gives u an idea of what it can do. And i'm still not for the 'Plumbers' (strict Java users).

0
Avatar
Newbie

ever tried writing drivers in Java. every accessed microcontrollers (of course you can with JavaComm or Rxtx) but the advanced stuff will still be written in C++.

Java is simply Modern COBOL(not in obsolence . I mean its the popular business language).

Programming languages are also about the style of thinking.

C++ coders by virtue of the rigor of the language tend to be geared towards writing efficient code while Java programmers tend to be architecture astronauts (Google that. cant explain.) C++ programmers tend to be more Comp Sci aware (have more knowledge of data structures and how they work since they implement them using pointers). Java guys (like ME) just LOVE the Collections API. We dont care how it works.

@ the end of the day, a bad coder is a bad coder in ANY language.

0
Avatar
Newbie

Love this guy. I was at this junction a few years ago and i let people convince me that C++ is outmoded and I went down the Java track. THank God, I found my way back.

Master C++ and then get Thinking In Java by Bruce Eckelt to make the transition to Java when necessary.

Get the Qt toolkit. its so beautiful, i had to get the Java API (Qt Jambi toolkit). It has widgets and controls that Swing can't dream of. and its cross-platform too (remember the Java "Write Once Run Anywhere" gospel anyway).

Java, you can easily pickup anytime as long as you get the knack of thinking in terms of objects or entities and also develop the habit of looking up the 30000+ classes and methods in documentation anytime you get stuck (Thats why they invented Javadoc).

@

Fortran clogs your brain. that is not how Man was meant to program. I am not surprised all the cute girls in my class hated it (of course we geeks became the superheroes but thats a story for another day). The whole point of all those courses is to teach you how to think algorithmically and to apply programming to numerical problems.

C is much better and is simpler than FORTRAN. You can carry the entire function listing (just 80 functions in Kernighan and Ritchie version) in your head and still do amazing things. besides, it is instantly usefull cos there are reams of C code online. Your arguments about scientific utility can also be made for MATLAB which is a much better environment to do what you are doing.

0
Avatar
Newbie

C++ is good for drivers programming,but every solutin from C++ can also be solved by Java.Java is more good for the market

0
Avatar
Newbie

I beg to disagree with you. If you were doing courses with names like Numerical calculus/Computational Mathemetics/ Computational Fluid dynamics/ Computational seismics/ etc, the best program for it is still Fortran. The name says it all. Meanwhile what you should recommend if you were  ever in that position is the use of updated versions. You are probably angry because u only experienced Fortran 77. Well, Fortran has come a long way too with Fortran 90, Fortran 95 and Fortran 2003. Intel still have their own dedicated fortran flavour. It may interest you to know that the 2003 version has OOP in it.

I still maintain that as long as it's FORmula TRANslation you are working on, then FORTRAN is it.

And by the way, no other program comes close for use in Parallel computing which is like the bride of performance computing at the moment.

I hated fortran while doing my Bachelors too cos the flavour i was taught was older than me.lol

0
Avatar
Newbie

If I have my way, I'll abolish Fortran and COBOL from the curriculum of all Nigerian Universities and Polytechnics. We are in a GUI age. My problem today in computing is as a result of starting programming with those outdated languages.

0
Avatar
Newbie

Might i add here that if you were ever to find your self doing a performance-computing oriented job, then best is still Fortran.That is if your interest in that program is high speed calculation/iteration and no window dressing with gui. I'm currently using Fortran 2003 for my research

0
Avatar
Newbie

to me i prefer java than c++ becos java pays

0
Avatar
Newbie

Am presently building a sort of room allocation/Person On Board database. The whole idea is to know how many person' are on site, number of person' on time off, available rooms for persons coming to site. My problem now is to generate code capable of calculating next time off date (i.e. add 21 days to previous employee' time off date) and store the them on the database. Am through with the tables, forms and reports, but the coding.

The rooms are supposed to be allocated 4 persons per room (E45, F42, 44;K41, 42, 44; G27, H81, 84; M42; N44).

I hope you can get what am trying to put across.

Your opinion on this pls.

0
Avatar
Newbie

@chuckz4real. Ah! So u having problems writing code. I'm sure the fault is not VB but that u haven't actually gotten the concept of programming and the different styles supported like Object-oriented programming. My advice is search the web and if u r really Seeking u will Find.

0
Avatar
Newbie

@Every Contributor.

I like computing alot and hope to go into IT fully. Likes playing around on database too. My problem still boils down to writing code (VBA). How do I overcome this problem?

Is there any CISCO certified training institute in PH that I can attend on part time basis?

Your responses please.

0
Avatar
Newbie

Java is a lot easier to learn and less complicated but most companies use C++ because it is, in general, more secure. But whichever one you choose to do, I'm sure you'll be just fine.

0
Avatar
Newbie

Most developers in California are now switching to C# . That is the best way to go,

0
Avatar
Newbie

You can Get a whole lot GUI Libraries for C++. Most of which are cross-platform and quite fast.

A Common One would be Trolltech QT which is really somthing.

It's not just a GUI Library, but a collection of Very good utilities attached.

It has an opensource option www.qtsoftware.com

Also C++ has a huge library base.

See Boost.

Cheers! n Good Luck

0
Avatar
Newbie

please this is wrong!!!

and memory management has little to do with cheap memory, think memory leak

on speed, that was history from the far past ,

0
Avatar
Newbie

Great advice!! Success in Software Engineering is not about following trends but creating it where you can. C++ requires real dedication. Once you grasp it, you are well on your way to learning most any other language out there in no time. I started off as a C++ Programmer myself but moved towards C# when I got hired to work as a C#/Java Analyst coder, only with my C++ skills. I was able to quickly gain experience working with other languages on the job.

So, it is not necessarily about the language but understanding the base fundamentals of programming. Once you have a serious grasp of basic programming concepts, you are well on your way to learning any language in no time at all. Once you can handle C++, you can handle most anything else out there.

0
Avatar
Newbie

@dammytosh. If u're looking for a ref where Gosling dised his Java u won't find one cause he's bound to promote it by sun (he's not as 'brave' a Stroustrup to admit it). There was this combined interview of Ritchie,Stroustrup,& Gosling i read, on what the think about there languages. Gosling was quite defensive of his Java. Here's the link: http://www.gotw.ca/publications/c_family_interview.htm . Well, i myself won't us an AK47 to smack a roach (lol). Like u, i agree that thought should be given b4  using any language 4 a job based on the systems requirement. HAPPY CODING BRO.

0
Avatar
Newbie

C++ has done alot though check out http://www.research.att.com/~bs/applications.html

n dueal vs dammy thing is like a language war

guyz

0
Avatar
Newbie

@dammytosh. I'm sure if u were to grab the .java file for that swing GUI class and go through its declaration tree u'll land on a C/C++ code. I'm not against reusing someone elses code but i won't blindly pop this and pop that into my system just cause it's there for use without knowing how it affects my program (that's what strict Java followers do). Plumbers! Can u tell me of one widely known PC program that's in use and is written in pure java? Even SUN microsystems did not use Java for their Solaris OS cause it won't keep-up.I agree java has its place but real programming can't be done with it. It has simplistic network access classes but i'll rather go with Python sockets class. Why? Cause it's efficient written in C/C++. And about writing a 100 line source to get a window up, i don't have to cos i can get Qt3,SDL,wxWidget,ogre3d libs and create my lil class i can reuse or use the systems as is just in d same way that u get swing/AWT GUI class but the difference is mine is efficient cause i'm not blindly having a GC (garbage collector) that eats my CPU clock cycle. I'm not against using any language,funny i know java but why use something the designers won't use. I'm sure if J Gosling was give Shekpe to drink an got high he'll admit he wrote Java 4 his toddler to play with (he guards Java like it's the Holy grail of programming languages calling it a general purpose language instead of strictly a non-general application level one). Dammytosh try building a system that engages graphics algorithm and see how it runs.

0
Avatar
Newbie

@solomon201. The reason C++ doesn't sell in nigeria is cause our so call software development companys work wit niija mentality of 'Money today today' like some movies do. No company here is willing to sponsor a project that'll go for more than 2 months (they want plumber work; do am make he work today if e f-up tomorrow we go write am again). Any 'fool' can create a windows form project that queries a DB even a non-techie manager . After them go one make indians 'gree say we reach them, who sai! My brother learn cause u loving creating tech not for the pea they pay.

0
Avatar
Newbie

@henry.exe, Continue paying good attention to what you are being given in school, there is a way you can grab the selling skill in programming when you are off school, some do get exceptional programming experience here, talkless of when you engage a mentor then.

0
Avatar
Newbie

Thats true The 9ja market is filled with .NET n JAVA,

@ dammy

I have really thougt about it but cant get why C++ does not sell in the 9ja market despite the fact that its been around in the IT world for quite a while compared to the others.

Any answers?

0
Avatar
Newbie

@ dammy

Dats my worry there are little or no demand for C++ developers in the Nigerian market and i dont see this changing in few years time. But i got luv for this language, I am scared of learning another language now added to CPP cos i fear i might start mixing up the syntax,  rily dont know for now, kind of confused.

0
Avatar
Newbie

@Poster

It is not fake,i once came across the issue of the IEEE magazine where the interview was granted.

I dont want you to be confused on deciding which language to choose but if you are targeting NIGERIAN MARKET (which you will likely do), without necessarily speaking too much grammer, CPP is definitely out of it.

I write CPP, Pascal, Cobol etc very well besides my production languages but I will advise you to invest more in Java, PHP or the Dot Net Technology and less in CPP if u have to.  (Just an advice nothing else)

As a matter of fact, any language you learn  and master very well will take you to places.

About your GUI programming, if i read your mind, you mean Developing Windows Form Based Application (maybe to interact with a database) with CPP ?

If i am right, then CPP looks like using AK47 to hunt a cockroach.

-My Opinion

0
Avatar
Newbie

@kobojunkie. Glad someone in here agrees with me. That's wat i've been trying to tell the poster 4 the past week or 2 even though i've been trying not to make it obvious i'm pushing it in his face. Keep with C++ since u r not hating it.once ur done or while u've covered around 35% of the language moving to any related language will b a work n d park believe me. It worked 4 me and i'm not regreting making that choice a long time back when every obi was jumping to java. Look beyond the trend. Right nw i've got c++/c,java,c#,python,lua,javascript,and i'm getting Ada 2005 under my belt. Plus i'm a game programmer. I remember one article on what Stroustrup(the c++ creator) thinks about java programmers,in he's word 'they act like plumbers, blind to the basics for efficiency'. Do i have to plead that we stop running towards the 'moon' when the 'sun' is d other way.

0
Avatar
Newbie

@Poster, right now, C++ programmers actually hold a high place in the market. From Gaming to financials, C++ programmers are considered for a large number of jobs and they are paid more than there peers skilled in other languages like JAVA or C# are. If you are already working on C++, I would advice that you stop looking at trends and focus on learning all you can of the language. Because once you master one, you will have no problem switching to another in less than a month.

You mentioned you are having problems with GUI programming in C++, I will however tell you that GUI developers are in high demand in high industries. Iam currently working on improving my C++ skills, especially my GUI skills for gaming as well as financials, medical graphing needs, and would advice anyone already in there to stay the course.

0
Avatar
Newbie

@everyone.if Stroustrup said all of that then i'm not surprised (cleaver f**k)lol! There's no perfection in generality of any sort cause perfection comes with specialization. According to the interview,stroustrup is against using the OOP style for very large systems, that's a real minus for languages that are fully OOP supportive like Java ,C#. It all boils down to what engineering of whatever form is(i.e Cutting Corners). Like i said in an earlier post learn one language,then another and another(don't b Biased). And put some thought before creating a system with whatever language.

0
Avatar
Newbie

@henry.exe.really glad u r getting enthusiastic about programming. Stroustrup's interviews are always hilarious but he's not the first to admit the facts about C++ not being the cleanest language ever created. If u've started rethinking learning some other language like java U can google what he thinks about java. Welcome to a programmers life. Every language was created with a philosophy of what the designer think a programming language should be and since we are only human there's always a diversity of thought. If u want my recommendation start by learning HTML-JAVASCRIPT-VB-C++-JAVA-C#-C-ADA-COMMON-LISP.u should be through b4 u grad God willing. Also research Design Patterns, Agile and Extreme programming, and UML(unified modelling language). I'm always moved to help a newbie anytime.

0
Avatar
Newbie

Thanks all i think i have made up my mind on which way 2 go,

0
Avatar
Newbie

@ Poster

You heard right. JAVA rules!!! though C++ teaches u better memory management but who cares? these days memory is cheap and abundant. Again most ppl say JAVA is slow but i tell u every passing day hardware performance increases n the so called slow pace is disappearing. I think the future holds little or nothing for C++ even with a new standard (C++0x) to be released soon.

So Poster, u should switch to JAVA in my opinion, it is easier, rules is Web development, Networking and it gives more jobs than C++.

0
Avatar
Newbie

The key thing is to learn software design principles. Just use whatever language is being taught at your school. Once you have a solid understanding of software design/engineering principles, it should not take a lot to use those principles in whatever language you end up using professionally, be it Java, C#, C++, etc.

0
Avatar
Newbie

@henry.exe. C# isn't a superset of C++ or C. It's not code compatible with either because it has a different philosophy on how a program should run on the system(though i'll say the syntax is about 75% similar to C++).  But if u use .NET technology u can have quite similar feel because in .NET programs written in any of the .NET supported languages(VC++,VC#,VJ#,VB) can communicate with each other and share resources. If u need a gui library try wxWidgets. I knw it seems u write more code just to get even a blank window on screen but u'll be a better CS by it in d long-run.

0
Avatar
Newbie

@dueal

Thanks, i see u are a C++ fan no doubt,  I am still putting my best into C++. But developing a GUI for my C++ program scares me takes lots of code to call up a window well no pain no gain so i am steadfast in my study. talking about C# is it compactible with C++ just like C is?

0
Avatar
Newbie

@poster. It's really nice to hear u were introduced to the C++ language. From wat u posted it sounds like u r only intrested in programming just for finding a job as a programmer as soon as u leave school. That's really short-sighted if i might add. Well, to give an unbiased answer it's true that at one time in nigeria java was the in-thing to get a job, now C# is gain grounds, far back Fortran was, then Pascal and on. The truth is in this country software development companys follow the most advertised language without really considering deeply if it's appropriate 4 the job. You might switch to learn java and by the time u r through learning its ever changing in's and out's C# will b the most demanded or even Ruby. My advice is start with wat ever language u r confortable with then after learning that one learn another then another and another. Don't be in a hurry just because u need a job. If ur onions are good when the opportunity comes u'll be the on calling the shots. If u need my recomendation on a language to start with i'll advice u stick to C++ since u don't show any sign that u hate it.it's the most used language for commercial software development overseas, it has the most available libraries, and the efficiency of a system level language. Believe me,learn C++ then learning any other language after it will be a breeze. If u need a good beginners tutorial on C++ go to www.softlookup.com. Good luck!

0
Avatar
Newbie
Your answer
Add image

By posting your answer, you agree to the privacy policy and terms of service.