Allegro.cc - Online Community

Allegro.cc Forums » Off-Topic Ordeals » Which language is best?

This thread is locked; no one can reply to it. rss feed Print
Which language is best?
James Stanley
Member #7,275
May 2006
avatar

I just read an article on Slashdot about Compiled vs. Interpreted/JIT Compiled languages. It seems to suggest that Interpreted/JIT Compiled languages (mainly Java) run faster when written properly and are easier to port or don't need any porting.
1.) Is Java any easier than C++?
I was just wondering because if so that would significantly improve my development time because I have to compile for MacOS, Linux, Windows, DOS, etc. and on every platform I have to change stuff.
2.) What would be the disadvantages of using an Interpreted/JIT language?

miran
Member #2,407
June 2002

Quote:

1.) Is Java any easier than C++?

No. It's the same.

Quote:

2.) What would be the disadvantages of using an Interpreted/JIT language?

You need an interpreter/virtual machine to run programs. Most programs take a long time to start. Programs can require more memory.

--
sig used to be here

Billybob
Member #3,136
January 2003

It would have been wise for you to read the comments on Slashdot as well.
Boils down to this: Java is not C++ 2.0. What I mean by that is that it's a whole different tool, not something to replace C++ or any language for that matter. Same goes for Interpreted languages. They are not inheritly better than anything, they are just different.
So:
Use the right tool for the job

If you're interested in Java, study it. Learn for yourself the advantages and disadvantages. Because whether something is easier to use or not depends on the coder. I personally love coding in PHP, others don't. It has nothing to do with solid, conrete advantages or disadvantages. I just like PHP, and thus I code better and faster in it.

EDIT:

Quote:

run faster when written properly

It's either the other way around or both. Native programs can run faster if written properly. Remember, Interpreted langauges when run through JIT end up as native code. So how could it ever possibly be faster than native code?
The reason why it seems to be faster is that sometimes the JIT'r can optimise the code on the fly. Such is the case with mathematical calculations, for example. But you could do the same in native code if you wanted.

ReyBrujo
Moderator
January 2001
avatar

Java is fast, but still hasn't reached the point of a native executable when compiled with aggressive optimizations. As for JIT/Interpreted languages, you usually need to ask people to install the framework. Assuming everyone has installed the JRE package is a mistake.

--
RB
光子「あたしただ…奪う側に回ろうと思っただけよ」
Mitsuko's last words, Battle Royale

HoHo
Member #4,534
April 2004
avatar

For most games Java is fast enough. I'm sure it is possible to code Far Cry or Quake4 in it without losing too much speed assuming most of the hardcore math is done using JNI*.

*) JNI aka Java Native Interface, a way to use external dynamic libraries aka DLL's or .so's.

I would say that coding in Java is easier than in C++ but quite a lot of that comes from IDE. When you code Java there is not many reasons not to use Eclipse, most the best opensource IDE and perhaps even best of all IDE's ;)
Another thing that makes Java easier is huge standard library. Basically there isn't many things that aren't already there. If it isn't then most certainly there is some library that you can use. E.g for OpenGL there is jogl, for OpenAL there is joal etc.

Two things I miss in Java are true templates and operator overloading.

__________
In theory, there is no difference between theory and practice. But, in practice, there is - Jan L.A. van de Snepscheut
MMORPG's...Many Men Online Role Playing Girls - Radagar
"Is Java REALLY slower? Does STL really bloat your exes? Find out with your friendly host, HoHo, and his benchmarking machine!" - Jakub Wasilewski

ReyBrujo
Moderator
January 2001
avatar

Quote:

and operator overloading.

How so? I thought you could overload Integer.Add :P

--
RB
光子「あたしただ…奪う側に回ろうと思っただけよ」
Mitsuko's last words, Battle Royale

HoHo
Member #4,534
April 2004
avatar

That is not operator overloading, that is function overloading ;)

