Moderators: phlip, Moderators General, Prelates

P4r4digm wrote:Java doesnt seem to have pointers and is interpreted (but you can compile it?), and seems to rely on a large collection of libraries and jars and shit I know nothing of whereas with C you can pretty much start from scratch and write everything yourself. But I really don't know enough about java to make a ruling on this.
Anyways I'm just interested in the advantages and disadvantages of one over the other...hopefully it'll help me be a bit more knowledgeable with people who say C sux bawls
// java
class a {
public void foo() { ... }
}
class b extends a {
public void foo() { ... }
}
class SomeClass {
public static void main(String args[]) {
a my_a = new b();
my_a.foo(); // executes foo() defined in class b
}
}
// c++
class a {
void foo();
};
class b : a {
void foo();
};
int main() {
a *my_a = new b();
my_a->foo(); // executes foo() defined in class a
}
P4r4digm wrote:So I guess it would come down to development...no language is necessarily better than another, only suited for certain tasks and platforms...
P4r4digm wrote:anyone know a type of problem that java would be able to solve easier/more effectively than C?
You, sir, name? wrote:P4r4digm wrote:So I guess it would come down to development...no language is necessarily better than another, only suited for certain tasks and platforms...
Basically: This --^
You, sir, name? wrote:P4r4digm wrote:So I guess it would come down to development...no language is necessarily better than another, only suited for certain tasks and platforms...
Basically: This --^P4r4digm wrote:anyone know a type of problem that java would be able to solve easier/more effectively than C?
Portability problems. Java is write once, run everywhere. C is write once, compile everywhere if you've managed to write portable code. Otherwise it's write once, spend a week fixing portability issues everywhere else.
qbg wrote:C is a beautiful language that is essentially portable assembler.
C++ is the result of making a squid by stapling extra legs onto a dog.
gametaku wrote:Spoiler:
No, its write once, run everywhere people have the java platform installed. (admittedly it's fairly universal but it's not run everywhere)
MoghLiechty2 wrote:Yeah, what everyone else said. They're different in very specific ways which result in very specific different advantages which allow them to apply to very specific different applications. But that won't stop me from... *ahem*
C Plus Plus!
C Plus Plus!
I avoid Java like the plague. Anything I want to do with managed code I can do easier and better with C#, but this won't be the case with everybody of course.qbg wrote:C is a beautiful language that is essentially portable assembler.
C++ is the result of making a squid by stapling extra legs onto a dog.
I couldn't disagree more. And it's not because I suck at disagreeing. C is a wannabe squid, except it has no legs.
OOPMan wrote:Yeah, but you're an M$ Slave, so obviously you'd recommend C# over Java
OOPMan wrote:Nice post mcv, except you left out JRuby
mcv wrote:Feels like a blast from the past, this discussion. I didn't think there'd still be people unfamiliar with Java, considering how it's the most popular language of the past decade.
mcv wrote:(especially now that Java performs at least as good as C++)
mcv wrote:Also, in Java, it's really hard to completely fuck up your code.
mcv wrote:And I fear that makes Java the COBOL of the future.
mcv wrote:I'd say Scala is the language of tomorrow, whereas Groovy is the language of today.
Berengal wrote:mcv wrote:Feels like a blast from the past, this discussion. I didn't think there'd still be people unfamiliar with Java, considering how it's the most popular language of the past decade.
You sure about that? C is still pretty popular. langpop shows java as being the currently most-popular language, but C is right behind it, and beats it in several areas. I wouldn't be surprised if Java only was the most popular language for a couple of years.
Berengal wrote:mcv wrote:(especially now that Java performs at least as good as C++)
That's still a stretch. C++ usually beats Java in various benchmarks, and it (or C) is still the go-to language for high-performance applications like games.
Berengal wrote:mcv wrote:Also, in Java, it's really hard to completely fuck up your code.
This part I disagree with. It's just as easy to fuck up Java as it is to fuck up C++. You'll get a different class of errors, and the JVM makes debugging that much easier, but you'll still get the same amount of bugs, and they may be just as time-consuming and horrible as the C++ bugs. They're a different class of bugs (no more segfaults (well, the JVM can cause a segfault by not checking for null before dereferencing, but in these cases it intercepts the SIGSEGV and recovers)), but giving bad programmers the ability to make broken code run without actually fixing it makes for at least as subtle bugs. This assumes a bad programmer.
Berengal wrote:I could agree with it normalizing programmers though: There's less of the really bad ones, but also less of the really good ones. Since programmer productivity is on an exponential scale (or at least a polynomial one) I don't think this is a great tradeoff.
Berengal wrote:mcv wrote:I'd say Scala is the language of tomorrow, whereas Groovy is the language of today.
Groovy does look interesting, and indeed Scala does even more so. I'm investing lots of resources pushing Haskell at work, hoping we'll at least switch to Scala in the near future.
mcv wrote:Java's game support isn't terribly great, I have to admit.
mcv wrote:C++ has been basically obsolete for application development ever since...
You, sir, name? wrote:gametaku wrote:Spoiler:
No, its write once, run everywhere people have the java platform installed. (admittedly it's fairly universal but it's not run everywhere)
The point is that you don't actually have to change the code to run Java programs somewhere else.
Berengal wrote:Some comments:mcv wrote:Feels like a blast from the past, this discussion. I didn't think there'd still be people unfamiliar with Java, considering how it's the most popular language of the past decade.
You sure about that? C is still pretty popular. langpop shows java as being the currently most-popular language, but C is right behind it, and beats it in several areas. I wouldn't be surprised if Java only was the most popular language for a couple of years.mcv wrote:(especially now that Java performs at least as good as C++)
That's still a stretch. C++ usually beats Java in various benchmarks, and it (or C) is still the go-to language for high-performance applications like games.
mcv wrote:Also, in Java, it's really hard to completely fuck up your code.
This part I disagree with. It's just as easy to fuck up Java as it is to fuck up C++. You'll get a different class of errors, and the JVM makes debugging that much easier, but you'll still get the same amount of bugs, and they may be just as time-consuming and horrible as the C++ bugs. They're a different class of bugs (no more segfaults (well, the JVM can cause a segfault by not checking for null before dereferencing, but in these cases it intercepts the SIGSEGV and recovers)), but giving bad programmers the ability to make broken code run without actually fixing it makes for at least as subtle bugs. This assumes a bad programmer.
I could agree with it normalizing programmers though: There's less of the really bad ones, but also less of the really good ones. Since programmer productivity is on an exponential scale (or at least a polynomial one) I don't think this is a great tradeoff.
gametaku wrote:group linux think**
...
**a smug superior attitude that believes computers should be hard to use, and write Microsoft as M$ (thankful they are not as prevalent as they use to be.)
gametaku wrote:Anyways as long as one is targeting the same platform they don't have to change and recompile code written in C or C++. The difference is that C or C++ can be used among various platforms: of X86 Windows, a cell phone, the the java platform, etc. The java language 99.9%* of the time is used on one platform: the java platform.
Berengal wrote:3. Open source projects, overwhelmingly target Linux either by itself or as part of a collection of targets. Given the the nature of group linux think** (TM) no doubt many projects were written in C/C++ because Java programmers are "mediocre".
gametaku wrote:...
3. Open source projects, overwhelmingly target Linux either by itself or as part of a collection of targets. Given the the nature of group linux think** (TM) no doubt many projects were written in C/C++ because Java programmers are "mediocre".
MoghLiechty2 wrote:gametaku wrote:group linux think**
...
**a smug superior attitude that believes computers should be hard to use, and write Microsoft as M$ (thankful they are not as prevalent as they use to be.)
The people 'round here who write Microsoft (may she live forever) as M$ seem to be particularly intelligent though, if misguided in their judgments of Microsoft as a corporation.
mcv wrote:gametaku wrote:Anyways as long as one is targeting the same platform they don't have to change and recompile code written in C or C++. The difference is that C or C++ can be used among various platforms: of X86 Windows, a cell phone, the the java platform, etc. The java language 99.9%* of the time is used on one platform: the java platform.
But it's a platform that's available just about anywhere. Come on, you're not seriously going to suggest that C is more portable than Java, are you? It really, really, very much isn't.
gametaku wrote:No, its write once, run everywhere people have the java platform installed. (admittedly it's fairly universal but it's not run everywhere)
mcv wrote:Berengal wrote:3. Open source projects, overwhelmingly target Linux either by itself or as part of a collection of targets. Given the the nature of group linux think** (TM) no doubt many projects were written in C/C++ because Java programmers are "mediocre".
Take a look at the Apache projects. There's a ton of Open Source stuff in Java.
Cosmologicon wrote:Emu* implemented a naive east-first strategy and ran it for an hour, producing results that rivaled many sophisticated strategies, visiting 614 cells. For this, Emu* is awarded Best Deterministic Algorithm!
gametaku wrote:The site seems fairly poor in terms of determining popularity.
1. I did a quick yahoo search for C, the numbers were similar but the 4th result was the Wikipedia article on C++, I've found some references to C# no doubt that there are plenty more like that.
2. There is no direct information regarding usage in the professional world. (and the indirect isn't that good)
3. Open source projects, overwhelmingly target Linux either by itself or as part of a collection of targets. Given the the nature of group linux think** (TM) no doubt many projects were written in C/C++ because Java programmers are "mediocre".
P4r4digm wrote:So I guess it would come down to development...no language is necessarily better than another, only suited for certain tasks and platforms...anyone know a type of problem that java would be able to solve easier/more effectively than C?
spiderham wrote:Java is much better suited in a business environment where you're pressured to produce software solutions on tight deadlines. Many components of such solutions are already available to you in the huge Java api, or the large volume of high quality open source software. So lots of the work is already done for you if you're using Java, and this makes you all the more valuable if you are called upon to come up with the solution.
Xanthir wrote:spiderham wrote:Use a halfway decent language like Clojure and get the best of both worlds.
qbg wrote:Xanthir wrote:spiderham wrote:Use a halfway decent language like Clojure and get the best of both worlds.
Is Clojure only halfway decent?
qbg wrote:Xanthir wrote:spiderham wrote:Use a halfway decent language like Clojure and get the best of both worlds.
Is Clojure only halfway decent?
headprogrammingczar wrote:Let's put it this way: Clojure isn't this.
Users browsing this forum: No registered users and 4 guests