This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Quick Qeustion Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Quick Qeustion" Watch "Quick Qeustion" New topic

Quick Qeustion

Pat Flickner
Ranch Hand

Joined: Nov 17, 2003
Posts: 173
This isn't exactly a Java question, but the Head Guy 'round her may know:

Someone commented to me that C was much lighter than Java. I'm trying to figure out why, but I suspect that he's used only the awt gui components. And he's using an interface for compiling. I pointed out that if he were to compile at the command prompt, he'd see something far different than what he saw using what his school provided.

I don't mean to start a huge controversy. That isn't my intention. I'd just like some info to be certain because if he speaks this in the right ear, they may start asking why we're using java instead and I want to be able to have some real facts behind me.

Dmitry Melnik
Ranch Hand

Joined: Dec 18, 2003
Posts: 328
Someone commented to me that C was much lighter than Java. I'm trying to figure out why, but I suspect

Is there anything which stops you from asking that person a couple of questions? Like: How do you know if C is lighter than Java? In which way, you think, C is lighter than Java? What do you mean by "lighter"?

Not having such answers, we can keep guessing forever about which kind of "lightness" is important for your project, and which tool gives more of it...
Ernest Friedman-Hill
author and iconoclast

Joined: Jul 08, 2003
Posts: 24183

In many meaningful senses, C is "lighter" than Java. C is, after all, really just thinly disguised assembly language. Although every platform has a C runtime library, simple programs don't actually even need to link with it, so a meaningful C program can be no more than a few bytes of code, and use only a few bytes of core. In contrast, even the smallest Java program has to run on a JVM, which is generally a quite large program, and which needs a multi-megabyte heap just to print "Hello, World."

Now, "lightness" is now a criterion that Java has ever tried to compete on, and frankly, it's not something that most folks really need to worry about. Once you get up to realistic-sized programs, any differences in heap and code size tend to even out. If you just need to write a tiny program, Java was never intended to be the best choice. But if you're running a bigger project and things like maintainability, debuggability, scaleability (and all the other "ilities" ) matter, then Java is a clear winner.

[Jess in Action][AskingGoodQuestions]
Pat Flickner
Ranch Hand

Joined: Nov 17, 2003
Posts: 173
Thanks! I was close, but not like that. Now I can have a clear, clean argument the next time I hear how light C is.

I agree. Here's the link:
subject: Quick Qeustion
Similar Threads
Career Direction
Arrogant programmers and economic climate
Only fun forwards for fun ...
NX: Using SwingUtilties.InvokeAndWait method in GUI
OOP considered harmful (was: C. Date on UML book)