Smalltalk-80: the language and its implementation
Smalltalk-80: the language and its implementation
A simple technique for handling multiple polymorphism
OOPLSA '86 Conference proceedings on Object-oriented programming systems, languages and applications
Design patterns: elements of reusable object-oriented software
Design patterns: elements of reusable object-oriented software
Analysis patterns: reusable objects models
Analysis patterns: reusable objects models
Pattern languages of program design 3
Extreme programming explained: embrace change
Extreme programming explained: embrace change
Test Driven Development: By Example
Test Driven Development: By Example
Object-oriented units of measurement
OOPSLA '04 Proceedings of the 19th annual ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications
A point based model of the Gregorian Calendar
Computer Languages, Systems and Structures
Hi-index | 0.00 |
In physics, like in other sciences, formulas are specified using explicit measurements, that is, a number with its unit. The first step to determine the validity of a physics formula's evaluation is to verify that the unit of the result corresponds with the prospective unit. In software development, physics, financial and other sciences formulas are programmed using mathematical expressions based only on numbers, being the units of these numbers implicitly given by the semantics of the program or assumed by the programmer's knowledge. Consequently, it is common that errors result from operating with values expressed in different units, e.g., dividing a quantity of years by a quantity of months, without obtaining any type of indication or objection to this error from the system. In this report, we discuss our experience designing and implementing a model that solves this problem reifying the concept of measurement, unit and their arithmetic. Our model relieves the programmer from the arduous task of verifying the validity of the arithmetic expressions regarding units, delegating that responsibility to the system, thereby, diminishing the errors introduced by the incorrect use of values expressed in different units. We also show that having implemented this model with a dynamically typed language simplified its programming and increased its reusability.