4 ms·
> I would go further to say that a mathematical understanding or at least inclination is required to write maintainable code. Maintainable code is more an act
by meesterdude 8y ago
> I would go further to say that a mathematical understanding or at least inclination is required to write maintainable code.
Maintainable code is more an act of writing than of mathematics.
- wellpast 8y agoAnd (good) writing is more an act of mathematics than what most people would construe.
- meesterdude 8y agouh... no. Not that there aren't mathematics found within writing, but that argument is irrelevant to this evaluation of taking a mathmatical, formulaic approach to code vs. one that is descriptive, and caters to the ignorances and shortcomings of the human reader.
- wellpast 8y agoSerious question: How much writing have you done? I'm not at all talking about writing about mathematics. I'm talking about the structure of good writing, from fiction to blog writing and everything in between--all of which, when done well, require economy, form, structure and order. Talking to many writers -- from successful screenwriters to blog writers, I find the same theme: a very deliberate awareness of the mathematical structure of their work when that work is finally "working".
- some_account 8y agoI think mathematical people tend to think that code that looks like math is clean code. Since it's similar to math, it's as clear as it can be. Like functional programming - the cleanest code is one line of code which expresses the intent as an mathematical function.
- l_t 8y agoI think about defining the "maintainability" of code as a reduction in the amount of time that will be spent working on that code in the future. Therefore, there are two broad categories of maintainability fixes: 1. To reduce the number of changes that will need to be made to it. 2. To reduce the time it takes to make each change. The (1) category encompasses the idea of making code that requires few changes. Such code is essentially "right" to begin with. I think about this mostly in terms of models -- i.e. does it accurately model the problem -- and quality -- i.e. does it have bugs or performance issues. Of course there are other concerns as well, but those are two big ones and they often involve thinking like a "computer scientist." The (2) category -- reducing the effort of changes -- is achieved by using appropriate abstraction layers, encapsulation, low coupling, and other good-program design. There are many technical concerns in this category, but it seems there are some social ones as well. I would say the programmer's experience is another huge factor. To sum it up in a phrase, perhaps "writing maintainable code is an act of prediction."