__________
In theory, there is no difference between theory and practice. But, in practice, there is - Jan L.A. van de Snepscheut
MMORPG's...Many Men Online Role Playing Girls - Radagar
"Is Java REALLY slower? Does STL really bloat your exes? Find out with your friendly host, HoHo, and his benchmarking machine!" - Jakub Wasilewski

Indeterminatus
Member #737
November 2000
avatar

Quote:

Quote:
1.) Is Java any easier than C++?
No. It's the same.

One might argue that Java is easier to learn than C++ because it is not as complex. Programming in itself is of course not related to a language.

_______________________________
Indeterminatus. [Atomic Butcher]
si tacuisses, philosophus mansisses

A J
Member #3,025
December 2002
avatar

Dont confuse programming with scripting.

C++ can be used for both, most others can't.

___________________________
The more you talk, the more AJ is right. - ML

Marcello
Member #1,860
January 2002
avatar

I can code a million times faster in Java than C++. Instant compile (Eclipse), and no segmentation faults makes a world of difference.

However, I think English is the best language.

Marcello

Evert
Member #794
November 2000
avatar

I always thought it might be possible to make a programming language with a grammer structured after Latin, but I never sat down and worked out the details.
I may someday, just for the fun of it.

ImLeftFooted
Member #3,935
October 2003
avatar

Quote:

I may someday, just for the fun of it.

Someone made a sheakspearian programming language, its somewhere on the internet.

Quote:

1.) Is Java any easier than C++?

I'd have to go with yes. If only for the lack of memory management, though there are other aspects of Java that have been simplified and dumbed down a lot as well.

Quote:

2.) What would be the disadvantages of using an Interpreted/JIT language?

No-one seems to find the end-user installing the JVM as a disadvantage. I don't understand why. Personally I hate the thing. It sits there eating my CPU cycles with no way to turn it off. I cant even find the name in the task list to kill it. Its like have an ex-girlfriend who thinks shes such hot shit that she wont leave your apartment, and shes cut all the phone lines so you cant call the cops.

That aside, to me it makes sense that I as a programmer do a little extra work to ensure that the application will run on multiple OSes. A little extra work by the programmer to make the user's life easier to me is always worth it. But maybe I'm biased from programming too many GUIs.

Evert
Member #794
November 2000
avatar

Quote:

Someone made a sheakspearian programming language, its somewhere on the internet.

That's not really the sort of thing I had in mind though.

Archon
Member #4,195
January 2004
avatar

Quote:

1.) Is Java any easier than C++?
I was just wondering because if so that would significantly improve my development time because I have to compile for MacOS, Linux, Windows, DOS, etc. and on every platform I have to change stuff.

Syntax-wise, I would say it's relatively similar. Except Java is PURE Object Orientated, while C++ can still have the procedural nature of C. However, maintaining 3 different versions of the same software would be simplified with 1 single executable.

Quote:

2.) What would be the disadvantages of using an Interpreted/JIT language?

Speed and memory usage. However, C# (I think Java too), uses a garbage collection which can free memory that is not used - so with programs that crash and have memory leaks... it's only a matter of time that the memory usage catches up - unless you reboot often, but that's a Windows user thing ;)

Quote:

I always thought it might be possible to make a programming language with a grammer structured after Latin

Like BASIC with an extra hundred unnecessary keyboards? ;D

Quote:

Its like have an ex-girlfriend who thinks shes such hot shit that she wont leave your apartment, and shes cut all the phone lines so you cant call the cops.

What a perfect analogy.

Karadoc ~~
Member #2,749
September 2002
avatar

Yay! A language flamewar in the making. :)
Here's my opinion:
C / C++ -> good
Java -> Bad
Python -> Ok
everything else -> don't care / don't know

And so, as people typically say in these sorts of threads: Use the right language for the job. Different languages are good for different things. For example, I use [my favourite language] for [almost everything], and [my second favourite language] for [a couple of other less important things].

