vinith_04
Feb 9 2006, 02:17 AM
Hi
I just wanted to know the differences between Java and C programming.
Please help me regarding this.
It would be a great favour.
Vinith
groovicus
Feb 9 2006, 10:07 PM
For starters. C is a compiled language, Java is an interpreted language. C is horrible and nasty, and thus way more powerful. (It's not really horrible or nasty). Java handles much of the houskeeping automatically. Java is object oriented, C isn't.. well, it is, but it isn't....
Heretic Monkey
Feb 10 2006, 12:39 AM
Lol, simple comparison groovicus.
One of the big things that attracted me to Java was the idea of cross-platform compatibility. I'm taking a beginners course in Java programming at NCSU. Since java runs on a virtual machine through the terminal, it can be run on almost every operating system with very little effort.
The way i've been told, Java isn't THAT much different from C, but groovicus is right. C is a heck of a lot more powerful, but also more complicated.
acklan
Feb 10 2006, 09:44 PM
Swandog46
Feb 13 2006, 12:14 AM
QUOTE
C is horrible and nasty
Respectfully differ!
I like C very much, and if you master C, you can do literally anything. Plus, most of the features anyone likes in Java are out there as extensions to C in C++ as well. And if you're trying to do scripting, you shouldn't be using Java or C anyway.
tsg1zzn
Feb 13 2006, 06:08 AM
If Java's garbage collector worked properly there would be no Java programs left on this planet.
Seriously, Java is well suited for two things, and that's server-side programming and useless web applets. It is not suited for normal GUI applications or games.
Why not GUI applications? Because Java doesn't use an os-native GUI. And if it did, it wouldn't be quite as cross-platform as advertized any more.
Also, it has a tendency to "run fast after the first time". The first time you do something it's rather slow, but the next time it's just as fast as C was all the time. When it comes to server-side programming this does not matter much because if a java program serves one million visitors it will only be slow the first time. However, if this was a GUI app, how often do you change a preference option a million times straight after each other? Almost always, if you change a preference, insert a table or whatever you do, you do it once and you're done with it. And then it doesn't matter if it's just as fast as C all the 9999999 times you DIDN'T click that button.
Craigory
Feb 18 2006, 02:28 PM
@tsg1zzn, I've always noticed that when compiling/running new java applications after a while of not using java.
C, I'm sure, doesn't require error handling.
Java forces you to use error handling (try - catch), really, it does, because if you don't use it the compiler will bi*** at you.
-David-
Feb 18 2006, 02:41 PM
groovicus
Feb 18 2006, 03:01 PM
QUOTE
Why not GUI applications? Because Java doesn't use an os-native GUI. And if it did, it wouldn't be quite as cross-platform as advertized any more.
I'm not sure I follow that logic. It doesn't use os-native GUI, because if it did, it wouldn't be cross platform... huh? ... none of Java is OS specific, that's the point.
Would you maybe care to elucidate the point at which you were grasping, because at this point you have two thirds of the argument.
BTW, the java GUI works just fine.. it looks a bit different from system to system, but so what? My clients are very happy with it... it is much less painless than trying to put together a C++ GUI ... Oh yeah, you can't....C++ has no integrated GUI library.. you have to use the Win32 API (not cross platform), and I have no idea what one would use for a 'nix platform.
C GUI's are built on what?? Does C have an integrated GUI library? The Win32 API.. again, not cross platform.
Maybe you can help me out here.
Swandog46
Feb 18 2006, 03:40 PM
The argument is that BECAUSE Java is cross-platform, it cannot be compiled to entirely platform-native assembly code. That step has to take place at run-time, rather than compile-time like in a language like C. That makes Java inherently slower, at least the first time a program is run, for it to be internally compiled/assembled.
I've never tried to write a cross-platform GUI, so I've never needed Java's portability in that regard --- but in that case groovicus, you would certainly have a good point.
Kruncher
Feb 18 2006, 04:13 PM
Alot of people say C is hard to learn. I have no clue what they're talking about. I started with C (even before I touched such things as: HTML or Javascript). C is powerful and easy (in my opinion) to use. C (becaused its compiled) can create such great things as the Linux kernel, and platform independent programs.
groovicus
Feb 18 2006, 04:33 PM
I don't mean to start a which os is best thread. So as long as we keep that in mind, I'll leave the thread open.
I am just trying to understand the argument as stated, because at teh time, it didn't seem to be complete. In the context swandog stated, it sort of makes sense... I think.. I'm still not sure.
What does one use for GUI libraries for C then? Are they cross platform, or platform specific. I imagine that since C++ uses the Win32API, then so does C.
??
Kruncher
Feb 18 2006, 08:29 PM
The best cross-platform GUI IMHO is GTK+. GTK+ is C in nature, but it has bindings in many languages (python, C++, etc.). There is also wxWidgets, QT and other lesser known ones. GTK+ is what alot of the windows managers in Linux are programed in (Gnome, XFCE, etc). QT is what KDE is programed in (another Linux window manager). I have personally never touched wxWidgets but I hear it is similar to MFC in windows.
Swandog46
Feb 19 2006, 10:57 AM
GUI libraries for C are platform-specific. The only guaranteed platform-independent portion of C is the actual ANSI standard and the base language. All extensions to it (including, technically, the entire standard library) are NOT technically part of C itself. So all the GUI libraries are platform dependent, implemented by platform vendors (i.e. the Windows API).
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please
click here.