Cultures of Programming

Undone Ideas on Programming:
When Cultures Fail to Meet

Tomas Petricek, Charles University, Prague

tomas@tomasp.net
https://tomasp.net
@tomasp.net

What went wrong?

Software update activated unused and wrong code

Reflections on the issue

  • Engineering blogs
  • Formal verification talks
  • SEC commission analysis

Reflections on the Knight glitch

Mathematical culture

Software not formally verified correct!

Engineering culture

Poor testing and engineering practice

Managerial culture

Incorrect implementation of oversight processes

Collaborations

The birth of programming languages

Mathematical culture

Translation metaphor for programming (1950s)

From human language to formal logic and linguistics

Formal grammars for language description

Hacker culture

Clever tricks (1950s)

External form allows subroutine libraries

Interpretive routines for extra EDSAC codes

Managerial need

User groups and computer installation managers

Common universal notations

Cross-machine compatibility
Allow program exchange
Teaching at universities

Undone

The meaning of programs

Algorithm certification (CACM 1961)

Algol becomes the language of academic computer science

Algorithms in CACM

Formal proofs take
time to appear!

Proof of a Program: FIND (Hoare, 1971)

Program as a formal mathematical object

Ensure correctness using mathematical methods!

The mathematical semantics of Algol 60 (Mosses, 1974)

"I must admit I still feel a little surprised it’s as long as it is - I guess Algol 60 is just not nearly as 'well-behaved' as one tends to think it is."

See Astarte (2019)!

What does "Hello world" mean? (Sack, 2025)

#include <stdio.h>
main()
{
  printf("hello, world\n");
}

Mathematical culture

Program prints the specified sequence of characters

Humanistic culture

Greeting! With social contact between the speaker and the hearer

Semantics as speech acts!

Semantics

Undone interactions between cultures

  • Languages born out of collaboration
  • Enables exchange of language features
  • Semantics firmly in mathematical tradition
  • Missing the bigger picture...
  • Semantics as speech acts?

Struggles & collaborations

History of testing and debugging

Debugging on the ENIAC

Early testing technique

  • One manually calculated trajectory
  • Run pulse-by-pulse and verify
  • Checks program & machine failures

Simplifying programming

  • Reprogramming the ENIAC
  • Punched cards with 60 order code
  • Machine helps with programming

Debugging ENIAC

"Adele was an active type of programmer, trying things very quickly.
I was more laid back and given to attempting to figure out things logically before doing anything."

Betty Jean Jennings

Extravagant use of computer time

Instruction-by-instruction execution

  • Tedious and wasteful practice!

Post-mortem dump

  • Prints specific memory region
  • Look for errors offline

Interpretive checking routine

  • Print diagnostics while running
  • Interpreter with 50x slowdown

MIT hacker culture

TX-0 at MIT (1958)

"Debugging at the console regarded as professional sin."

FLIT, DDT, DEBUG

Set breakpoints, interactively modify program & state.

Debugging Epoch Opens (1965)

Limiting factors for computing

  • Hardware until mid-1950s
  • Programming until mid-1960s
  • What now? Now: debugging.

Terminology in the 1960s

  • Checking a program (Turing, 1949)
  • Debugging and program checkout
  • Testing and error handling

Computer Program Test Methods Symposium (1972)

Testing distinguished
from debugging

Companies hire test managers and test technicians

Test automation establishes
a test as an artifact

Engineering and mathematical takes on testing

Growth of software testing (1988)

Demonstration era (1957-78)

  • Test to show that programs
    work as required
  • Alternative to proofs

Destruction era (1978-82)

  • Test to find errors
  • Enables new tool developments
  • Mutation testing, random testing

Testing as part of the development process

Testing after coding in Waterfall (1970)

Unit testing separate from acceptance tests

Managerial take on software testing

Extreme programming

Test-Driven Development

  • Start by writing tests!
  • Created with customers
  • Then write code and improve

Development methodology

  • From black art to scientific method
  • Engineers regain control of testing

Undone

Science of program debugging

On-line debugging (1966)

"It has been possible .. to find a bug while at a breakpoint in running a test case, call the [structure] editor to make a correction, run the program on a simpler test case to verify the correctness of the change, then resume execution of the original test case from the breakpoint."

Debugging now

Set breakpoint
Make correction
Resume execution

To be fair...

Time-traveling debuggers, etc.

Debugging