Ok, my point is that it doesn't really matter much which language you use. Most languages can do basically everything. Pick the right language for the job; and if you don't know which language is the right one, just pick the language you are most comfortable with.

-----------

James Stanley
Member #7,275
May 2006
avatar

Ok, Thanks guys. I think I'll stick with C++ for now then. I started programming in Java, but that was a bit complicated with no prior programming experience at all, I thought I might go back and have another go some time.

Jonatan Hedborg
Member #4,886
July 2004
avatar

Im a C++ programmer myself (or so i like to think), but after a three courses of java at uni, i must say that java has it's merits.
It is a lot easier, for many reasons, including; no memory management, no messing around with header guards, circular dependencies etc, the API is HUGE and have functions for reading and drawing bitmaps, playing sounds etc, it has a more human-readable syntax (extends instead of : ), has two types of for-loops, it has interfaces and it has eclipse which will make you cry when you use Dev-C++ again :(

It is however quite the memory hog, and all users will need the RTE, preferably the latest version if you want to use generics (and you do).

As for C++, i'd say that it's THE language of choice for game-makers everywhere. The industry uses it. There is fast and easy access to hw-rendering etc.

Basically, Java is a sleek sport car (with a dvd player for when you are stuck in trafic) and C++ is a 18 wheel diesel truck.

They both have their uses. Java is great if you want to make a GUI application quickly or a smaller game, while C++ would be great if you want to make a high-performance 3D game.

This is all imo naturally :)

James Wyman
Member #7,337
June 2006
avatar

Java with something like jbuilder is very easy to create aplet programs. c++ is much more powerful and allows you access to many things you are not privy to in Java.

Archon
Member #4,195
January 2004
avatar

Quote:

Basically, Java is a sleek sport car (with a dvd player for when you are stuck in trafic) and C++ is a 18 wheel diesel truck.

I'd say the other way around.

Thomas Fjellstrom
Member #476
June 2000
avatar

Quote:

I'd say the other way around

Hes not referring to the speed :P

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

Archon
Member #4,195
January 2004
avatar

Quote:

Hes not referring to the speed :P

Yeah but in his post he said Java is a memory hog (size) as well as it's standard set of API that comes with it (is big too).

And to me, C++ is a cooler language, sports cars are cool ;D, but they can crash easily with an amateur driver. With rigs, their crashes would be destructive (if the JVM crashed maybe?) :)

Of course, if you want to keep your sanity, ignore what I just said.

HoHo
Member #4,534
April 2004
avatar

Quote:

With rigs, their crashes would be destructive (if the JVM crashed maybe?)

Big rigs don't crash because they have Autodrive systems installed ;D

Also, so far I haven't seen or heard that JVM has crashed. If it has it had to be something else that caused the problem, not the program or JVM itself.

__________
In theory, there is no difference between theory and practice. But, in practice, there is - Jan L.A. van de Snepscheut
MMORPG's...Many Men Online Role Playing Girls - Radagar
"Is Java REALLY slower? Does STL really bloat your exes? Find out with your friendly host, HoHo, and his benchmarking machine!" - Jakub Wasilewski

Jonatan Hedborg
Member #4,886
July 2004
avatar

A sport car is not very fuel effective, it is however full of fluffy and shiny things.
An 18 wheeler is tough, powerful and effective. But it aint pretty.

That was the thought behind my analogy.

Peter Wang
Member #23
April 2000

Quote:

I always thought it might be possible to make a programming language with a grammer structured after Latin, but I never sat down and worked out the details.
I may someday, just for the fun of it.

http://www.csse.monash.edu.au/~damian/papers/HTML/Perligata.html

BAF
Member #2,981
December 2002
avatar

Quote:

Speed and memory usage. However, C# (I think Java too), uses a garbage collection which can free memory that is not used - so with programs that crash and have memory leaks... it's only a matter of time that the memory usage catches up - unless you reboot often, but that's a Windows user thing

... 2k/XP clean up memory leaks automatically. This is why I can go for months on end without rebooting. :P



Go to: