News for hackers. Stuff that matters.
Re:Ask HN: What techniques do you use to understand and simp... by throwawaysalome on Thursday March 09, 2023 @07:05AM (#35080426)
A common two-bird-with-one-stone approach of experienced programmers is to rewrite the code to fewer lines, and to condense long-winded comments. This not only aids understanding, but also imparts ownership to the rewriter.

This approach often generates ill will, but eff them.

Re:Ask HN: What techniques do you use to understand and simp... by zubairq on Thursday March 09, 2023 @07:29AM (#35080537)
Yeah, I've done this a few times, and it really helps with my understanding of the code. Often I have found that colleagues or managers view the time as wasted, and I get comments such as "Why did you waste time rewriting that code?", and my replies of "So I could understand it and make the code clearer at the same time" falls on deaf ears. But definitely a good technique, thanks for tip :)
Re:Ask HN: What techniques do you use to understand and simp... by sophonX on Thursday March 09, 2023 @07:54AM (#35080686)
That's a good suggestion for small to medium codebase. In huge codebase, it's not feasible but explaining to others (like colleagues or interns or friends(oss repos not proprietary stuff)) usually helps me a lot.

Like talking to a duck.

Re:Ask HN: What techniques do you use to understand and simp... by zubairq on Thursday March 09, 2023 @10:25AM (#35082134)
Most colleagues (even developers) walk away in boredom as soon as the discussion gets too deep. I do understand though as they are happy to help me, but when it gets too deep they feel they are doing the work for me
Re:Ask HN: What techniques do you use to understand and simp... by sophonX on Thursday March 09, 2023 @07:02PM (#35088657)
Oh, that's sad. Most of the time, even if the other person isn't listening - it usually helps at lot talking out, you know - just clears up thoughts.
Re:Ask HN: What techniques do you use to understand and simp... by zubairq on Friday March 10, 2023 @01:59PM (#35099233)
Yes it definitely helps me when I try to explain it, so that’s something
Re:Ask HN: What techniques do you use to understand and simp... by kwertyoowiyop on Thursday March 09, 2023 @08:51AM (#35081112)
Remember: if you rewrite it, you own it.