4 ms·
This is very well written code. There are not a lot of comments yet it's designed in a way that it is still quite readable. I believe this is due to good part
by jcoffland 9y ago
This is very well written code. There are not a lot of comments yet it's designed in a way that it is still quite readable. I believe this is due to good partitioning of concerns, which also leads to an economy of code. It goes without saying, perfect formatting is a must.
"Elegance is not optional.
There is no tension between writing a beautiful program and writing an efficient program. If your code is ugly, the chances are that you either don’t understand your problem or you don’t understand your programming language, and in neither case does your code stand much chance of being efficient. In order to ensure that your program is efficient, you need to know what it is doing, and if your code is ugly, you will find it hard to analyse.” -- Richard O’Keefe, The Craft of Prolog (MIT Press)
- ci5er 9y agoSome problem spaces have boundaries and exceptions. These can be somewhat ameliorated by better representations ... but sometimes (e.g. device driver apis, or context switching code that works on multiple processor families, or (heaven forfend) business logic) ugly is ugly and you can't do much about it. It can't all be elegant global illumination solutions...
- jcoffland 9y agoAll code can be elegant if the language allows it.