Vote UpVote

Tip: scoped constants

Delphi Haven – I realise this won’t be for everyone, but since Delphi 2005, constants can be defined within classes. While class constants are not things I particularly find useful when taken literally as ‘constants attached to a class’, I do like how the feature enables the definition of what I call scoped constants, properly grouping related items and lessening the polution of the global namspace. So, instead of doing the following: const DublinCoreURI = 'http://purl.org/dc/elements/1.1/'; ExifURI = 'http://ns.adobe.com/exif/1.0/'; MicrosoftPhotoURI = ...
Favorite? Off-Topic? CR @ 2009-08-18 10:09


Visits: 24
Votes: 1
Favorites: 1
Off-Topic: 0

Visits by Source

User Actions

Users who voted for this posting

Contact us to advertise on DelphiFeeds.com

Community Links

Torry Firebird News


Please login or register to use this functionality.
(click on this box to dismiss)