[fpc-devel] Circular references and forward declarations

Juha Manninen juha.manninen at phnet.fi
Wed Jan 6 12:11:13 CET 2010


On keskiviikko, 6. tammikuuta 2010 12:42:23 Florian Klaempfl wrote:
> Juha Manninen schrieb:
> > Still, best solution has been to put everything into one big file. And
> > still, I don't like that compiler forces such a thing.
> 
> The compiler forces you many other things. Still, I don't get what's the
> problem with a large unit if it's really needed (and nothing like
> abstract base classes or interfaces or type casts or ... helps). Stuff
> closely depending on each other should end in the same unit. You even
> cannot test a unit with external circular class references without the
> other involved units. So why should the stuff be separated?

I must admit this is a good point. This is more of a cultural issue between 
programming languages.
If the tool chain supports big source files and if people accept them, there 
is no problem.
<OOT> I hope Lazarus can soon edit parts of one file in many editor tabs. 
</OOT>

Other programming languages have different cultures. See the comment from my 
original post in this thread. It was from a professional programmer and I 
understand it. Some development teams want to put every class into its own 
file. C and C++ even have headers in separate files (which is messy IMO).

So, if a professional team chooses a programming language / environment for a 
project, this one feature can make a strong point against Object Pascal.

Juha Manninen



More information about the fpc-devel mailing list