3 ms·
Can someone please explain to me what it means to "read code"? I feel like the article said I should do it yet didn't explain what it is and how to do it. To
by throwaway84786 5y ago
Can someone please explain to me what it means to "read code"? I feel like the article said I should do it yet didn't explain what it is and how to do it.
To me, it appears a meaningless phase, like saying "think harder". It's something said in a good faith effort to be helpful, but unfortunately isn't. I wonder if the "meaning" is intended to be something like, "learn to understand code"? Yet that replacement isn't any more helpful. Can code be understood broadly? I don't think to can be.
I had a boss once who tried to emphasize, "you have to learn to read code". Some of the things he wrote were comprehensible to me, some not. He was a senior and I was a junior. He also once said to me, "I don't get what's special about Lisp". When I tried to explain about macros and metaprogramming, he said "but Python has decorators". I assume my boss could "read code". He could certainly write it, he demonstrated an ability to explain the workings of a new codebase, and claimed he could "read code". Yet he appeared to be lost about how Lisp macro programming differed from Python decorators. I could have explained it better. Regardless, this tells me that "reading code" is non-transferrable. So, maybe "read code" is meant as a shorthand for "develop mastery within the language at hand so that you can quickly understand new code presented to you". Again, I'm failing to see how this is helpful, actionable advice. No matter which way I try to understand it, "leatn to read code" feels like it amounts to being told "be more experienced".
- nso95 5y agoReading code in one paradigm doesn't necessarily transfer to other paradigms
- throwaway84786 5y agoAbsolutely, true, just as reading one natural language won't necessarily help you read another.
- mdtusz 5y agoReading code in one language in one codebase often doesn't even necessarily transfer to other codebases in the same language. I find this particularly true in academic python codebases and C++ for some reason where single letter variables and cryptic contractions in identifiers is the norm. It's truly a shame that overly verbose java-isms spawned widespread disdain for descriptive variable names - I think one of the easiest low-hanging-fruit to most codebases is just using proper descriptive names for variables and functions, and other updating them accordingly when their meaning or purpose changes.