Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

cube

Suspended
May 10, 2004
17,011
4,973
From monster.com

Jobs in the US paying 100K or more:

Java: 837
C++: 685
.NET 410
 

zimv20

macrumors 601
Jul 18, 2002
4,402
11
toronto
Soulstorm said:
The only programming I had done before I start C++ was HTML and Applescript, which were no way near the concept of C++.
right. scripting is different from procedural which is different from OO. all programming is not created equal. and once you get into real programming, pointers and references are needed. granted, C (and in turn C++) allows for all kinds of nutty pointer constructions, but it's also really powerful.

like any powerful language / paradigm, it takes time to get proficient. i came to C++ from a strong C background and that helped a good deal. of course, i had to unlearn some habits in order to properly learn C++ as an OO language, and it always helps to learn in steps.

my first C++/OO project was 3-tier client/server and i worked on the middle tier. that meant i wasn't messing with stuff like GUIs or file i/o. what i concentrated on was building domain objects, providing services to the front end, and persistence. the GUI group knew very little about the domain and nothing about persistence, their expertise was using our interfaces and displaying the data.

these separations are important not only from a design perspective, but also from a learning perspective. when you're messing with HTML, it's a hodge podge of data, display and (if needed) persistence. but it's not built for much beyond that -- ever try performing data analysis in HTML?

if HTML is what you're used to, then of course C++ is going to be overwhelming. but it needn't be, it just takes time. same for java; it's actually more involved than C++, imo, because of all the packages and environments it comes with. java is extremely powerful and can be overwhelming, but well worth any programmer to learn.
 

MarkCollette

macrumors 68000
Mar 6, 2003
1,559
36
Toronto, Canada
It depends on what kind of programming you want to do? Web apps, embedded, client side software, scientific calculations, database apps...

Most likely your choice will be between Java and C#, not C++. Java and C# are sufficiently similar, that there's no reason to not learn both.
 

darkwing

macrumors 65816
Jan 6, 2004
1,210
0
Java sucks. Plain and simple. If Java was so great, why are JVMs written in C++ and not in Java? :rolleyes:

It really depends on what you want to do. You'll have more fun being a n00b with Java because you can get into some pretty easy GUI stuff once you learn the core of it. However, c++ produces much faster and more efficient code. The JVM on OSX sucks big time. My 1.67 GHz G4 chokes 100% cpu on the same thing a p3 running windows does with 5%. C++ always produces more efficient code than Java because it's compiled for that architecture.

I write medical device software for a living. I do everything in C/asm for small microcontrollers and C++ for small footprint PCs running embedded Linux (mips/x86.) When you start looking at I/O lines on a scope and wanting things to be within so many microseconds of each other, you start to figure out that a language like Java won't cut it.

If you want to make some little windows with pretty buttons to change the color in a box, use Java. Or, you can always try c++ with wxWidgets or something. At least that's a "portable" gui.

Just my 2 cents. Back to homework. bleh
 

zimv20

macrumors 601
Jul 18, 2002
4,402
11
toronto
MarkCollette said:
Most likely your choice will be between Java and C#, not C++.
i've not used c# -- what platforms is it running on these days?

i don't really understand so many people's aversion to c++. darkwing had a good response about performance, i know of a number of large projects done in c++ -- and not java -- for that very reason.
 

bousozoku

Moderator emeritus
Jun 25, 2002
16,120
2,397
Lard
zimv20 said:
i've not used c# -- what platforms is it running on these days?

i don't really understand so many people's aversion to c++. darkwing had a good response about performance, i know of a number of large projects done in c++ -- and not java -- for that very reason.

I know that it has better performance and, in the hands of someone paying attention, it can be an asset but most programmers can't seem to keep from creating memory leaks and buffer overflows because they're not methodical enough. The same thing can be said for C and, to a lesser extent, Objective-C. C++ is especially targeted because of its high degree of usage and the ability to not create just one object with a leak but to create thousands.

