Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ```
- On Readable Code: A Thought Experiment
- What if people could leverage their understanding of
- books and knowledge to read and think about code?
- This is an imaginary language designed to be food
- for thought.
- The question I want to ask is:
- How can we build a programming language that everybody
- can read and write?
- A programming language is "readable" if a human can understand
- what a program does by reading its source from the entry point.
- A programming language A is more readable than a programming
- language B if more people can understand the programs written
- in A than in B or, if the number of people is equal, if the
- average time required to understand a program in A is lower
- than the time required for a program in B.
- ```
- KNOWING NaturalNumber,
- Addition AS BINARY INFIX '+',
- Subtraction AS BINARY INFIX '-',
- EqualTo,
- GreaterThen
- FROM /Mathematics/Arithmetic
- GIVEN number FROM NaturalNumber
- DEFINE FibonacciNumber AS NaturalNumber WHERE
- IF number IS EqualTo 0 THEN FibonacciNumber IS 0 DONE
- IF number IS EqualTo 1 THEN FibonacciNumber IS 1 DONE
- IF number IS GreaterThan 1 THEN FibonacciNumber IS
- FibonacciNumber(number - 1) + FibonacciNumber(number - 2)
- DONE
- DONE
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement