[fpc-devel] Declare variables inside the code
Joerg Schuelke
joerg.schuelke at gmx.de
Wed May 11 00:15:12 CEST 2011
Am Tue, 10 May 2011 18:41:35 -0300
schrieb "kingbizugo at gmail.com" <kingbizugo at gmail.com>:
> Lets see the OOP, its very helpful and speedup a lot the work and has
> been added to the Pascal. Same for generics.
OOP is an concept. Nobody would say that it would not be helpful if
pascal has templates -an other very helpful concept-.
Nobody would say that it is not helpful if somebody implements multi
inherited objects for pascal.
The reason for C++ to say a declaration is a statement is coding
security. An uninitialized variable is in an undefined state, that`s
why the declaration is suspended up to the time you can initialize the
data and bring it to a defined state.
The reasons for pascal not doing this:
- overview is better if you have all var declarations together
- the compiling process is easier if all vars are together.
The reason to change the pascal behavior would not be to have a
feature add-on, but a thinking in the same direction like C++, what
can we do to make it possible that the compiler helps more in
fulfilling assertions about variables and objects during their life
time.
Sorry the bad English, it is difficult to write about concepts without
enough words.
By the way I am not a fpc developer, what I write is my own opinion,
not the one of the fpc team.
Jörg
More information about the fpc-devel
mailing list