4 ms·
I've heard an argument that Python, of the widely used languages, comes closest to being "executable pseudocode", simultaneously actually code and yet readable
by _delirium 15y ago
I've heard an argument that Python, of the widely used languages, comes closest to being "executable pseudocode", simultaneously actually code and yet readable as an informal algorithm description. It'd be interesting to know if that were true.
- irahul 15y agoAmong others, Norwig has said(on HN; can't find the thread but it was the thread about "Ask PG: Lisp vs Python") about close mapping between his pseudo code and Python code. Personally, I find it true.But I also find it true for Ruby, Clojure and other high level languages. If we are talking non programmers, I am afraid this close mapping would mean anything to them. Isn't it more or less about how similar programmers find the pseudo-code and the implementation?
- deleted 15y ago[deleted]
- derleth 15y agoIf there's one thing I've learned from studying programming languages, it's that human minds are extremely diverse, especially when it comes to designing notations. For some programmers, their 'executable pseudocode' language is Haskell, or Forth, or maybe even the assembly language of some specific piece of hardware. Some people might naturally think in COBOL. Also, the problem domain can dictate some of the shape of the language: Something that's built out of a mathematical expression is almost always going to be expressed most compactly as that expression in standard mathematical notation, with something like APL coming close to being the 'executable pseudocode' form of that program. That said, there are almost always many ways to solve the same problem.
- andrewflnr 15y agoI haven't actually programmed in Haskell, but once I started reading about it, my pseudo-code started to look like it, especially type declarations and inline conditionals. Other times, I use more Python-y (won't say Pythonic) syntax. So even in one person, it can vary.
- Tycho 15y agoCoffeeScript might give it scare.