4 ms·
I didn't say we need to teach people to write elegant code. See my examples at http://akkartik.name/post/tracing-tests http://akkartik.name/post/tracing-tests.
by akkartik 12y ago
I didn't say we need to teach people to write elegant code. See my examples at http://akkartik.name/post/tracing-tests http://akkartik.name/post/tracing-tests. I take this perverse joy in coming up with ugly code that is suited to its surroundings, and I'm extremely well-suited for programming because when it comes to code our aesthetics are like George Costanza's instincts (http://en.wikipedia.org/wiki/The_Opposite http://en.wikipedia.org/wiki/The_Opposite).
I want programming to be like reading, with most people able to skim most article-length pieces of prose -- even if it's poorly written -- and get a sense for its global organization. That doesn't require teaching everyone to write like Shakespeare.
- dkarapetyan 12y agoGood luck. I'm still not going to read terrible code no matter how easy it is. It took me a while to come to this realization but aesthetically unpleasant code is indicative of the author's abilities and without elevating the level of all programmers I don't see how making code easier to read is going to make much difference. Some tooling might make it easier/faster to come to the conclusion that some piece of software is not worth investing more time in but with enough experience that judgement is not hard to make. Note that LibreSSL was a fork and rewrite of OpenSSL. Even if it was easier to navigate OpenSSL it still would have been the correct decision to scrap large swaths of it because it was horrendous code, easy to read or not.
- akkartik 12y agoThanks for the luck. We might be in violent agreement or disagreement depending on what code you consider aesthetically pleasant. Everyone can agree on the crap, but can you share examples of code that you liked that might help me triangulate on your aesthetics. Alternatively, I'd be interested to hear if my published projects are pleasant or not. To help you triangulate on mine: http://akkartik.name/post/readable-bad http://akkartik.name/post/readable-bad. To reiterate, you're responding to things I didn't say. Code shouldn't have to be perfectly designed to be readable, and nobody should have to wade through utter crap either. Very often code starts out nice when it has one author or three, and gradually turns to crap as more cooks are added. I want to eliminate that dependency on author churn, to have it be beautiful or ugly based on the capabilities of the programmers involved, not on the difficulty they had understanding those who came before. To make progress on this project, I find it most valuable to utterly ignore aesthetics.
- dkarapetyan 12y agoI don't think we are agreeing or disagreeing. I do want tools that make it easier to navigate and understand code and I also want cultural shifts in programmer communities that lead to better software overall. I'm just saying the communal aspect is more important than any given programmer's ability to navigate code but the two are obviously intertwined in complicated ways. That article you linked to (http://alistair.cockburn.us/ASD+book+extract%3A+%22Naur,+Ehn,+Musashi%22 http://alistair.cockburn.us/ASD+book+extract%3A+%22Naur,+Ehn...) connects the dots really well. Programming is really about building theories and then implementing them with computational building blocks and then transferring the understanding of those theories. Short of developing mind reading I think there is an irreducible complexity in that endeavor that is impossible to skirt around. In light of that article I'd like to amend my comment about aesthetically pleasant code. Some programmers are good at structuring things so that the overarching theory is present throughout all code level structures. That kind of code is both aesthetically pleasant and easy to read. I don't know if this is some kind of special talent of if it can be learned but given that most software is a confused mess I'm willing to bet there is a large talent component.
- akkartik 12y agoYeah, he may well be right and I might be totally barking up the wrong tree. But that just seems so depressing I can't help but tilt at this particular windmill. The hope is that his theory will become obsolete if the activity of programming changes radically enough. I started out thinking you couldn't solve social problems with technical solutions. Now I think social problems arise in the context of configurations of technical energy barriers. Making something easier can make good behavior more or less likely to arise. So it behooves technologists to think hard about what they make easier. But this is getting abstract, and I need to show examples of what I'm trying, what I'm keeping and what I'm discarding. If you send me an email I'll show you what I have.
- enraged_camel 12y ago>>It took me a while to come to this realization but aesthetically unpleasant code is indicative of the author's abilities Not necessarily. It can also be indicative of the circumstances in which the code was written. Even great programmers can write terrible code if they are stressed out or overworked. So you can't just look at the code they have written and jump to conclusions about their programming ability.