I think a lot of my bugs come from needing to focus on the difficult essential idea, and thereby overlooking the details.
I often write something intentionally provisory, and it becomes a bug when I forget to change it later. I should get into the habit of making obvious which pieces of code need to be changed before running. Maybe I should append those variable names with "----" or something. I could program my IDE to stop me from evaluating any code containing this.
---
A programming language is often a tool to think in / with: it can express concepts and ideas in succinct ways, often much better than English.
I would probably be a more accurate programmer if I wrote more pseudo-code before writing in real code. That way, I would be separating the conceptual work from the low-level fill-in-the-blank work.
BUT my whole philosophy about formalization would suggest that pseudo-code need not be essentially different from real code. "if a proof is obvious, then it should be trivial to formalize!". We all know this is not true, though.
Writing my pseudocode in Lisp (i.e. thinking in code) is very tempting, but also confusing, because the later reader (probably the me of 5 minutes later) will not know that this was meant to be pseudo-code. Maybe there are tricks I can do with syntax coloring.
---
This is reminding me about something Hofstadter wrote: when the meta-thought is expressed in the same language as the thought, confusion can ensue.
... maybe some deep thoughts about this will come later.
I often write something intentionally provisory, and it becomes a bug when I forget to change it later. I should get into the habit of making obvious which pieces of code need to be changed before running. Maybe I should append those variable names with "----" or something. I could program my IDE to stop me from evaluating any code containing this.
---
A programming language is often a tool to think in / with: it can express concepts and ideas in succinct ways, often much better than English.
I would probably be a more accurate programmer if I wrote more pseudo-code before writing in real code. That way, I would be separating the conceptual work from the low-level fill-in-the-blank work.
BUT my whole philosophy about formalization would suggest that pseudo-code need not be essentially different from real code. "if a proof is obvious, then it should be trivial to formalize!". We all know this is not true, though.
Writing my pseudocode in Lisp (i.e. thinking in code) is very tempting, but also confusing, because the later reader (probably the me of 5 minutes later) will not know that this was meant to be pseudo-code. Maybe there are tricks I can do with syntax coloring.
---
This is reminding me about something Hofstadter wrote: when the meta-thought is expressed in the same language as the thought, confusion can ensue.
... maybe some deep thoughts about this will come later.