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

Java or C?

  • Java

    Votes: 22 34.9%
  • C

    Votes: 41 65.1%

  • Total voters
    63
Status
Not open for further replies.

softwareguy256

macrumors regular
Jun 5, 2010
131
0
It is quite possible that people who don't know C++ can easily write bad code that is 2x slower because they fail to understand all the hidden code that is inserted by the compiler. That is why in my business we hire only the best and brightest.

Then I might hire him. I had a fairly complex simulation which was originally written in C++ back in 1998 that I recoded into Java which I was just learning at the time, and it was, indeed, faster. And there were good reasons for this, mainly because the language was better suited for what I was trying to accomplish and I found better ways to implement the algorithms because of it. Sometimes the "efficiency" of a compiled language (or assembler) doesn't get you faster operation, or faster implementation. I was selling Forth systems I developed in the 1980s which outperformed C (a financial system where they had to figure out how to embed the Forth calculation engine in a larger system because their attempt to implement it in C was half the speed) and even assembly (a stepper motor controller where the assembler code was using a poor algorithm for advancing motor position).
 

Boltonic

macrumors newbie
Jul 29, 2012
16
0
To state the obvious, any interpreted language has a non-zero overhead and garbage collection introduces non-deterministic running time that is simply unacceptable for many mission critical tasks. Cube jobs, IT work, there's so much slack and the penalties for mistakes are so minor that using ANY language including java and visual basic are acceptable.

It is blatantly ABSURD to say that Java is faster than C++ and its only a matter of time whether it is 1, 5, 10, 20 years before you realize that I am right. But the base pay says everything. If you are making under 6 figures you need to be quiet immediately, because it shows that the market does not really value your opinion or your expertise.


By you saying that a software engineer who makes under 6 figures opinion doesn't matter shows that you are ignorant and have no clue what developers make across the country. I work on a multi billion dollar project as one of the main developers. I do make very good money as you state but I have worked with developers who make less than me but are absolutely more OO savey. I have also have went to another state as a representative of my company to start up our business there. Companies down there employ people who have absolutely no clue what good programmer is and they make way more than me. The problem is our field is that people become complacent and will not adapt to newer and better techniques. Developers have domain knowledge which makes them complacent and hard to fire. They won't adapt adapt to things like OO or TDD. The developers that do are mostly younger which means they may not make the we do which is bs to me. This is just my 2 cents.
 

talmy

macrumors 601
Oct 26, 2009
4,727
337
Oregon
Come on... you are not being fair. Comparing Motorola and Intel chip speed in ADDITION to your experience coding C versus assembly?

Yeah, true. :) But the 68000 team at the time felt that their better architecture (no argument there!) and 100% assembly language code was going to be far faster than mine. After all assembly is superior in performance.

History keeps repeating itself.
 

VinegarTasters

macrumors 6502
Nov 20, 2007
278
71
Yeah, true. :) But the 68000 team at the time felt that their better architecture (no argument there!) and 100% assembly language code was going to be far faster than mine. After all assembly is superior in performance.

History keeps repeating itself.

Yes, you bring up a good point. Experience is important. With experience, you can improve a slow languages algorithm to match a faster language. Take a look at string reversal for example. If this was implemented in a function like C, someone would normally create a new string array, copy character to character from the opposite end of the original string, then delete or transfer the final results. A better algorithm is to simply keep the original string go index from one end to the middle and swap characters with the other end (based on stringlen). Instead of 3(N) you are going (N/2). The other two N comes from copying and transfer back, the last N from interation. That is already 6x faster based on this simple experience. And if someone never learns or improve, they will always keep doing old slow habits. Like you say, history keeps repeating itself. The problem with higher languages is that you can't get at the low level to improve performance. For example, if you keep a count inside a 64bit integer inside main memory, and are manipulating things there it can slow up to 10 times compares to keeping the index inside a register inside the CPU itself. With Java and C# its difficult because the virtual machine mostly takes up the whole CPU, then provide a fake CPU that you can't really take advantage of.

Which come back to a good point. Why is ObjectiveC still being used in OSX? It is so slow. Message passing is so slow compared to procedural calls. It is such a problem that in COM they learned to pass by reference via .tlb files rather than pass by value.
 

balamw

Moderator emeritus
Aug 16, 2005
19,366
979
New England
MOD NOTE: Thread has long since left the original topic. Please report this post if you have something to add to that topic.

B
 
Status
Not open for further replies.
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.