Tomas Petricek, Charles University, Prague


What is a correct program? What education makes a good programmer?
History of programming as interactions between five cultures
of programming.


Managerial
Hacker
Humanistic
Mathematical
Engineering

float Q_rsqrt( float number )
{
long i;
float x2, y;
const float threehalfs = 1.5F;
x2 = number * 0.5F;
y = number;
// evil floating point bit level hacking
i = * ( long * ) &y;
// what the fuck?
i = 0x5f3759df - ( i >> 1 );
y = * ( float * ) &i;
// 1st iteration
y = y * ( threehalfs - ( x2 * y * y ) );
// 2nd iteration, this can be removed
// y = y * ( threehalfs - ( x2 * y * y ) );
return y;
}
Hacker culture
Values clever code that shows understanding of the machine operation

#define submerge const char*_=O%239?" ":"\t;\t";O*=2654435761;int
#define _cOb8(...) int s,on,__VA_ARGS__;int main(int O, char**Q)
_cOb8(o_, _oO8ocQOcOb, _ocQbo8oo, _oO8ocOb_
){ ; { ;;; ;;} ;{
;; ;{ ; } {;;}
} float the;; static things ;; for (;;){ us :;;
; ; break; the; ;; long grass ;unsigned squall ; }
{ } ; while (1){soft:; submerge us;; in: sleep (0) ;
; ; printf (_); quietly :on ;; the; soil:; };
{{ }; ; ; ;; ;{ ; }; {
{ ; shake: time (1) ;register *_, the =clock(s );
;} ; volatile *_, winds ; ; double wills ;{
; char the ,* fire ;; short companion,*_;}
; { union {}*_, together ;; ; void *warms ;}
} ;; ;{; ;} ; ;;
; ; if (1) wet :; raise (1); struct{}ure ;; ;
; ; free (0);for(;;){ newborn :; ; daughter :; ;
;{ ; extern al, ** world ,*re;const ructed ;};
; ; ; continue;on:;; floods :; ; of: water :;};}
; ;{ ; ; ;; { ; ; } ; } ; ; }
Humanistic culture
Use double coding to speak to the human as well as
to the machine


Engineering culture
Simple, well-structured. Readability is valued more than cleverness.


Mathematical culture
Code achieves great expressivity using a combination of small number of orthogonal features.


Managerial culture
Structure of code enables appropriate organization of development teams and project management.



FORmula TRANslator
rather than a language
Arguments in fixed or
floating-point mode

Algorithmic Language
Types (integer, real, Boolean) denote properties of values;
Subscripts for arrays



Electronic versions of paper-based records
Data records with specific string formatting


Models type checking via derivation rules
Authentication and secrecy problems
Now in Cedar system at Xerox PARC
Type checking done at runtime in Clu
Cites Reynolds ("personal communication")


Abstract data types
for proof terms
Data types
for convenient programming
Type checking
for proof correctness





Activity declarations
vs. processes
Remote accessing
Classes and objects
Record handling inspired by Hoare

"Computer for Children of All Ages"
Learning and educational focus
Experimentation tool at Xerox
From Tektronix to IBM Visual Age
Test-driven development, design patterns

How do you design
software using objects?
Objects as active actors
Responsibilities of objects

From objects to software development processes
Objects support requirements analysis, team structuring




All models are wrong, but some are useful
Framing for history & current debates
Programming is a pluralistic enterprise
Tomas Petricek, Charles University, Prague