Undone interactions between cultures

  • Test becomes a stand-alone entity
  • Adopted by engineers, managers, mathematicians
  • Different meaning, but allows idea exchange
  • Debugging remains a hacker practice
  • Undone interaction between cultures?

Clashes

Struggle for control over a concept

Object-orientation

Struggle for control over a concept

  • 1960s - Mathematical simulations in Simula
  • 1970s - Personal dynamic media in Smalltalk
  • 1980s - From Smalltalk to C++ and Java
  • 1990s - UML and new development processes

SIMULA "1"

Activity declarations
and processes

Remote accessing

SIMULA 67

Classes and objects

Record handling inspired by Hoare

Three cultures of Smalltalk

Humanistic (early 70s)

"Computer for Children of All Ages"
Learning and educational focus

Hacker (late 70s)

Experimentation tool at Xerox PARC

Engineering (80s-90s)

From Tektronix to IBM Visual Age
Test-driven development, design patterns

Undone

Open programming systems

Open Web (90s)

Learn and reuse compo­nents using view source

Closing of the Web

Engineering reasons

Delivering large files over slow network...

Large software requires proper languages!

Open systems

Undone interactions between cultures

  • Object-orientation becomes engineering tool
  • Engineers decide on web technologies
  • Malleability and openness gets lost!
  • Degree of incommensurability
  • Humanistic programming systems?

Conclusions

Undone ideas on programming

Bonus slides

Clashes

What is the problem of programming

Hacker origins

“Programming in the early 1950s was a black art,
a private arcane matter involving only a program­mer, a problem, a computer, ... and a primitive assembly program.”

John Backus (1976)

Mathematical science

“Program testing can be used to show the presence of bugs, but never to show their absence!” Rather than verifying programs through their testing, we should prove them correct.

Edsger Dijkstra (1969)

Humanistic problem

“Alan Kay is more interested in us kids. He repudiates the manipulative arrogance .. and serves the dictum of Seymour Papert, Should the computer program the kid or should the kid program the computer?”

Brand, Rolling Stone (1972)

Managerial problem

“With SAGE, we were faced with programs too large for one person to grasp entirely and also with the need to hire and train large numbers of people to become programmers... We were faced with organizing and managing a whole new art.”

Herbert Benington (1956)

History

Cultures of programming view

  • Cultures emerge early in the history
  • Unique values, views, methods, aesthetics
  • Stable over history of programming
  • Not always shared communities
  • Inherently pluralistic discipline?

Aesthetics

Disagreements on values

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;
}

What code is beautiful?


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 :;};}
; ;{ ; ;          ;; {  ;          ; }  ;             }  ; ;  }

Beautiful code


Humanistic culture

Use double coding to speak to the human as well as
to the machine

What code is beautiful


Engineering culture

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

What code is beautiful


Mathematical culture

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

What code is beautiful


Managerial culture

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

Aesthetics

Materiality of programming

  • Code matters for hackers and humanists
  • For mathematicians code is just maths
  • Engineers value code quality and structure
  • Code is secondary for managerial culture

Collaborations

The history of programming with types

History of types

  • 1903 - Avoiding logical paradoxes (Russell)
  • 1956 - Numbers in two modes (FORTRAN)
  • 1957 - Data description cards (FLOW-MATIC)
  • 1974 - Abstract data types (Clu)
  • 1978 - Meta-language for a theorem prover (ML)
  • 1989 - Types in proof assistants (Alf and Rocq)
  • 2012 - Unsound type systems (TypeScript)

IBM COMTRAN

Electronic versions of paper-based records

Data records with specific string formatting

Towards a universal language

Mathematical models

  • Data spaces (McCarthy, '59)
  • Product \(A \times B\), union \(A \oplus B\)
  • Set-theoretical types (Hoare, '72)

Types in Algol 68

  • A long and difficult struggle
  • Whereas ALGOL 60 has values of [three types],
    ALGOL 68 features an infinity of “modes”.

From mathematics to engineering

Lambda-calculus models (Morris '69)

Models type checking via derivation rules

Types are not sets (Morris '73)

Authentication and secrecy problems
Now in Cedar system at Xerox PARC

Abstract data types (Liskov '74)

Type checking done at runtime in Clu
Cites Reynolds ("personal communication")

LCF/ML (1978)

Abstract data types
for proof terms

Data types
for convenient programming

Type checking
for proof correctness

Types

Cultural reconciliation at last...?

  • Proof assistants and dependent types
  • Type providers and data as types
  • Modelling types as relations
  • Unsound type systems for the real world