If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.
![]() |
|
|
#1 |
|
Retarded moron
|
This may be silly, but what current advantages does JAVA have over C++?
What is in talks is that next year (where I get my diploma in software development) JAVA may take over C++. I'm completely against is as C++ is an industry standard and it's the best language to learn. Not only thay but C++ is faster as it doesn't need to have a Virtual Machine loaded into memory to be able to convert the code into binary. So what are the advantages/disadvantages of C++ over JAVA and vice versa?
__________________
I eat coffee. |
|
|
|
|
|
#2 |
|
Senior Member
|
Java is a cleaner language -- part of this came from removing certain features.
C++ allows multi-paradigm while Java basically allows OO and structured/data abstraction. Java docs and the API. It's just plain better documented and that's a big plus. There is more to it, but I read a study not too long ago comparing many languages -- and I found it to be the case in my experience, unless I use IntelliJ, which is the best IDE EVAR -- that showed that Java doesn't offer much over C++ in terms of time to produce, bugs, etc... You could call Java, C--.
__________________
Regards. |
|
|
|
|
|
#3 |
|
Passenger on Serenity
Join Date: Jul 2002
Location: Object in Space
Posts: 1,891
|
im voting for c++.
I cant stand java. Biggest reason: Sun. They have not release java's development to an open body as they said they would a long time ago. later, epic
__________________
"everyone is entitled to his own opinion, but not his own facts" |
|
|
|
|
|
#4 | |
|
Junior Member
Join Date: Aug 2003
Posts: 10
|
Quote:
C++ benefits over Java
|
|
|
|
|
|
|
#5 |
|
Retarded moron
|
Thanks.
If JAVA were to be used to create Doom 3, what potential problems will it have?
__________________
I eat coffee. |
|
|
|
|
|
#6 | |
|
Member
Join Date: Jan 2003
Posts: 564
|
Quote:
__________________
"I would like to thank Dave H for posting his thoughts, it means so much more coming from him than it would from me." --Kyle Bennett |
|
|
|
|
|
|
#7 | |
|
Member
Join Date: Jan 2003
Posts: 564
|
Quote:
Applications that don't use pointer arithmetic in clever ways to extract extra performance (e.g. sorting an array in place as opposed to sorting to a new location) are generally faster in garbage collected environments, although they have a larger memory footprint. Oh, and framerates would likely stutter significantly, because with garbage collection you incur your memory management all at once (at collection time) instead of spread out throughout your run. On the other hand, if Java were used to create Windows, Unix, Internet Explorer, IIS, etc., they wouldn't have any buffer overflows, and thus they would avoid probably 95% of their security problems. Basically, garbage collected runtime environments are unsuitable for anything that requires direct memory management (device drivers and low-level OS functions), for any real-time applications (games would fall into this category), or for anything where memory footprint is at a premium (most embedded stuff). And, if you're smart and your performance bottleneck is in a small piece of code that happens to be amenable to algorithmic tricks enabled by direct memory management, you're better off with an unsafe language. Safe languages are better for just about everything else, which is why Java is already taking over from C++ and C# will take much of what's left over.
__________________
"I would like to thank Dave H for posting his thoughts, it means so much more coming from him than it would from me." --Kyle Bennett |
|
|
|
|
|
|
#8 |
|
Senior Member
|
The report is a pdf called jccpprt_computer2000.pdf
The problem is that the site isn't responding, but punch that into google and you'll get many links to it. Good luck trying to get it when the site is actually up and if you do get it, save a copy.
__________________
Regards. |
|
|
|
|
|
#9 |
|
Junior Member
Join Date: Aug 2003
Posts: 10
|
I'm personally wondering what's going to happen to Java when Sun's proprietary hardware and OS revenue base widdles away to nothing. Many would argue that Linux is the logical choice over Solaris going forward, and it's hard to justify the cost/performance ratio of UltraSparcs when there are at least three 64 bit CPUs which outperform them (IBM, HP, AMD). If their proprietary HW/SW marketshare continues to decline, then where are they going to make their money? They will have no choice but to try and start making money from Java. Until now, they'e made money from Java by capitalizing on Java as a means of doing Enterprise Software and other server software. The revenue was derived from selling hardware that could run the software.
They will need to find a more direct means of extracting revenue from Java, which won't be easy; especially when you have the IBMs of the world (and a handful of others) with their own independent Java compilers. Perhaps the answer lies in the "free" class libraries. Funny, because in my opinion, it's the large amount of software you get for "free" that comes with a Java SDK installation that makes it attractive. |
|
|
|
|
|
#10 | ||
|
Junior Member
Join Date: Aug 2003
Posts: 10
|
Quote:
Code:
int foo( char *incomingBuffer, size_t length )
{
int rc=-1;
char tempBuffer[1000];
try
{
if( !incomingBuffer || !*incomingBuffer )
{
throw "Invalid parameter passed into foo";
}
memset( tempBuffer, 0, sizeof( tempBuffer ) );
strncpy( tempBuffer, incomingBuffer, length < sizeof( tempBuffer - 1 ) ? length : sizeof( tempBuffer ) - 1 );
// Do your thing here
rc=0; //success if no exceptions thrown
}
catch( const char *errorString )
{
log( errorString );
}
catch( ... )
{
log( "Unknown exception caught in foo" );
}
return rc;
}
Code:
tempBuffer Code:
incomingbuffer Code:
const std::string & I'll never forget one time when my company had to interface with a very large software company's product that used MSVC 5.0 (the latest VC compiler at that time). This other company had relied extensively on MFC's Http classes, which at the time were sending an extra cr beyond the message length of their messages. My code was hanging at the time because I'd read the message length and stop, but there was more code in the input stream which would screw up the next reads. I was very adamant about following RFC standards and not playing it "fast and loose". Alas, I lost the battle, because it was the almighty Microsoft which wasn't doing things right to begin with, and since so many people used Microsoft Software at the time, and we were the little guys trying to sell a product, we ended up conforming. I wish I could go back to those same people now and say: "See? THIS is why playing fast and loose with buffers is a bad idea." Quote:
|
||
|
|
|
|
|
#11 | ||
|
...
Join Date: Feb 2002
Location: Cleveland
Posts: 4,294
|
Quote:
Quote:
As for the memory collection, there are many different implementations/settings in the JVM provided by Sun. One of them sets the JVM up for incremental garbage collection as to avoid the all-at-once and another can limit the cpu-% that is used by it. Java has come a long way. With the proper optimizations and JVM (even without direct compilation to native code) it can be as fast as C++ code in most situations.
__________________
IBSL: 2835, 6541, 8531, 9299, 20484, 86985, 87130 FBSL: 7221, 9255, 15892, 20484 |
||
|
|
|
|
|
#12 |
|
Retarded moron
|
Is this supposed to be funny?
http://members.optusnet.com.au/ksaho...avaProgram.jpg 73Kb pic, I circled the strange area. The program itself is 56MB in memory so I assume that the couple of line command prompt program is using over 20MB RAM. I'd hate to see a massive program run. I bet my 768MB will run out faster than a lion on steriods.
__________________
I eat coffee. |
|
|
|
|
|
#13 |
|
Junior Member
Join Date: Aug 2003
Posts: 10
|
How much of that memory is the IDE? What happens if you run it from the command line, and print out the memory from there?
|
|
|
|
|
|
#14 |
|
Member
Join Date: Feb 2002
Posts: 457
|
One issue that seems like it has never been addressed by Borland (though it could very well be a Sun issue), as it relates to IDE's, is memory management in JBuilder.
I've been developing 100% in C# for the past 15 months or so, but did Java for the previous 2 years. It used to really drive me nuts when I would have to kill JBuilder because the memory usage would climb up to 500+ MB's afer an extended period of time. This is an issue that has been endlessly talked about on Borland's own NNTP services, and none of the workaround ever seemed to help. In terms of the topic at hand, the one thing that's very clear (at least to me) in comparing C++ to the like of Java/C# is the speed with which one can develop extremely compelling solutions. With Java/C#, the languages provide a heck of a lot of mechanisms to get the job done in a significantly faster period of time than C++. There are simply fewer "things" you need to concern yourself with once you get to the testing/debug/QA timeframe. Of course, if you've been developing in C++ for a long time, you're clearly less likely to make as many mistakes...but let's not kid ourselves either: nobody, regardless of experience, is immune to making stupid mistakes The other thing to think about has more to do with the IDE platform than anything else. With .NET Studio 2003, for example, there are just a ton of tools that simply make doing "things" a breeze. As an example, I'm in the process of developing a module with our software that requires XML schema definition which can then be used to create typed DataSets for use by ADO.NET objects. All the user interface Controls are 100% mapped/binded to the DataSet. In effect, I have killed multiple stones in 1 pass. There is no logic necessary to tie any of the UI to the database...no custom collections needed to store tables...Once you understand how to use ADO.NET, it can save a ton of time. Plus, it makes visualizing the given database extremely easy by way of the Schema designer... |
|
|
|
|
|
#15 |
|
...
Join Date: Feb 2002
Location: Cleveland
Posts: 4,294
|
I imagine nearly most of that is due to the IDE.
There are settings you can use for the JVM to set minimum/maximum usage for memory and stack heaps. I believe the default values are 64Meg. I have several Java components running in realtime production environments that make use of JMS/JDBC/JavaMail/XML/LDAP/Log4J. Measuring the memory used by the program itself the low watermark is 1830K, high watermark is 4362K when all threads are busy processing, once processing is complete it returns to the low watermark.
__________________
IBSL: 2835, 6541, 8531, 9299, 20484, 86985, 87130 FBSL: 7221, 9255, 15892, 20484 |
|
|
|
|
|
#16 | |
|
Junior Member
Join Date: Aug 2003
Posts: 10
|
Quote:
Now after spending months writing my email client in C++ Builder, I'm seriously considering switching to C#/Windows Forms. |
|
|
|
|
|
|
#17 |
|
...
Join Date: Feb 2002
Location: Cleveland
Posts: 4,294
|
I suppose some might consider me a stubborn old nut, but I still don't care for any of the IDEs out there. When I'm coding Java/C++/C/Scripts I still prefer to use GNU Emacs, Bash (Cygwin for WinOS), and ANT/GNU Make. Old habbits die hard...
__________________
IBSL: 2835, 6541, 8531, 9299, 20484, 86985, 87130 FBSL: 7221, 9255, 15892, 20484 |
|
|
|
|
|
#18 |
|
Senior Member
|
Have you used IntelliJ?
I know folks who still like the old stripped down emac/vi style of doing things. After they used IntelliJ, they haven't looked back. I have yet to encounter an IDE that is that intuitive. When comparing it to say Sun One, which might give you an error "this is wrong". IntelliJ would say "heh, this isn't quite right. Want me to fix that for you?"
__________________
Regards. |
|
|
|
|
|
#19 |
|
...
Join Date: Feb 2002
Location: Cleveland
Posts: 4,294
|
Can't say that I have tried it, IntelliJ. My first concern is the obscene price. It looks to have some nice features. But the likely most used features I already have covered with ANT by using PMD/CheckStyle/CleanImport antlets in addition to the JDEE plugin for Emacs.
__________________
IBSL: 2835, 6541, 8531, 9299, 20484, 86985, 87130 FBSL: 7221, 9255, 15892, 20484 |
|
|
|
|
|
#20 |
|
Senior Member
|
Give the free trial a shot.
__________________
Regards. |
|
|
|
|
|
#21 |
|
Retarded moron
|
I'm using intellij and I'm finding out that it does things I don't want it to do.
__________________
I eat coffee. |
|
|
|
|
|
#22 |
|
Senior Member
|
__________________
Regards. |
|
|
|
|
|
#23 | |
|
Member
Join Date: Feb 2002
Location: Vienna, Austria
Posts: 582
|
Quote:
But at last, JBuilder 9 seems to have finally gotten much better in this respect. I wouldn't say it's gone for good, but I only had such a memory leak once in the last three months, usually it stays at ~100MB after some time. |
|
|
|
|
|
|
#24 | |
|
Retarded moron
|
Thanks.
Quote:
__________________
I eat coffee. |
|
|
|
|
|
|
#25 |
|
Senior Member
Join Date: May 1978
Posts: 3,263
|
In all fairness, I should note that .NET Studio 2003 has a tendency to suck up a good chunk of memory as well.
But in terms of overall performance, Microsoft's IDE is significantly more "snappy" than any/all JBuilder IDE's, including JBuilder 9. I really wish it were possible to have a "Developer Studio" esque IDE for Java. I know some people think that everything that is Microsoft totally sucks, but I happen to think they have a clue in how/what an IDE should do/be, and how to develop the things with performance in mind. |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Java 3D 1.3...pros cons for a beginner... | suryad | 3D Technology & Algorithms | 5 | 07-Mar-2005 20:25 |
| CELL and JAVA | version | Console Technology | 1 | 28-Feb-2005 13:20 |
| I'm going to share something serious with you folks | K.I.L.E.R | Hardware & Software Talk | 6 | 23-Feb-2005 05:36 |
| Java -> Games! | Deepak | Console Technology | 1 | 06-Jun-2003 16:08 |
| Some interesting Java visualization software | Saem | Beyond3D News | 6 | 07-May-2002 21:07 |