C++ and Java Context Switch
Related Blog Items
- Interrupt latency and its causes
- C++ Basics Tutorial - Lesson 3
- Optimizing C and C++ Code
- Implicit Type Conversions
- C++ Basics Tutorial - Lesson 9
The past couple of days, I had been working on a project which requires me to write Java code. OK, I know, this is a C++ blog — this
is my blog after all — but there’s something I’ve picked up a couple of days that I would like to share. I found a few important hints as to
how maybe C++ can get a boost in popularity and usability (or market infiltration). I’ve compiled a short list:
- Libraries!
We need more libraries. Java thrives because of the libraries and frameworks, and packages, and middle-ware, and other things that make it very rich to use. It doesn’t even allow operator overloading, but writing classes day in and day out over and over again is not fun, which is why people actually pay for libraries and packages. - A really cool IDE!
Java has IntelliJ and the Eclipse project which allows developers to write code easily. I believe it’s the age of the short-attention-span-developer (which I admit to being to some extent) where we want instant gratification. I love how ctrl+tab will move to the next word boundary instead of the next space: perhaps before `i’ in `some_idea’ instead of after the `a’. Code folding is great, especially if it’s automatically done for you (and automatic/assisted imports) with a key combination. I’d like to see something better than Microsoft’s Visual C++ IDE (haven’t used others yet, but they are just too expensive for a developer in the Philippines). - Cool marketing conventions! Java
developers have more than one excuse to have their company pay for a convention somewhere because Java convention events happen everywhere! When will we have a C++Con, where we hype things up and have Intel, Microsoft, Adobe, (Google maybe?) and other C++ players where people would actually want to go to? - Teach C++! I’d love to teach high school students how to program in C++ — the same people who would someday want to write their games in C++. Teach the same people who will write the next operating system. Teach the same people who will shape the high performance computing systems and design the next killer application running on the new computer architecture.
These are not very technical issues that we C++ developers can do something about. I’m just personally tired of having to write in a language which I have long never liked because of the restrictions. Java is very rich and the developer community is very lively but I like my multi-paradigm programming because it just works right for my brain.
I learned Java before I even learned C++ — and I’ve never gone back on my preference, because I feel much more productive in C++ than in Java. Yes, demand is high for Java development and our company is filling a niche in the Philippines (high-level Java training and software architecture).
Having said how Java is very successful marketing wise, I guess there are some technical issues that seem to have merit based on the Java design. Here are a few things that other languages have that C++ don’t which might be very interesting to see in the future:
- Portable Bytecode is a very interesting concept. Perhaps we can use a single bytecode compiler from standard C++ code and just "distill" that for the target platform. Nope, I don’t like the idea of the VM/Interpreter, but I like the idea of a common bytecode.
- Standard ABI might be harder to pull off, but if Microsoft starts by implementing a single Application Binary Interface — they’ve already done this with .NET and CLR, but they still have an interpreter/runtime embedded in the OS — then perhaps other operating systems will follow suit. To simplify (which I think is bordering on another anti-trust lawsuit if MS does implement this): "your compiled code should only look like this so that it works with everything else".
- Free Standard C++ Compiler which implements the whole standard and works on all supported platforms and produces a Portable Bytecode and implements the Standard ABI. This is what made Java successful, because in the beginning only one compiler and interpreter was available — which practically gave them complete control over the language. Perhaps if Microsoft implemented a C++ compiler on all imaginable platforms instead of just implementing for their platform, perhaps they’d have a control that Sun
has on the Java language. Maybe the GNU C++ compiler might be a good candidate, but a lot of people (like me) get burnt on non-Linux/Unix platforms with it that it just doesn’t feel right to use them on other platforms aside from Linux/Unix.
Consider this a wish list, but it’s more a suggestion list — or a call to other developers who can do something about it — for the people in position who have the capability to do something about the C++ proliferation and C++ marketing. I feel passionate about this because I feel C++ has so much more to offer as a programming language than just the traditional object oriented C that people get taught and keep hearing about.
I hope someday I can do something about this in a bigger way.
by Dean Michael
This work is licensed under a Creative Commons Attribution-ShareAlike 2.5 License.
Popularity: 4%
You need to log on to convert this article into PDF
Related Blog Items - Interrupt latency and its causes
- C++ Basics Tutorial - Lesson 3
- Optimizing C and C++ Code
- Implicit Type Conversions
- C++ Basics Tutorial - Lesson 9
Related Blog Items
- Interrupt latency and its causes
- C++ Basics Tutorial - Lesson 3
- Optimizing C and C++ Code
- Implicit Type Conversions
- C++ Basics Tutorial - Lesson 9
No Comments
No comments yet.