How many leaking browser windows with leaking browser tabs does it take to bring down an operating system?

Is that overly dramatic? Sure, but without due vigilance, Java is safer than C++. From what I've seen of most C++ programmers, they should be coding in Java--it would make the computer a safer place.
 

MarkCollette

macrumors 68000
Mar 6, 2003
1,559
36
Toronto, Canada
zimv20 said:
i've not used c# -- what platforms is it running on these days?

i don't really understand so many people's aversion to c++. darkwing had a good response about performance, i know of a number of large projects done in c++ -- and not java -- for that very reason.

I have no aversion to C++, in fact I learned it years before Java, and have used it in conjunction with Java since then. But, I would recommend learning C before C++, and so would not recommend C++ as a starter language.

Given no information on what kind of software this new programmer is hoping to write, I have statistically assumed that he'll want to write business software for a living. In that market, corss-platform Java, and Windows-centric C#/.NET are the two main players. As well, they're relatively good introductory languages for getting useful stuff done.
 

MarkCollette

macrumors 68000
Mar 6, 2003
1,559
36
Toronto, Canada
darkwing said:
Java sucks. Plain and simple. If Java was so great, why are JVMs written in C++ and not in Java? :rolleyes:

Wow. Could it be that JVMs are written in C++, because Java relies on a VIRTUAL MACHINE, which must at some point interface with a native system, for which the system APIs are only accessible in C/C++? Or would you prefer the JVM run in a JVM, run in a JVM, run in a JVM...


darkwing said:
It really depends on what you want to do. You'll have more fun being a n00b with Java because you can get into some pretty easy GUI stuff once you learn the core of it. However, c++ produces much faster and more efficient code. The JVM on OSX sucks big time. My 1.67 GHz G4 chokes 100% cpu on the same thing a p3 running windows does with 5%. C++ always produces more efficient code than Java because it's compiled for that architecture.

If his goal was to do cool programming on OS X, then I would suggest Cocoa programming in Objective C would be a more direct route to that end, than Java or C++.


darkwing said:
I write medical device software for a living. I do everything in C/asm for small microcontrollers and C++ for small footprint PCs running embedded Linux (mips/x86.) When you start looking at I/O lines on a scope and wanting things to be within so many microseconds of each other, you start to figure out that a language like Java won't cut it.

If you want to make some little windows with pretty buttons to change the color in a box, use Java. Or, you can always try c++ with wxWidgets or something. At least that's a "portable" gui.

Just my 2 cents. Back to homework. bleh

Java is mostly used on the server side, rather than in little GUIs with buttons. But, there's also a lot of MIDP stuff, where applications on cell phones are written in Java.

For embedded work, one has to know that C++ does have a runtime, whereas C does not, so when doing embedded work it's either assembly, C, or subsets of C++ that give you the functionality of C with some of the syntax of C++.

And if you want to do cross-platform GUIs in C++, there's also QT from TrollTech.
 

zimv20

macrumors 601
Jul 18, 2002
4,402
11
toronto
bousozoku said:
From what I've seen of most C++ programmers, they should be coding in Java--it would make the computer a safer place.
yeah, that's a good point.

MarkCollette said:
I have statistically assumed that he'll want to write business software for a living. In that market, corss-platform Java, and Windows-centric C#/.NET are the two main players.
i'd like to know if c# has really overtaken c++ in the number of jobs. regardless, you say it's "windows-centric". do you know if it's available on any non-windows platform? i thought it was designed to be, but i haven't really been playing close attention.
 

Josh

macrumors 68000
Mar 4, 2004
1,640
1
State College, PA
Although C was the first program language (besides simple visual basic stuff in high school) that I began to teach myself, and only got into it very little, the first college course in my CS program was 'Algorithms and Computing with C++,' which I am currently taking.

So, C++ is the first (as I see it) language I've really began learning.

