Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Weinberg code shuffling (tracking issue) #18

Open
24 tasks
robinp opened this issue Jan 11, 2020 · 2 comments
Open
24 tasks

Weinberg code shuffling (tracking issue) #18

robinp opened this issue Jan 11, 2020 · 2 comments

Comments

@robinp
Copy link
Member

robinp commented Jan 11, 2020

Tracking issue to implement various code shufflers, inspired by Gerald M. Weinberg's the Psychology of Computer Programming (Part 4, Chapter 13, Documentation).

The observation is that once a programmer is stuck on debugging, he is stuck since he already tried all rational approaches. So irrational / unconventional methods are needed to shake the programmer out of stuckness - the "set". In Underhood we constrain the methods to code display methods.

Examples from the book (pdf page 442), with some additional remarks:

  • Change typography in various ways (example: bold keywords).
  • Change multi-use symbols, like ambiguous equals sign, parens by levels.
  • List symbols with their references inline (note: likely need to cut to top)
  • Strip comments, or keep only comments, or show side-by-side.
  • Similarly for literals.
  • Rename all variables (maybe keep first char, or assign new sequential chars... maybe take scope into account)
  • Expand abbreviations or abbreviate expansions
  • Permute operation order
  • List symbols
  • Highlight ambiguous or dangerous operations
  • Show conditionals as decision tables or other canonical representation (decision tree?)
  • Show example in/out results on expressions (note: needs pure functions and interpreting)

(Note: many items from the list, which was published in 1971 originally, is clearly a forerunner of many modern niceties. Absolutely stunning, respect to the elders.)

Inspired custom additions:

  • Turn off syntax highlight.
  • Randomize indentation.
  • Introduce mutation into source code, and make the programmer find it (Quiz Time!)
  • Replace variables with names inferred from their types and usage.
  • Replace names with AI-generated names.
  • Assign unique color to different variables.
  • Assign unique object (pictogram, waveform, number...) to different variables.
  • Display as flowchart.
  • Add badge to variables noting their usage counts (in same module / other modules / etc), especially write counts.
  • Show test cases side-by-side.
  • Reorder function sequence within file according to various orders
  • Show code bubbles (dynamic reorder based on current focus)
@robinp
Copy link
Member Author

robinp commented Jan 12, 2020

Ah, I badly overloaded the term fuzzing, thanks. Will change it to something else.

@robinp robinp changed the title Weinberg fuzzing (tracking issue) Weinberg code shuffling (tracking issue) Jan 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants