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?
amarillion
Member #940
January 2001
avatar

the title said:

Which language is best?

Perl

I'm sure you take my word for it.

Evert
Member #794
November 2000
avatar

:D
Thanks for that. I'll have to check that out sometime.

nonnus29
Member #2,606
August 2002
avatar

You guys are sooo gay. Java and C++ are nearly identical. If you want to talk about significantly different languages then Perl is a good start, then scheme, sml, haskell, prolog, ruby, etc... Even javascript has functional aspects. ;)

Jonatan Hedborg
Member #4,886
July 2004
avatar

You may or may not have noticed that the OP's question was "What is better, java or c++?" not "what language is most different from Java and C++?"

And if you have used Java and C++ for any extensive period of time, you would know that while they are syntactically very similar, their uses, strengths and weaknesses are quite different.

GullRaDriel
Member #3,861
September 2003
avatar

To the OP:

When it come to work in a company, you must use what they allow you to use.

For your own production, the fact is that:

THE BEST LANGUAGE IS THE ONE YOU ARE BETTER AT.

"Code is like shit - it only smells if it is not yours"
Allegro Wiki, full of examples and articles !!

tobing
Member #5,213
November 2004
avatar

Makes me think of this old article about 'Real Programmers don't use Pascal', comparing Fortran to Pascal and C and other programming languages. How did they say it? "You can write FORTRAN programs in any programming language." ...

GullRaDriel
Member #3,861
September 2003
avatar

X is for quiche eaters.

Replace X with one following the rule named #must_match_a_programming_language_name#

"Code is like shit - it only smells if it is not yours"
Allegro Wiki, full of examples and articles !!

Evert
Member #794
November 2000
avatar

Quote:

You can write FORTRAN programs in any programming language.

;D
So true!

Steve++
Member #1,816
January 2002

Quote:

Java and C++ are nearly identical.

Heretic!

I started learning C++ about a year before Java. I found Java programming much more productive, but used C++ because Java wasn't yet a formidable game language. Things have certainly changed now, but the game industry is quite predictably slow to catch on. It doesn't matter that Java is a memory hog. The fact that the JVM eats a big chunk of the heap at startup isn't a problem, because it is just doing what most big games do anyway.

For me, distribution is the overriding factor in language choice. If I want to make a game that can be quickly downloaded, I'm probably not going to be too comfortable with requiring the JRE be installed. But if I'm distributing on CD or some other physical format, then I can just include the latest JRE and have the installer install it if needed. In the former case (Internet distribution) I would most likely prototype in Java and perform a native conversion once the game is finished.

Marcello
Member #1,860
January 2002
avatar

On the other hand, you can require Java Web Start, so even distributing on the web is not that big of a deal.

Marcello

axilmar
Member #1,204
April 2001

Coding is generally much easier in Java, thanks to garbage collection and its huge set of libraries. Java is quite fast, with only exception being Swing (which is slow due to implementing its own window manager). Java programs are portable with minimal fuss.
Java programs tend to be slower than C++ programs, because of all the work being done in the background...but I do not find the performance issue critical for most applications.

If you need the absolute fastest speed possible, go with C++. But be prepared to be mentally tortured by an endless stream of uncontrolled crashes, memory corruption, wild pointers, etc. But, in the end, if you make it, your app will be fast!

Evert
Member #794
November 2000
avatar

Quote:

But be prepared to be mentally tortured by an endless stream of uncontrolled crashes, memory corruption, wild pointers

Am I the only one who hasn't had problems with pointers and memory management?
I probably had some difficulty the first time I tried to use them (in Pascal), but I've never had a problem in C (or C++).

Thomas Fjellstrom
Member #476
June 2000
avatar

I had no end of troubles when I was learning C, with Win95. Oh how I hate win95.

--
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

23yrold3yrold
Member #1,134
March 2001
avatar

Well I didn't learn on Win95. :) But pointers and memory management are simple once you understand them. Haven't given me problems in ages.

--
Software Development == Church Development
Step 1. Build it.
Step 2. Pray.

Jonny Cook
Member #4,055
November 2003

I usually prefer to program in HTML.

The face of a child can say it all, especially the mouth part of the face.

Matt Kindy
Member #7,331
June 2006
avatar

I prefer C to any language SO_FAR
#define SO_FAR '14YEARS_C_CPP_JAVA_MATLAB'

ImLeftFooted
Member #3,935
October 2003
avatar

Quote:

Am I the only one who hasn't had problems with pointers and memory management?

I haven't. I find it kind of fun to control my own memory allocation

Tobias Dammers
Member #2,604
August 2002
avatar

Quote:

However, I think English is the best language.

Nah. It doesn't even have consistent spelling.

Quote:

I usually prefer to program in HTML.

