Computing Pages

by Francesc Hervada-Sala


Just Once: A Programming Ideal

One should be able to open the development environment and whisper: ”Now listen carefully, I won't say it twice.“

What are languages? They are means for expressing things.

What are programming languages? They are means for expressing software.

If you have to formulate the same thing twice, it is bad designed. You did express it once, right? You did take care of the details once, right? Now it's the computer's turn.

Let the computer do what it can do and do yourself what is reserved to humans. Is there a pattern? Can it be generalized? If so, then specify the logic once and let the machine apply the logical consequences each single time. If you do yourself the routine work, not only have you an overhead when writing new parts and there are necessarily more bugs, but you must also from now on retain the details in memory — and you can retain just a small amount of things in your memory, and you do not share your memory with your team —, furthermore, if you decide to change something in it, you will have to manually update many places. That requires not only your time and your energy, but becomes with today's technology frequently impossible. For example: it is nowadays not feasible to change a field name in a large organization's database because that would break the applications that query it. This is not a bagatelle, it forces uncontrolled growth that leads to intermingled, obscure software the programmers can no longer manage.

Source code does not construct software but describe it. When you write some sentences, you are deciding how something must be done — you are not doing it yourself. This applies to the most general business rule you write in the analysis as well as to an assembly language instruction you write in a device driver. You are not the one who puts a value in a register, it is the processor, you just determine what has to be done.

Programming is ideally taking each decision at exactly one place and extracting consequences from it at many places. The source code must be tight organized as a web of dependencies, in order for the programmers to retain control over it. Insufficient structure sets scalability limits. The place where a particular decision is taken must be to a programmer obvious and easy to access. The definition must be clear and concise, susceptible to be extended or changed. To sum up, programming is specificating, ideally every single thing just once and at a traceable place. The motto of this approach is: if it can be said, it can be programmed; it should be explained once and mentioned oft-times.

This ideal of programming is both a question of mentality and of technology. You can begin right now to think this way, you can use current technologies trying to specify things instead of implementing them and get the best of languages and systems at your disposal. For this you just need an attitude change. But this ideal shows a direction for further technological development, too. Programming languages must be enhanced to support specifying and not coercing its users to implement. They must be designed seeking the compact, general and precise expression of rules and with its user, the programmer, and not the compiler in mind. Dependencies between code parts must be tracked by the system, not just automatic dependencies but also dependencies the programmer sets manually where the used technology comes to its limits. These developments are of course not restricted to syntax and compilers, run time support is needed and new technologies must arise, such as sound name systems and standard ontologies.

Print Contact

Just Once: A Programming Ideal

Text-Oriented Software (Book)

Text-Oriented Software

Copyright

Preface

Text

Text Structure

Comparing Text to Other Structures

Text Query

Languages

Text-Orientation

Imagine

Text-Oriented IDE

Text-Oriented Programming Languages

Files and Text

Programs and Text

Text-Oriented Compiling

Case Studies

Sample: Program Parameters

Unix: A Text-Aware Environment

Universaltext Interpreter

Background

What is Text?

What is Text-Orientation?

Just Once: A Programming Ideal

Why is Computing Important?