GIDForums  

Go Back   GIDForums > Computer Programming Forums > Miscellaneous Programming Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 02-Feb-2006, 15:00
agx agx is offline
New Member
 
Join Date: Feb 2006
Posts: 3
agx is on a distinguished road

Scalability in Java and C++


Hi. I'm new here. I'm [a noob,] doing my best to get a good degree. I love programming. I'm not geeky enough though. I actually WANT to be the geek that gets As and that people hate on.

I've been looking for a suitable forum to post this question on.

Right, without turning this into another C++ v Java debate (lol, I almost databate), I would like to know the SCALABILITY of these two. Not the same old "portability, gc" stuff. I have some concrete areas of concern.

I may create a database for a relative (as well as other projects) and want to know the following:
  • Which has the best tools for networked programs?: That is, if I want to run a program on a server, does the choice matter? Maybe not? (C++/Java?)
  • Which connects the best to databases?: If I create an app that databases input, which is the best way to go?
  • Which is likely to handle errors/exceptions better?: I've done a little exception handling in Java. I mean A LIT-TLE.
  • Which creates programs that install easily? i.e. if I install a java program onto a PC, I'm going to need to install the Java SDK and JVM etc, etc, right?
  • Which is easier for creating a fully-functioning, errorfree GUI, with other aspects, such as I/O etc. I've seen a GUI in Java with just a few lines of code. I imagine C++ would need hundreds of lines.
  • Other quality factors: Which produces the most SECURE programs? Which can interact with the most "tools" such as: API's? Which can produce programs that can really be built upon, that have the ability to become huge, powerful programs?
  • What do you find the most practical for your projects? Why wouldn't you use the other?
  • Why is the Java uptake so slow? Is this changing? What is keeping C++ afloat? What's the biggest project Java has been used for?

Thanks!
  #2  
Old 02-Feb-2006, 17:10
Paramesh's Avatar
Paramesh Paramesh is offline
Regular Member
 
Join Date: Sep 2005
Location: The Milky Way
Posts: 923
Paramesh is a jewel in the roughParamesh is a jewel in the roughParamesh is a jewel in the rough

Re: Scalability in Java and C++


Hi agx,

Welcome to the GID Forums.

Hmm. Yet another Java vs C++ debate????

Anyway, i like java kinda person, and I'll try to tell you the truth.
Now, to your questions:

Quote:
Which has the best tools for networked programs?: That is, if I want to run a program on a server, does the choice matter? Maybe not? (C++/Java?)
Well. Java is made for the WEB.

Quote:
Which connects the best to databases?: If I create an app that databases input, which is the best way to go?
Yep. Java again. The JDBC can be used for this purpose, and is far more simpler.

Quote:
Which is likely to handle errors/exceptions better?: I've done a little exception handling in Java. I mean A LIT-TLE.
Hehe. Java Straight away!
Java has excellent Exception handling mechanism, which you'll never ever see in C++.
For example, consider the NullPointerException! What a nice way to inform!!!

Quote:
Which creates programs that install easily? i.e. if I install a java program onto a PC, I'm going to need to install the Java SDK and JVM etc, etc, right?
Your java program runs in any computer what has JVM installed.
Most of the computers will HAVE java because it is widely popular.
In the case of C++, you need to link some static libraries, so you must redistribute it.
But remember! Java is platform independent.

Quote:
Which is easier for creating a fully-functioning, errorfree GUI, with other aspects, such as I/O etc. I've seen a GUI in Java with just a few lines of code. I imagine C++ would need hundreds of lines.
Yes. Java would be easier. A LOT easier.
Because you can port your java class to any platform, and it will look the same way as you saw in others.
Thats why Java GUI is very nice.
But Java uses its own Window drawing functions. So the GUI may be a little slower than C++ created ones.
Infact, Java draws lines to create buttons and other things.

Quote:
Other quality factors: Which produces the most SECURE programs? Which can interact with the most "tools" such as: API's? Which can produce programs that can really be built upon, that have the ability to become huge, powerful programs?
Well. Java is Secure than C++.
But C++ is certainly secure if you can write a code without any security bugs.
I think both C++ and java can interact with many API's (and also with each other. see Common Language Runtime)but I think C++ wins over java in this case.
Huge powerful programs are always written in C++.
Java is used of course, to create powerful projects, but it is used mainly for the web.
Remember? Why java was created?