That being said, I don't know of enough of another language to make comparisons, but so far it doesn't seem bad learning it. My course work is challenging, and I've made some fun stuff w/ it outside of class too.

I want to eventually pick up Cocoa as well, because I'd like to develop Mac applications.

Still not certain yet if I'd like to focus on web-centric development, or standard application development (or maybe somewhere in between), which will determine which languages I'll want to know really well.
 

bousozoku

Moderator emeritus
Jun 25, 2002
16,120
2,397
Lard
zimv20 said:
i'd like to know if c# has really overtaken c++ in the number of jobs. regardless, you say it's "windows-centric". do you know if it's available on any non-windows platform? i thought it was designed to be, but i haven't really been playing close attention.

It's available anywhere the Mono environment is available, but you know the trouble with keeping up with Microsoft's changes--just ask anyone trying to provide perfect file translation for MS Office--even the Macintosh BU can't do it.
 

bousozoku

Moderator emeritus
Jun 25, 2002
16,120
2,397
Lard
zimv20 said:
iow, it's still only available on windows?

Well, there are multiple answers. :p

The official version is only running on Windows for Windows. Supposedly, Microsoft was working on as Macintosh runtime backend but as far as I've heard, they've never even come close to deploying it.

Mono is available everywhere because it's an open source project.
 

ryan

macrumors 6502
May 17, 2002
283
0
Denver, CO
jsw said:
around here, there are more C++ jobs than Java ones.

You keep saying that but Monster.com shows more Java jobs than C++ ones, at least in the Boston area (which I realize isn't *that* close to Andover but they don't list Andover in their city selector).

Anyway, back to the original question, why not try both? I prefer Java (although I've started doing some work with Ruby) simply because it has such a big user community and there are so many great tools and libraries available.
 

jeremy.king

macrumors 603
Jul 23, 2002
5,479
1
Holly Springs, NC
MarkCollette said:
Given no information on what kind of software this new programmer is hoping to write, I have statistically assumed that he'll want to write business software for a living. In that market, corss-platform Java, and Windows-centric C#/.NET are the two main players. As well, they're relatively good introductory languages for getting useful stuff done.

As a consultant for the last 9 years, C# (.NET) and Java are definitely two of the most common requested skills asked for from our clients. I personally prefer Java - been doing it since 1998, while I am learning C# on the side to see what the hoopla is all about. PHP is another up and comer, but hasn't really fully penetrated enterprise just yet - so far the trend has been SMB but if thats your thing, go for it.

The most marketable skill you can have is being able to solve problems using ___________ technology.
 

darkwing

macrumors 65816
Jan 6, 2004
1,210
0
MarkCollette said:
Wow. Could it be that JVMs are written in C++, because Java relies on a VIRTUAL MACHINE, which must at some point interface with a native system, for which the system APIs are only accessible in C/C++? Or would you prefer the JVM run in a JVM, run in a JVM, run in a JVM...

Hence the joke. :)

MarkCollette said:
If his goal was to do cool programming on OS X, then I would suggest Cocoa programming in Objective C would be a more direct route to that end, than Java or C++.

True I should have asked him what his goals are. I'm so used to thinking of things in a "portable" nature unless otherwise specified that I just assumed he was doing something non graphical.

MarkCollette said:
Java is mostly used on the server side, rather than in little GUIs with buttons. But, there's also a lot of MIDP stuff, where applications on cell phones are written in Java.

Why would anyone do anything with java on a server side? Servers demand performance, and Java doesn't perform. I'm not saying you're wrong..I know they use it on the server side..however I think that runtime efficiency should always trump developer education.

MarkCollette said:
For embedded work, one has to know that C++ does have a runtime, whereas C does not, so when doing embedded work it's either assembly, C, or subsets of C++ that give you the functionality of C with some of the syntax of C++.

