4 ms·
A framework I have recently found useful for thinking about my work as a computer programmer is a classic set of philosophical concerns: Truth, goodness, and b
by gregfjohnson 7y ago
A framework I have recently found useful for thinking about my work as a computer programmer is a classic set of philosophical concerns:
Truth, goodness, and beauty.
That is to say, software development has an intellectual dimension, a moral dimension, and an aesthetic dimension.
For me, the intellectual questions primarily concern program correctness. Is this code bug-free? Is it robust and stable? I tend toward the "computer science as mathematics" epistemology of Dijkstra and Hoare. Invariants; inductive reasoning; temporal logic. At least at the level of individual functions, I find that it is feasible to express with rigor and clarity what the function is intended to do, and to reason with precision through to a conclusion that the implementation fulfills the intent. And, there is a test for every line of code. A favorite quote from Knuth: "Don't trust the following code. I have only proven it correct, I have not tested it!"
The moral questions concern the uses for which the code is designed, and the uses to which it will be put. I work on medical device embedded software these days, and the moral dimension of this work is a very meaningful and concrete benefit of this choice. I used to work on software development tools to support avionics development for the B-2 bomber. While I don't dismiss the latter as unambiguously immoral, it certainly was more problematic for me, an ongoing source of angst and struggle.
The aesthetic issues seem to me to be two-fold: how beautiful is the software from the standpoint of the user? And, how beautiful is the source code? I have seen (and written) much code that is frankly an ugly mess. I have also upon occasion had an inspiration about how to re-write a piece of code. Tons of code gets deleted, and the new code is simple, clean, elegant, and inevitable. I would go so far as to claim that at times I have been graced to write code that turned out to be beautiful and aesthetically pleasing. It seems to me that the "Clean Code" movement encourages creation of code that is elegant and beautiful.
I find that this triad of concerns inter-relate. Beautiful code is more likely to be correct, and conversely. Mindfully written code that is done with clarity and integrity tends to be both more beautiful and correct.
- SarikayaKomzin 7y agoI like this. Reminds me a bit of another useful triad for software, the Vitruvian principles in architecture: firmitatis (stability), utilitatis (utility), et venustatis (beauty).
- crispinb 7y agoNice. Seems like a satisfying approach. The ethical dimension has been a struggle for me. For reasons not relevant here projects I have worked on have tended to be either trivial or for companies whose ethics are actively dubious (business in my country is in general actively hostile to non-mercenary concerns). I've pretty much dropped out of dev work in large part for that reason.
- User23 7y agoThese relate directly to the three normative sciences: 1) Logic, the normative science of what is true. 2) Ethics, the normative science of what is good. 3) Aesthetics, the normative science of what is beautiful. I believe the above formulation is due to Dijkstra, but I can't recall precisely which work I saw it in. He certainly held all three in high esteem and that philosophy was at the root of many of his insights. For example, he explicitly made a distinction between correctness and pleasantness. The former is a matter of logic and the latter is a matter of aesthetics. It follows that they are separate and independent concerns. The vast majority of software is not logically correct, but is nonetheless more or less pleasing to its users. As for ethics, it's not just for things like the defense industry and medicine. For example the change to the C standard from having a set of permissible responses to undefined behavior to the actively hostile anything goes situation we now have is a matter of ethics. That behavior is both correct in that it satisfies the specification and pleasant in that it allows for aggressive optimization, but it's not very good for the users who get their NULL checks optimized away. Arguments that the bad behavior is correct or allows optimization don't address the ethical concern at all or deny its existence altogether and thus can never refute it. The normative sciences are remarkable in their broad applicability across domains, which makes them worthy of study by all educated persons, but they are especially important for software developers since we can potentially affect so many people's lives. They even apply here on HN. We should all try to make our contributions true, good (nourishing for intellectual curiosity), and elegant.
- igravious 7y agoAh, a Peircean I see.
- galaxyLogic 7y agoWhat makes me always uneasy about theories like this is it makes me ask "If 3, why not 4?". What reason do we have to assume that these three dimensions 1,2,3 are the only ones there are? Why exactly 3 and why just these 3?
- User23 7y agoThat's a great question. Your cousin comment notes that Peirce has influenced my thought. He had something of a fascination with three because of structural properties. In essence he saw the mathematical relation as a triad and so he considered three in some way essential to logic and what he called semiotic[1]. Some of that has probably rubbed off on me. I don't think it's a magic number, just a common one. I happen to know of three normative sciences. I would gladly learn about a 4th, 5th, or more if they exist, especially if they share the same broad intellectual utility. It can also be a case of lumping versus splitting[2]. Postulating that logic, ethics, and aesthetics together are somehow exhaustive, one could still conceivably divide any of them into further subdivisions and spawn new normative sciences that way. I don't believe that would help me make my thoughts clear to myself or others, but, pleasantly, if someone else discovers that it does help then they will have an easier time convincing me too! Conversely, I can't imagine how lumping any of the three I listed together would be an aid to understanding. [1] Not really what postmodernists mean. See https://plato.stanford.edu/entries/peirce-semiotics/ https://plato.stanford.edu/entries/peirce-semiotics/ [2] https://en.wikipedia.org/wiki/Lumpers_and_splitters https://en.wikipedia.org/wiki/Lumpers_and_splitters
- jpxw 7y agoLogos Ethos Pathos