Quote:
What do you find the most practical for your projects? Why wouldn't you use the other?
I always find Java practical because I find it easier to draw the GUI.
But Everything in java can be done using C++ too!
But wrt. the execution speed, I find C++ is better than Java.

Quote:
Why is the Java uptake so slow? Is this changing? What is keeping C++ afloat? What's the biggest project Java has been used for?
Because Java is Platform independent!!
Your class written in any platform can run in other platforms.
But Java performs various run time checks for the operating system, and other things, so that it takes more time to load.
C++ -> Evergreen. But only standard code is platform independent.I
If you want to have your C++ code as platform independent, you need to perform various checks at the start by yourself.

AFAIK, the biggest Java open source project has been the ECLIPSE project.(Who would like a $40 Million project go for free?)

So, what am i trying to say until now?
Java was made for the Internet.
Java is platform independent.
Java is slightly slower.
Above all, Java is easier!!!!

BTW, Did i answered your scalability question?

Well. I tried to tell you the truth, my friend.
Regards,
Paramesh.
__________________

Don't walk in front of me, I may not follow.
Don't walk behind me, I may not lead.
Just walk beside me and be my friend.
  #3  
Old 02-Feb-2006, 18:11
WaltP's Avatar
WaltP WaltP is offline
Outstanding Member
 
Join Date: Feb 2004
Location: Midwest US
Posts: 3,234
WaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to all

Re: Scalability in Java and C++


Quote:
Originally Posted by Paramesh
So, what am i trying to say until now?
Java was made for the Internet.
Java is platform independent.
Java is slightly slower.
Above all, Java is easier!!!!

You turncoat! How could you?!?!?
__________________

Cow: You're a lawyer too?
Mooseblood (mosquito): Ma'am, I was already a bloodsucking parasite. All I needed was a briefcase!
  #4  
Old 03-Feb-2006, 13:09
agx agx is offline
New Member
 
Join Date: Feb 2006
Posts: 3
agx is on a distinguished road

Re: Scalability in Java and C++


Quote:
Originally Posted by Paramesh
Hi agx,


Because Java is Platform independent!!

Regards,
Paramesh.

Hi Paramesh,

Thanks for your answers. I am know at least leaning toward Java for BIG projects.

I wasn't clear on a few things:

I asked why the Java uptake is so slow. You responded with: "because it is platform independent". That is not answer to the question. I don't think you understood what I meant - by "uptake" I mean: the trend toward using it, it's rise in popularity, etc.

So the question was: "Why aren't as many people using Java as C++?" Could the only reason be to do with its slow speed (bytecode, gc...)?

Another question: I hear a lot about Java's portability, but how do you install a Java app and run it as an .exe? How can you always be sure that a computer will have enough harddisk space to download the JVM?
  #5  
Old 03-Feb-2006, 16:31
Paramesh's Avatar
Paramesh Paramesh is offline
Regular Member
 
Join Date: Sep 2005
Location: The Milky Way
Posts: 923
Paramesh is a jewel in the roughParamesh is a jewel in the roughParamesh is a jewel in the rough

Re: Scalability in Java and C++


Oops! Sorry for my english.

Quote:
Originally Posted by agx
So the question was: "Why aren't as many people using Java as C++?" Could the only reason be to do with its slow speed (bytecode, gc...)?

Maybe true! But people feel comfortable with C/C++ because it is mature, it came before java, and it has proved its success.

Who knows? May be Java can change this thing all round!
In Internet application development, Java has more significance, because it is what Java's main Job. JavaScripts! Really changed the way internet looks like, isnt it?

Quote:
Originally Posted by agx
Another question: I hear a lot about Java's portability, but how do you install a Java app and run it as an .exe? How can you always be sure that a computer will have enough harddisk space to download the JVM?

Ha ha... Nowadays, the hard disk space is about 100 GB normally, and even it people use 4 GB, it doesnt matter.
Web Browsers support java. So, people Should install java because it is used universally!
Ok. lets go to the point: Converting java application into an exe file:
Yes! you can do it.
But using third party applications. Sun does not support that.
Here is an excellent debate about that, and also a solution for your questions:
Java 2 EXE

Regards,
Paramesh.

PS: If you have Visual Studio, just take a look at the .NET framework. Its CLR (Common Language Runtime) Enables the use of different languages in a single project.! But they are not platform independent!
__________________

Don't walk in front of me, I may not follow.
Don't walk behind me, I may not lead.
Just walk beside me and be my friend.
  #6  
