1
vote
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

Statistics

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

Visits by Source

User Actions

Users who voted for this posting

LachlanG
Subscribe:
Contact us to advertise on DelphiFeeds.com

Community Links

Torry Firebird News

Sponsor

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