[fpc-other]Re: reputation of Pascal

Balogh, Karoly (Charlie/iNQ) charlie@scenergy.dfmk.hu
Tue, 04 Jun 2002 15:17:48 +0200


Hi,

On 04-Jun-02, Rainer Hantsch wrote:

>> The programming language Pascal unfortunately has a really bad
>> reputation amongst programmers and in the hacker scene. They call
>> Pascal a "bondage-and-discipline language". There's even 
>> yet a fixed proverb out: "real programmers don't use Pascal".
> This may be true, if you definitely WANT to do "dirty" things, like
> mis-using pointers as integers and similar things, but exactly this 
> is normally not required.
> When my son started to learn at school C and C++, I was forced to 
> get in touch with C/C++ a little bit. And I can tell you, I will 
> never use C/C++ at all.

I worked as a C programmer for a while a few months ago, so i was 
forced to study C more deeply than i did it before. I don't like most
things in C, but there are a few things in it what can come handy,
and now i'm missing it from Pascal. 

For example the static lists. Maybe they're possible in Pascal too,
but i can't find a word about them in FPC docs. They really can make
a lot of things easier. And there are a few more things in C, which
you can use more freely (beside the free mis-use of language elements 
you told above) so Pascal really 'bondages' you in these cases. 
Also, C allows more extensive use of macros, but this is only a 
compiler issue, IMO.

But there are still three things i _hate_ in C.

1., The headers are separated from the rest of the source. It can
be a real pain in larger projects to dig up what's declared in
where, and vice-versa. I saw sources, where the programmers
avoided this with keeping everything in a single .h file (which
was more than 300k...). Cool eh? ;) And the makefiles. Of course,
makefiles can be handy in larger projects. But in C, you simply
must use them in projects with more than two .c files, if you
don't want a nervous wreck.

2., The string 'handling' or we can say the lack of it? Needless
to say, this makes the most problems with C. This is the reason 
of most bugs in software written in C. For example, thoose 
buffer-overflow problems in the networking stuff, and such. Of
course i don't mean using Pascal (and Pascal-alike programming 
style) should avoid all of thoose bugs, but it should be a 
protection against most of them.

3., Lack of namespaces. (With <...> Do stuff.) Okay this feature 
is implemented in C++, but missing from C. It can be a real pain,
when you working with deep structures. But, you can solve the
problem, with macros, or with direct pointers to deeper elements. 
Pfui... ;)

Bye,
-- 
Charlie/iNQ
.:%[ Cybernetic Hydraulic Android Responsible for ]%:. 
.:%[    Logical Infiltration and Exploration      ]%:.
.:%[         Member of TeamOS/2 Hungary           ]%:.
.:%[     Member of Hungarian Amiga User Group     ]%:.