Twitter | Search | |
Addy Osmani
~"We think old code is a mess because of a cardinal law of programming: It’s harder to read code than to write it":
Posted in r/programming by u/the_phet • 23,986 points and 1,046 comments
Reddit Reddit @reddit
Reply Retweet Like More
Jonas Raoni Soares da Silva Feb 1
Replying to @addyosmani
It's really harder to read... But in my opinion the main problem with old codes is that after many iterations, the code and its structure becomes a kind of Frankenstein. Also there's the fact that we're always evolving, and knowledge in general was more restricted in the past.
Reply Retweet Like
Addy Osmani Feb 1
Replying to @jonasraoni
I think this comment captured it well "Quite literally no one knows everything about any such system - you have to take a systems approach, design for modularity, document like a graphomaniac, and expect constant rework"
Reply Retweet Like
Ivan Dilber Feb 1
Replying to @addyosmani
It's the lack of context. While you write it you understand the concept and know what you want out of it. With other peoples' code or your own old code you need to invest mental energy into understanding it first, and we're just lazy to do it.
Reply Retweet Like
Cuyler Stuwe Feb 1
Replying to @ivanhoe011 @addyosmani
Yep, this is big. That, and the fact that thinking ideas is much faster than reading ideas. Just like there’s orders of magnitude between RAM / file / network operation speeds, there’s orders of magnitude of speed between thinking / reading / hearing.
Reply Retweet Like
Doron Sherman next@VueConfUS 🥑 Hɪʀɪɴɢ DᴇᴠRᴇʟ Feb 1
Replying to @addyosmani
Like the Netscape rewrite debacle, this keeps repeating itself endlessly in the software industry, whose history is markedly underrated.
Reply Retweet Like
Arne Mæhlum Feb 2
There's nothing wrong with rewriting code even if just to undertsand it. It makes it easier, because then you are not just reading. This blog post by was a bit of an epiphany for me:
Reply Retweet Like
a11yEvangelist Feb 1
Replying to @addyosmani
I'm surprised this article never once covers the benefits of good documentation. If you make it easier to read and understand, it's suddenly more likely others will be able to adapt, improve, refactor, or enhance instead of throwing it all away.
Reply Retweet Like
Daniel Abromeit Feb 1
Replying to @addyosmani
Having complex thoughts on your own: easy peasy. Following a complex thought process and contributing to it: grab a snickers, you'll need that energy.
Reply Retweet Like
Cuyler Stuwe Feb 1
Replying to @addyosmani
One of the reasons why is that devs often get themselves worked into a frantic hyper-focused (coffee, energy drinks, adderall, etc.) state which leaves them prone to spinning cobwebs, and then try to read code in a “normal” state where “hyperfocused brain” is a human dependency.
Reply Retweet Like
Cuyler Stuwe Feb 1
Replying to @addyosmani
It’s similar to the quote commonly attributed to Einstein: “We cannot solve our problems with the same thinking that created them.” In order to effectively read unfamiliar code, you need to be in a mental state beyond what was required to write it.
Reply Retweet Like