Dynamically-valued constants: an underused language feature

  • Authors:
  • Jonathan L. Schilling

  • Affiliations:
  • Novell, Inc., UNIX Systems Group, 190 River Road, Summit, NJ

  • Venue:
  • ACM SIGPLAN Notices
  • Year:
  • 1995

Quantified Score

Hi-index 0.00

Visualization

Abstract

Languages such as Ada and C++ allow programmers to declare an object as a constant, even though the object has a dynamic initial value. The benefits of using this construct are given. A sample of actual C++ code is measured to see how often dynamically-valued constants are used, and how often they could be used. This result is compared to previously published results for Ada sample code, and to some Ada code where this feature was consciously employed. The comparisons indicate that this language feature is generally underused. Possible reasons for this underuse are discussed.