Old 03-Feb-2006, 22:38
WaltP's Avatar
WaltP WaltP is offline
Outstanding Member
 
Join Date: Feb 2004
Location: Midwest US
Posts: 3,234
WaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to all

Re: Scalability in Java and C++


Gotta jump in here for a sanity check.

C++ is portable in the EXE form on any machine that runs the appropriate system. It obviously is not cross-system portable but the source should compile on any system with a C++ compiler (as long as you wrote standard C++)
C++ is fast because it runs in native machine code.
C++ is designed to be a general solution tool for general computing projects.

Java is portable only if you have the Java machine/interpreter/whatever-today's-buzzword-is installed on the machine in question.
Java is slower because it is interpreted, not compiled.
Java is designed primarily for web-based applications, but can handle general solutions.

So are major similarities -- and differences.
Just adding a couple cents to the pot...
__________________

Cow: You're a lawyer too?
Mooseblood (mosquito): Ma'am, I was already a bloodsucking parasite. All I needed was a briefcase!
  #7  
Old 04-Feb-2006, 01:12
crystalattice's Avatar
crystalattice crystalattice is offline
Flame War Instigator
 
Join Date: Apr 2004
Location: San Diego
Posts: 1,534
crystalattice is just really nicecrystalattice is just really nicecrystalattice is just really nicecrystalattice is just really nicecrystalattice is just really nice

Re: Scalability in Java and C++


Figured I'll throw some kindling on the fire. Take these with some salt (maybe a few pounds worth) because I'm going more on info I see on O'Reilly blogs and other 'net sites rather than my limited personal programming experience.

As Walt said, Java is interpreted vs. compiled like C/C++. For a good example, try using OpenOffice1.4 (v2.0 is supposed to be faster). The original OOo program relied extensively on Java due to it's x-platform nature. Opening the app, saving files, making graphs, etc. are all unreasonably slow compared to other, native office suites. But one version runs on all OSes that have a Java runtime installed, so theoritically it's easier to program.

On the enterprise, Java is hugely popular. This mostly means that Java is used more for in-house apps of companies rather than stuff you and I would see. There are some "big" Java apps available "off-the-shelf" like Eclipse, OOo, et al. but mostly us little people use it in web apps for things like news tickers. However, O'Reilly is reporting that Ruby on Rails and Python (via TurboGears) are starting to encroach on Java's territory because they are just as powerful, easier to use, and work great for rapid-application development (plus they're open-sourced unlike Java).

As Paramesh noted, Java has a built-in GUI builder but it has to draw everything itself. This was done to guarantee x-platform compatiblity; the programmer wouldn't have to worry if a certain widget is available on all systems. However, there is now a glut of x-platform GUI's available for C/C++ such as qt, gtk, FLTK, wxWindows, etc., not to mention the built-in tools of Visual Studio. All it really means is that when you use C/C++, you have an extra step of drawing the GUI you want and linking the code to it.

Java apps don't have to be installed on a system, unlike C/C++. Since they run under a browser (normally), they will live in RAM until you close out the app. Programs like OOo and Eclipse are stand-alone Java programs but you don't have to make that style if you don't want to; the "default" is for a web app.

Security-wise, Java is technically better since it runs in a "sandbox" which limits the amount of damage a malicious program can do to your computer. Of course, nothing is 100% safe.

Hope this gives you some additional insight.
__________________
Common Sense v2.0-Striving to make the world a little bit smarter.
  #8  
Old 04-Feb-2006, 15:35
agx agx is offline
New Member
 
Join Date: Feb 2006
Posts: 3
agx is on a distinguished road

Re: Scalability in Java and C++


Thanks for all this info guys.

I think for now I will use Java until I feel able to move onto C++. The site that outlines how to convert java files into .jar doesn't make clear what is written in the command line and what is in a file. I assume all the code is run in the command line.

They couldn't have named it better: .jar. The process looks jarring alright.
 
 

Recent GIDBlogToyota - 2008 July Promotion by Nihal

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
My first Java Program (Desperate for Help) Skyer Java Forum 9 14-Nov-2006 15:00
[Java] Eclipse.org's Java IDE JdS Java Forum 5 04-Dec-2005 09:41
Can I use VS.NET to develop java applications? aliok.tr Java Forum 4 07-Nov-2005 17:58
view PDF files using java bryan523 Java Forum 4 25-Oct-2005 03:54
game development with java Ninian Java Forum 1 13-Oct-2005 03:53

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 21:28.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.