For everyone who wants to answer

I'm a C++ programmer about 2 years. My question is not about to solve a specific trouble. I'm being scared with the crescent growing of languages like C# and Java. What I would like to know of anyone is the following: These languages will definitely substitute C++? In any kind of market. I've readed some news that game industry are thiking to adopt a unique hardware(something like a setupbox) and develop games to it. The programming language I think, will occur the same. If this hardware have an virtual machine inside it, java and C# are natural choices to develop games.
so, what do you think about that?
[630 byte] By [C#er] at [2007-11-20 11:47:38]
# 1 Re: For everyone who wants to answer
There's more than a few threads with this general topic (any thread you find my name and C# will at least touch the subject, for example).

I've been a developer for over 25 years, in C++ since it was available, C before then (and other languages).

There are people who will tell you emphatically that Java is the best language ever devised, and using anything else is a waste of time an effort.

There are others who say the same or similar about C#.

The have the advantage (or feature, depending on your viewpoint) of shielding the developer from pointers and memory related bugs, and they're generally 'pure' in design. C++ is layered on top of C, which gives it a more complex and difficult set of constructs which give rise to pitfalls if you're not aware of them. On this point, the proponents of C# and Java are correct. I believe a C++ programmer should experiment with either or both of those languages, because it does give one appreciation for the protective effect, and turns one into a better C++ developer.

Smart pointers go a long way toward shielding the developer from pointer and memory related bugs. Loosing all of the older C style development tactics helps even further. The C# and Java developers don't even have the temptation to employ methods known to create problems.

For a few years Java was supposed to undo Windows (at least that was part of the hype). Compare the known ambitious applications you know that are written in C++ vs Java, and something appears to not have worked out in Java's favor (largely performance issues, sometime UI issues).

C# delivers where Java couldn't. You can create a 'native' Windows application, with good performance and full access to the underlying machine. Still, there are 'things' you can do in C++ you can't do in C#.

C# means .NET. .NET is Microsoft's strategy to make Microsoft centrally important while attempting to deliver applications over the web, on the desktop, on the web page, web enabled, database aware, graphically savvy, media savvy, etc.

Performance isn't that great. It's good, much better than Java, and many will shout that it's just as fast, but it's not 'just' as fast. Technically, it's impossible for it to match the speed of a native 'unmanaged' application. It can certainly be plenty fast enough for an entire class of applications.

In one area of my work I discover entire offices stuffed full of a wide range of computers. There are still AMD K6-2 machines, with 128Mbytes of RAM, at 233 Mhz, a 1Mbyte video card and an 'upgraded' 6 Gbyte hard drive (because the original 1Gbyte crashed years ago).

It's probably running Windows 98, too.

You simply can't use that for half of the C# applications you might deploy, yet that very hardware was once used as CAD workstations (years ago). What gives?

If you survey the most ambitious applications on the market, most are developed in C++ (in the last several years). If you look at most of the business applications (which I don't regard as ambitious, as in AutoCAD, Excel, 3DStudio Max, Photoshop, etc), they are NOT made in C++. Many are made in Java, C#, Visual Basic, perhaps Delphi - and a host of other languages.

If you run a 'shop' that churns out code on contract, you need to be quick and effective. Hassles are a profit sponge. C++ just doesn't fit that domain.

If ADOBE had written Photoshop in Java, they'd not be able to compete with another company once a C++ version was released.

Now, as a programmer, you have to consider carefully what's your next move. C++ isn't something you can 'just write code' in. You have to be very competent, or you will be kicked out of the team. 2 years isn't bad, but let me be frank. I'd hire someone for a C# or Java programming task with 1 or 2 years, and I'd get them cheap that way. I would NOT put anyone on a team of C++ engineers, working on something significant, unless they had at least 5 impressive years, or 10. It's a catch 22, too. How can you get that experience if you can't get a job? Frankly, I don't know the answer to that one. You just have to find someplace that wants a junior, for cheap.

On the other hand, C# jobs are probably going to rise in quantity. I personally wouldn't find that work interesting, but then I've got the experience to be choosy. There was a day, years ago, when I couldn't be.

Think of C++ as serious engineering, C# and Java as 'programming'. Anyone with patience and a sense of logic and learn to be effective in safe programming languages, but if you're addressing the kind of applications for which C++ is appropriate, you're going to be expected to have much deeper knowledge of more than just C++.

As such, C++ will always be there. It is not going away; it's place in the paradigm is quite secure. Your place is what you're really asking about, and that means you have to ask what stuff you're made of, and where you're taking it.

Are you doing to design database applications, or design database engines? Develop web pages, or create web servers?

That's the kind of thing you're really asking about.
JVene at 2007-11-9 1:26:08 >
# 2 Re: For everyone who wants to answer
I've readed some news that game industry are thiking to adopt a unique hardware(something like a setupbox) and develop games to it. The programming language I think, will occur the same. If this hardware have an virtual machine inside it, java and C# are natural choices to develop games.
so, what do you think about that?
I don't know much about Java, but C# compiles to a sort of 'binary pseudo code' which is designed to be just-in-time compiled into actual machine code. The potential for optimising an application, long after it has been shipped, for a given hardware platform is quite large. At the same time, there needs to be a program which does that just-in-time compilation !
I think there will be an increasing trend towards managed environments, but there will always be some need for low level programming languages.
Zaccheus at 2007-11-9 1:27:08 >
# 3 Re: For everyone who wants to answer
The potential for optimising an application, long after it has been shipped, for a given hardware platform is quite large

This was also an argument presented by early Java adopters, but it doesn't seem to pan out well.

Potential is a key word here. That doesn't usually translate well into actual results, and by the time any significant optimization could occur, the version of the original application has probably been updated.

Optimization may involve the expression of the language itself, too. In C++, for example, the sort from STL has the ability to result in faster code execution than the C oriented qsort. This is because the way in which the concept of the sorting comparison is expressed at the source level.

In C, the comparison is expressed with a pointer to a function call, and so all comparisons invoke a call to that function.

In C++, the comparison is expressed as a template parameter, giving the compiler more information with which to decided how to apply optimization. In many cases, sorting is performed on a primitive type, like an integer, which resolves to an inline output from the compiler in the template version. Much better optimization.

My point is, that optimization can't rely on pseudo compiled code for significant advantage. That requires a superior expressive capability in the language itself. This is one area where C++ has options that give better expression of an idea, though it does require advanced techniques.

Any potential for optimization that appears for a runtime engine, like .NET, can also appear as an optimization for C++. The point you're presenting is that a .NET doesn't require a rebuild, and my counter point is that such an arrangement defeats much of what the compiler could use from the source to 'comprehend' the nature of optimization. Most applications are updated frequently enough that the notion of benefit from an 'automatic' optimization after release (as opposed to recompilation) is, I submit, both speculative and of questionable value.

C# performance is on par with any development tool that shares that design foundation (runtime engine, no pointers, etc). The language itself could be addressed to genuine native compilation, as could Java, given an appropriate runtime basis, but that still wouldn't match what CAN happen with superior expressive features in something like advanced C++ templates.

Then, of course, there's a matter of whether that factors into advantage.
JVene at 2007-11-9 1:28:10 >
# 4 Re: For everyone who wants to answer
An immediate example is that pure .net 2 applications run in 64 bit mode on Windows 64.

I think a problem Java is that the Java byte code was designed to be interpreted. The .net byte code was designed, from the start, for just-in-time compilation.

One thing that will always make a .net application slower is the managed aspect of the framework, for example all pointer and array accesses are checked. It should be possible to compile many C++ applications into a byte code which can be just-in-time compiled without the managed aspect being present.

Frankly, I also think that the lack of benefit is because there is not a huge range of machine architectures which are supported by the .net framework.
Zaccheus at 2007-11-9 1:29:15 >