A Conversation for C - the Programming Language

Pain in the ass

Post 1

Wonko

Headers? Pointers? Null terminated strings? Only simple types as arguments? Signed characters?

I HATE IT.


Pain in the ass

Post 2

Jerome

Having programmed in C, C++, Basic, Dbase, Pascal, Fortran, Cobol, HTML and a whole host of others at one time or another, as far as I'm concerned, C has the least wrong with it.

C++ lacks the simplicity of C and has "References" - pointers that you can't tell are pointers, but you gain manageability in large projects.

Basic has more dialects than is good for it. Visual Basic is not bad but syntactically does not hold a candle to Pascal or C, but can be simple to use for small, slow, projects.

Dbase family (dBase, Clipper, Foxpro) Not bad for smallish databases. The later versions of Clipper resembled C quite closely. Otherwise rather slow and cumbersome.

Pascal (and Object Pascal) very nice language but rather verbose and type checking can get really irritating occasionally.

The basic point is that C has a very small command set, accesses memory and processor at quite a low level and is pretty efficient.
It doesn't get in your way when you want to do something, however stupid.
You can build up high level data types and if you want better type checking you can have it.

Its has got it all

I love it

Jerome


Pain in the ass

Post 3

Wonko

You see, as long as you are doing your programs for yourself, it doesn't matter which language you choose. But when you are working in a team, there's always someone who takes every chance to do it wrong. And in C or C++ you really can scew things up, just forget the null byte at the end of a string, or declare a string one byte too short, or let some pointer running wild. I could continue forver. The compiler won't catch it, the runtime system won't catch it.

And then you debug that 100000 lines program with a nondeterministic bug in it!!! It drove me crazy.

These kinds of errors never happen in Pascal, and to write 'begin' or 'end' you can use edit makros.

C is one of the biggest mistakes in the history of computing.


Just take a look at Java: you don't need them pointers. It's that simple.


Pain in the ass

Post 4

Hydrogenoid

But Java is... well, no better than Java...

Don't you think
cout << "String" << endl;
is quite better to write and understand than
System.out.println("String");
?

If you do not like using char arrays as a string, there is also a String class, which is a bit more safe if you like it that way, no ?


And Java has far more copyright problems...

Grmbl... I really hate Java...


Pain in the ass

Post 5

Wonko

You are right in saying that some statements look better in C++, when done carefully. Shurly you can restrict yourself to only use C++ classes and containers, never ever again using these unsafe arrays. But who does?

My law states: People with the least knowledge of possibly bad consequences do the most risky things. Mostly driven by the search for performance.

Some programming languages prevent this road to Murphy's Law, for example Pascal and Java.


Pain in the ass

Post 6

Hydrogenoid

*blushes*

Then I am one of these people... But the search of performance isn't the only reason.... you can do quite strange thing in C/C++, so why not do them ?
smiley - winkeye

I do not think that preventing everyone to use pointers because someone can make some mistakes is the way to go, but.... oh well, let's say that everyone has the right to have his/her own opinions...

Still... I prefer to have some freedom (no no, not as much as in perl, perl is.. too much) even if it can be a source of errors...


Removed

Post 7

Researcher 158849

This post has been removed.


re: Pain in the ass

Post 8

Wonko

Sounds very good. Best wishes and no bugs to you!

Did you know that Borland is porting it's Delphi to Linux? That will be real great since you can have both: Pascal (I simply love it) or C++.


Pain in the ass

Post 9

terminal_error

What other language is there where you can solve the '8 queens problem' in about three lines of code?

Al (et al)


Pain in the ass

Post 10

Wonko

I thought you could do any program in C in just one line? smiley - smiley

By the way: don't ever try with 8 queens. I have two and they keep me busy. smiley - smiley


Pain in the ass

Post 11

terminal_error

Well, there's lines and there's lines. This is three lines without sticking commands colon-to-colon.

And try the 99 queens while you're there. 99 queens on a 99×99 chessboard. Same three-liner.

And if you want it speedier, you can always expand it to 8 lines and put in some assembler. Then i can solve the 99 queens faster than you can say '99 queens'. I like that. smiley - winkeye

Al (et ql)


Key: Complain about this post

Write an Entry

"The Hitchhiker's Guide to the Galaxy is a wholly remarkable book. It has been compiled and recompiled many times and under many different editorships. It contains contributions from countless numbers of travellers and researchers."

Write an entry
Read more