Code is so much easier to write than read because when you're writing it, you know the goal you're trying to achieve and the constraints placed upon your solution.
-
Code is so much easier to write than read because when you're writing it, you know the goal you're trying to achieve and the constraints placed upon your solution. Often, the solution becomes "obvious" because of these two factors, so you don't need to think too hard about what to write.
When you're reading code, you often don't know the exact goal or constraints that were placed on the writer, so you're piecing together not only the "how" but the "why". #dev #programming
-
Here is why I often add comments: they are for the future me.
-
G gustavinobevilacqua@mastodon.cisti.org shared this topic
-
@GustavinoBevilacqua Yeah, definitely a good strategy. It's so easy to under-comment or under-document because in the moment, your solution feels so obvious since you know all the constraints, but in retrospect, it's not so obvious...
-
@GustavinoBevilacqua @allenu Same. I think knowledge should be as close to the code as possible. Not only is that where you’ll need it in the future, it’s also where it has the highest chance to be kept up to date.
-
@GustavinoBevilacqua @allenu I've learned that lesson the hard way