TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: Tips for Memorizing Code?

1 pointsby toomanyducksabout 4 years ago
My DSA class requires I memorize <i>both</i> algorithms and code for algorithms. While it&#x27;s my understanding that memorizing algorithms is where I should put most of my effort, I lost a substantial amount of points on last semester&#x27;s final for not knowing code (even when I knew the corresponding algorithm). Does anyone have any techniques to memorize code?

2 comments

siminmabout 4 years ago
Memorizing code seems ridiculous. If you remember the algorithm you should be able to derive the necessary code for that. If you use a different variable name, or a while-loop instead of a for-loop will it be &quot;wrong code&quot; ?
new_guyabout 4 years ago
Don&#x27;t try so much to memorize them as <i>understand</i> them.<p>If you have a solid understanding of what the algorithm does and how it does it, then it becomes trivially easy to memorize the corresponding code, or just rewrite it from scratch, because you know what it&#x27;s meant to be doing.<p>Also spaced repetition, come back to it every few days until you&#x27;ve got it all down.