On The Fear Of Reading Code
coderoom.wordpress.com
coderoom.wordpress.com
"As a programmer, your job is not to write code. Your job is to solve problems."
As a janitor, your job is not to mop floors. Your job is to clean messy problems.
All kinds of people mistake work for a form of punishment: if you don't look like you're toiling you must be doing something wrong. This is especially true when evaluating someone else's work.
So yeah, it kinda makes sense that some people take work as punishment... :-)
Personally, while I can and sometimes do have to use the style mentioned in point #3 of the blog post, I curse under my breath every time. (It should be: "\n} else {\n"! Not "\n}\nelse\n{\n"!) Saving myself that frustration can be useful. But for a better example, I'll sometimes come across code indented inconsistently with spaces and tabs, and need to reformat with :retab and == in vim. Separating complex code into chunks makes it easier to parse for me, adding comments, etc. etc. etc. Remember, this is to understand the code, not necessarily to make a bugfix. If I'm going to muck with someone else's code, I'll usually follow their style even if it's not mine. But I might first solve it in mine.
If anyone else is interested, my write-up is here: http://www.clarityincode.com/readability/ (I'm not sure about the etiquette of linking to your own site from HN, so apologies if this is inappropriate.)
Put differently, I 100% agree with Knuth's still-mostly-unheeded call for literate programming, as the real solution to making code readable.
In my case I was reading some Clojure code. Functional programming was something I had never really done much of. But after reading through code and programming in it, I can say that it has significantly impacted the way I both write and read Ruby code (not that I'll try to do functional in Ruby though :).
I'd recommend poking around well-tested things like twisted.internet.defer for starters, then start to explore further afield. :)
I don't agree with this at all. In heterogeneous environments edge cases and little used segments of code are often overlooked as other, more frequently used, segments of a project are updated and their staleness is often only discovered long after the actual "rusting" happened.
Since reality typically changes, and software is typically a model of some part of reality, standing still in absolute terms can be going backwards in real terms.