No you don't. HTML is a markup language, it has nothing to do with programming. Various extensions and embedded applets can provide programming abilities, but pure HTML has nothing to do with programming. Look up 'Turing complete' in Wikipedia and you'll get a clue.

C++ is teh workhorse, though I wish it had some of the features Java has (not GC though, but the serialization stuff is nice, convenient abstracted cross-platform access to all sorts of hardware, web and database integration), and that C++ weren't so explicit. Quite some extra typing required only for historic reasons (e.g. header guards).
Java, IMO, is just a bit too bloated to be acceptable. Having the JRE running in the background and eating precious system resources (not all machines are quad-core 6 GHz with 64 GB RAM) isn't nice. And we'll all use intel processors soon anyway, so why the fuss about cross-platform compatibility...

---
Me make music: Triofobie
---
"We need Tobias and his awesome trombone, too." - Johan Halmén

Karadoc ~~
Member #2,749
September 2002
avatar

Evert said:

Am I the only one who hasn't had problems with pointers and memory management?
I probably had some difficulty the first time I tried to use them (in Pascal), but I've never had a problem in C (or C++).

I'm sure there are lots of non-programmers who have never had those sort of problems with C. :P
For me, C is favourite language. I'm a bit fan of the pointers, and I feel like C really puts me in control of the computer. I like the philosophy that "the programmer knows what they are doing", and so the language should just do what you tell it to do.
Once upon a time I did have a bit of a nightmarish memory bug in one of my games; but never again since then. I know how to avoid those problems now, and I know what the symptoms are as well.

Jonny Cook said:

I usually prefer to program in HTML.

I like variables much better than HTML.

-----------

axilmar
Member #1,204
April 2001

Quote:

Am I the only one who hasn't had problems with pointers and memory management?
I probably had some difficulty the first time I tried to use them (in Pascal), but I've never had a problem in C (or C++).

It depends on the project's complexity and the rate of changes. For personal projects, that are usually small, I usually do not have a problem. But when KLOC is large, the chances of having a memory problem increases exponentially.

Jonny Cook
Member #4,055
November 2003

Yeah, that was supposed to be a joke. I was hoping it sounded ridiculous enough that it was obvious... guess no. :-/

Quote:

I like variables much better than HTML.

As do I, although I'm sure you could rig something up in HTML that's somewhat variableish.

[edit]
Oh, and I actually prefer C++... just so people can take me seriously again. :(

The face of a child can say it all, especially the mouth part of the face.

Karadoc ~~
Member #2,749
September 2002
avatar

axilmar said:

the chances of having a memory problem increases exponentially

increases exponentially with what? The size of the program? I don't think so.
To get zero memory errors you just need to not make any memory related mistakes in each line of code. Since you can do this on a line by line basis, the chances of getting a memory error must increase linearly with the size of the program.

-----------

Matt Kindy
Member #7,331
June 2006
avatar

Karadoc~ said:

ince you can do this on a line by line basis, the chances of getting a memory error must increase linearly with the size of the program.

That's not neccesarily true, you see. For example you can make two memory errors in a line, or, with a loop, you can have one memory error over, and over again, which is basically more than just one error. Also, you could have a line that doesn't deal with memory, therefore, it could end up looking like this:


{"name":"589614","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/b\/9\/b9d33ab751bc75688c3afdd96c6c2803.jpg","w":400,"h":400,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/b\/9\/b9d33ab751bc75688c3afdd96c6c2803"}589614

Instead of this:

{"name":"589613","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/2\/d\/2d685d0416531eb3d6454af382d3ed68.jpg","w":400,"h":400,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/2\/d\/2d685d0416531eb3d6454af382d3ed68"}589613

Evert
Member #794
November 2000
avatar

Quote:

That's not neccesarily true, you see. For example you can make two memory errors in a line, or, with a loop, you can have one memory error over, and over again, which is basically more than just one error.

That's nonsense. It's one error, regardless of how often the code is executed.
Anyway, I think you missed the point of Karadoc~'s line of reasoning, which deals with averages over a large number of lines in code (let's be honest: how many implementations of Hello World have you seen that have a memory leak?)
Anyway,

Quote:

the chances of getting a memory error must increase linearly with the size of the program.

I'm not sure I agree: in a complex programme, you can have correlations between lines that lead to memory leaks even if each line by itself looks fine. Therefor, I would expect the chance to scale quadratically with the number of lines of sourcecode.

There has to be a way to test this experimentally. Problem is that it requires people to write a statistically significant number of programmes (so we can compare different source sizes) of different length, of similar levels of complexity, without them fixing accidental memory leaks along the way. Probably not doable, and as we're arguing over a hyperbole, also not worth the effort.
But it's a fun idea.

Matt Kindy
Member #7,331
June 2006
avatar

That makes sense :o



Go to: