HN user

kelly5

17 karma
Posts0
Comments4
View on HN
No posts found.

I liked a lot of Johnathan's ideas about writing simple code.

One idea that I don't think fits for the type of system I develop is the idea of preferring huge blocks code over function calls (around 30:00). He counters the benefit that the function name documents the chunk of code it encloses, but an even bigger benefit, in my opinion, is that the function signature documents the function's inputs and outputs. If you avoid global variables then you know when you modify a function exactly what information you have access to and exactly what information the function produces. This makes changing the function much easier.

He says he's talking about thousands of lines of code that always get executed in serial, so it doesn't sound like my code is very similar to the code he's talking about. I also expect that code I write gets read and modified much more often than the code he's talking about.

I agree that you need more than mastery of the movements to win a fight, but the reason exercises like kata are so valuable is that when you master the movements your mind is free to focus on higher level problems.

When I studied Mathematics in elementary school I didn't memorize all of the multiplication tables because I thought I could always use a calculator if I wanted to multiply. Years later, when learning Algebra I had to go back and memorize those tables because having to calculate simple products and quotients was slowing me down. Knowing multiplication tables isn't necessary or sufficient for being able to do Algebra well, but it sure speeds you up.

I often practice my coding skill by doing problems like the algorithm problems on TopCoder. I find focusing on coding and solving problems quickly improves my work productivity in a way that doesn't come just from doing that work alone. I think these Kata will be even more useful for building the low level skills I use often in my work, so thanks to the original poster!