DWIM
In Informatique DWIM is initials for Do What I Mean. That mean " fact what I want dire". It is used in data processing to indicate the quality of the languages which make it possible to avoid to specify in " length, into broad and transversely " the action to be carried out. In other words: one can specify the " quoi" without specifying the " comment". But often, as in the example developed Ci below, it is it " quoi" itself which is omitted and which must thus be inféré.
The DWIM is also the quality of the programs or parts of programs which exploit the DWIM of the language used. As in English, where the role grammatical of the names is rather flexible, DWIM can also used like Verb: " The Low-level languages DWIMent pas".
Indeed, when one writes a program in Assembleur, one must specify details of the Mise in work like Register S by which the computed values forward. Worse, these details lock up the program in the material Architecture selected and prevent its portability.
The consequence desirable of the DWIM is to obtain readable programs concise but.
The DWIM is the quality of certain powerful but complex languages. This quality is very subjective and its appreciation depends much tastes of the programmer. Typically a language which uses contextual information DWIMe. The complexity of the language increases also the cognitive load of the programmer who must know some well mechanisms to include/understand a seemingly ambiguous program.
The High-level languages do not have necessarily quality DWIM.
The importance of the DWIM and the contexts of its reasonable use are discussed. The DWIM of is often the Assombrissement other.
Simple example
In Perl 5, the variable $ _ is a kind of Pronom to do everything. Its value is affected by a great number of operations. It is one implicit parameter of much of functions. It is thus a form of implicit use of the context. For some, this style is acceptable only in the Uniligne S.
$ _ = " Hello the monde" ; print; # are equivalent of " print $_"
But this quality of DWIM must be an integral part of the language
if not it quickly becomes aggravating and fragile. Thus Perl 5 does not have
no the formal mechanism of signature of function. In the absence of
signature, form of concise and formal documentation included in the code itself, it is thus necessary to refer to documentation to know that $_ is a Paramètre
implicit of the function print. The mechanism is fragile
because it does not anticipate only the most common use of print
use a final jump of line. Perl 6 proposes a function
say which adds this final jump of line.
print " $_ \ n" ; # Perl 5: impossibility of using the $ _ implicit say; # Perl 6: equivalent with print " $_ \ n"
The originator of Perl 6 anticipates that say will be used more than
print. This is why it chose a name court of three letters
in accordance with the Principle of Huffman. Like the DWIM, the principle of Huffman
contributes to the concision of programs Perl.
| Random links: | Voluminal density of load | Sebastien Roch (Romance) | Thomas Hoerl | Areas of Somalia | Nuclear physicists | Méthode_de_Strachey_pour_les_places_magiques |