gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

OffTopic > MegaTroll 2003

#13285 - sajiimori - Wed Dec 10, 2003 7:06 pm

In another thread, I made this statement:
Quote:

C is an elegant balance of simplicity and practicality, whereas C++ is possibly the most convoluted language ever concieved (and intended for practical use).

Since it would have been offtopic to start a flame war in that thread, I invite all those who cannot resist the temptation to share your opinions here.

To narrow the topic a bit, what programming languages have been developed for practical use (i.e. not Malbolge or Intercal) that are more complicated than C++?

Perl is a good candidate, but consider: how long has it taken C++ compilers to fully and correctly support the language? Perl may have an unfair advantage because the language is essentially defined by the interpreter, but it is still worth noting that after 20 years, there are still few (if any) correct implementations of C++.

Ok, so I'll concede that Perl is more complicated in terms of its quantity of rules. But the rules in Perl are geared toward convenience, not technical concerns. At least you don't have to try to remember to declare your destructor virtual, or define a copy constructor for a class that has pointers, or label a constructor "explicit" to prevent automatic conversion, or use array delete with array new, or check for self-assignment in operator=, or make sure that static objects are initialized in the correct order. BTW, most of these errors are not detected by modern compilers.

Anyway, I think it's perfectly reasonable to agree that C++ is the most convoluted language in existence (almost), and still use it on a regular basis and even call it your favorite language.

You could always argue that a complex language is needed to develop complex software. I agree, in a sense. Lisp is an exceedingly simple language (at its core), and you wouldn't dream of writing a complex application directly in low-level Lisp code. You would use the low-level operations to construct a new "language" of higher-order functions (which you can then apply to construct another layer atop that, and so on).

But instead of having a small, extensible core language, C++ incorporates a large number of higher-order features directly into the core of the language (well, they're higher-order than C anyway). This is why C++ is more complicated than e.g. Lisp, as I suggest it is more complicated than all other practical languages.

#13311 - ampz - Thu Dec 11, 2003 12:52 am

I agree with your view of C++. What irritates me the most is the stupid naming conventions introduced in C++.. Function names and compiler directives starting with one or two underscores. It is possible to learn the names of the functions and the compiler directives, but it is impossible to remember how many undersocres there are supposed to be in front of the damn name. This seems to be compiler-dependent.. some compilers want no underscores, antoher wants one or two.

C is my favourite language. I'am a hardware guy, I use C for everything except the really low level stuff and the performance critical stuff. I only wish all compilers were C99 compatible... But at least most compilers are ANSI C compatible.
Only one good thing have come from C++... it allows variables to be declared in "for" loops. This feature was recognised by the C people and integrated into C in the C99 standard. C99 introduced a few more very useful things as well, such as variable types with platform independent size, the alloca, and variable size arrays. But I consider the for-loop variable declaration the single most important thing :-)

Visual Basic is the only "language" I know of that do not require ten pages of code just to open a window on a microsoft operating system (this is of course partly, but not entirely, microsoft's fault), so for user interfaces I sometimes use it, but I don't want to write any amount of code in VB... It quickly becomes unreadable.

Java is, um, well.. I don't really see the point of java for most PC applications, except for java applets. Java makes some sense as a platform independent language for cellphones and PDA's, but other than that... Java is slooow, and it is very easy to write extremely inefficient code in java.

#13313 - sajiimori - Thu Dec 11, 2003 1:15 am

As much as I'd like to blame C++ for the underscore issue, it's not really the fault of the language so much as the compilers. AFAIK, no part of ISO C++ has names that start with underscores.
Quote:

Visual Basic is the only "language" I know of that do not require ten pages of code just to open a window on a microsoft operating system

Python and C# are a couple "real" languages with simple GUI access.

#13335 - XeroxBoy - Thu Dec 11, 2003 7:29 am

Delphi is also quite useful for that purpose. Ampz is right, though - Microsoft made it far too cumbersome and complex to program Windows programs in C or C++.

As for the C++ debacle - on the one hand, object-orientation is a good thing from the perspective of the software engineer, if you want to work close to the hardware and write efficient code on slower platforms (like the GBA), it probably isn't the best way to go unless used sparingly. Besides, C++ does have a variety of issues in it that make it fairly convoluted, though to be perfectly fair most of them likely descend from the fact that it tried to object-orient a language as low-level as C. An object-oriented low-level language? An oxymoron if I've ever heard one!

#13341 - ampz - Thu Dec 11, 2003 12:59 pm

Well, I've never really found the big advantage of object oriented... I have written quite some java, but I still prefer C.. I usually get's the job done faster in C than in any other language. I prefer to think, and write, my program in the same way the processor will execute it.

I don't agree that C is so low level that it cannot be made object oriented. Aside from the fact that java is OO, there is not that much difference between the java and C syntax. And java must be considered one of the more sensible OO languages..
The people behind C did a great job, and noone have ever been able to make a language that really beats C. C is low level enough for you to know exactly how the compiler will translate each piece of code, but at the same time it is very powerful, letting you write complex programs with little effort.

#13360 - sajiimori - Thu Dec 11, 2003 8:40 pm

Agreement?? What is this? Where's the "C++ IS TEH BEST LANGAUGE EVAR!!!!!!!11"??

:-D

#13374 - haduken - Fri Dec 12, 2003 12:59 am

For most uses, I perfer c to c++. It works just fine for most videogame development.
_________________
There were worms, lots of worms, worms that made me crazy,..