[fpc-devel] Re: [fpc-l] type discussion
daniel at deadlock.et.tudelft.nl
Thu Jun 2 21:38:19 CEST 2005
Op Thu, 2 Jun 2005, schreef Jamie McCracken:
> So am I. My point is not changing the language so that it incurs
> additional maintenance or is harder to read or harder to fix bugs or
> make bugs more likely. In fact its the complete opposite.
> My point is to to reduce or remove *redundant* syntax that serves no
> useful or productive purpose (to the programmer).
No, adding syntactic sugar usually does more harm than it is an
enrichment. It promotes people to write code that only works on 1 compiler
and increases the learning curve for people trying to learn the language.
Syntactic sugar can be added *if* it really does have an advantage.
However, changing the way constructors are done saves only a few
keystrokes, but keeps people away from understanding class references,
which, if understood well, can be a very powerfull tool (virtual
constructors, calling class methods of class references etc.)
So, I very much doubt if this proposal will help.
Don't take us wrong, we are very much in favour of modernizing the
language. However, we are getting *lots* of proposals like this, only
*for* *no* *other* *reason* than to save a few keystrokes.
Granting all those wishes would turn the language in an enourmous
monster. That doesn't look like a good idea. We've also a limit amount of
developers whos time needs to be spent well, or we'll get behind.
So, we're very convervative. Good ideas though, that will really benefit
people, will be read with great interrest.
> Forward declarations are redundant - they exist purely for the benefit
> of the compiler.
Here I disagree. I like that I only need to look upward to search a
procedure. Even when I program C I order the procedures like I to in
Pascal, since it'll save time in the long term.
> Begin..End is redundant - you have to indent them to make em readable
Here I agree, however, Pascal was designed this way. If I would design the
language I would have likely chosen something shorter. On the other hand,
I only need to type alt+B and I have a begin/end combo. Even without it,
the begin/end doesn't irritate me.
> manual memory management of tobjects is redundant as you can get good
> performance with ref counting tobjects.
I agree that automatic memory management eases the programming job.
However, Pascal is a manual memory management language. That has
advantages, software written in Pascal is fast, perceived fast by people,
and uses very little memory.
Users like software written in Pascal. They dislike software requiring
JDK's and .NET runtimes.
So, lets turn the disadvantage in an advantage. Pascal is no replacement
for Java and C#. It is a replacement for C and C++.
Now, the majority of software is written in C and C++. Isn't that a great
> All in all the changes would mean you spend more of your time
> implementing your application rather than typing loads of redundant
> code. Maintenance is easier as their is less redundancy.
As has already been said, typing is not the problem, maintenance is.
Pascal does a good job here, saving people a lot of time.
More information about the fpc-devel