Delphi module weakness: Unit name should not be coupled to filename.

[email protected]
Newsgroups alt.comp.lang.borland-delphi
Message-ID <[email protected]>
Delphi should be independent from the under lying file system.

I consider this unit name to file system name coupling a weakness in Delphi's design.

It scares programmers from using the unit name as a specifier.

What if the file has to be renamed, or what if a version needs to be added to the file name like so:

unit_test_version_001
unit_test_version_002

This would break all code that was written as:


unit_test.variable_a := 500;

^ code is broken everywhere.

Renaming the file does not have to be a problem if the unit name declare in the file itself is independent as follows:

unit unit_test;

Now nothing will break.


In case versioning is needed it can also be implemented:

unit unit_test_version_001;


For this coupling reason I consider the "modularity" of Delphi a failure !

It's very rarely used.

Instead classes are used to try and seperate name spaces/scopes leading to sometimes unnecessary complexities for rapid application development/prototyping.

Bye,
  Skybuck.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.