C++'s runtime is deterministic as long as the new operator isn't being used. In a hard realtime system, all you really care about in the long run is determinism because that determines worst case latency.

MarkCollette said:
And if you want to do cross-platform GUIs in C++, there's also QT from TrollTech.

What about wkWidgets? I want to use that one when I get some more free time.
 

ryan

macrumors 6502
May 17, 2002
283
0
Denver, CO
darkwing said:
Why would anyone do anything with java on a server side? Servers demand performance, and Java doesn't perform.

That argument might have been valid in 1995 but it simply isn't true any more. Try a Google search for "java vs c++" and you'll see examples where C++ is faster in some cases and Java in others.
 

darkwing

macrumors 65816
Jan 6, 2004
1,210
0
ryan said:
That argument might have been valid in 1995 but it simply isn't true any more. Try a Google search for "java vs c++" and you'll see examples where C++ is faster in some cases and Java in others.

I have googled that before, and it's all bunk. Hey, they make the same argument the pot-heads do. It's just to convince themselves. :)

I've done a lot of real world tests on sorting and searching algorithms and Java doesn't even come close..sometimes slower than 4000 times the C counterpart. Even with Java compiled for native machine code, there's still a VM on top of it.

I know from personal experience the OSX JVM is total crap and Windows machines much older and slower than my Mac eat less CPU cycles running Java.
 

ryan

macrumors 6502
May 17, 2002
283
0
Denver, CO
darkwing said:
II've done a lot of real world tests on sorting and searching algorithms and Java doesn't even come close..sometimes slower than 4000 times the C counterpart.

And I can write an application in C that is slower than one written in Java. So your point is what?

Anyway, as I said before, the OP should try out a number of different languages and see which one(s) appeal to him. Maybe it will be C/C++, Java, or another language entirely. Best of luck.
 

therevolution

macrumors 6502
May 12, 2003
468
0
darkwing said:
Why would anyone do anything with java on a server side? Servers demand performance, and Java doesn't perform.
Whoops, somebody better tell the J2EE community!

Is Java as fast as C in every situation? No. Is the reverse true? No. In the end, it's all about the best tool for the job. Java has the J2EE framework for developing server side applications - what does C have? In the business world, nobody is going to code things from scratch in C because it's the "right" thing to do. It would be a complete waste of time and resources.

darkwing said:
I think that runtime efficiency should always trump developer education.
Developers should always be aware of common performance pitfalls, but it's only useful to a certain point. Outside of certain domains, nobody really cares about a few milliseconds anymore - not when the cost of hardware is so cheap. Rather than waste developer time squeezing out a few extra cycles, you can just throw some more servers onto the load balancer.
 

darkwing

macrumors 65816
Jan 6, 2004
1,210
0
ryan said:
And I can write an application in C that is slower than one written in Java. So your point is what?

Anyway, as I said before, the OP should try out a number of different languages and see which one(s) appeal to him. Maybe it will be C/C++, Java, or another language entirely. Best of luck.

All right. Tell you what. You show me a single thing that Java can do faster at runtime than C or even C++. Just one. Give me some common input file, a java file and a C file, properly written and optimized, that when compiled and run will produce the same output, and I'll time their execution. Just one. Then I'll gladly admit I was wrong.
 

jeremy.king

macrumors 603
Jul 23, 2002
5,479
1
Holly Springs, NC
darkwing said:
All right. Tell you what. You show me a single thing that Java can do faster at runtime than C or even C++. Just one. Give me some common input file, a java file and a C file, properly written and optimized, that when compiled and run will produce the same output, and I'll time their execution. Just one. Then I'll gladly admit I was wrong.

Show me a C program that once compiled can run on a variety of platforms and architectures...Two languages, two different purposes. Assembly is faster than C, so using your failed logic it must be a better language?

What value are you even adding to the OP question??? Um, that would be none. :rolleyes:

He wants to know what language would make him make him marketable, not which language is bigger/faster/better....
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.