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: What tricks have made you a better programmer?

9 pointsby newsoulover 2 years ago
For me it was:<p>1. Writing out input output relations for a function with quite a few examples before actually starting to write the function. Basically writing tests. It makes you realise what the function is actually supposed to do. I learnt this from How to Design Programs (htdp) book. It was a game changer.<p>2. Working on Fermi Problems aka Street Fighting Mathematics. I learnt from the books of Sanjoy Mahajan. They made me much better at estimating how the output to some input may be like.<p>What about you?

7 comments

ArcMexover 2 years ago
Before I knew that there was an actual term for it[0], I would get a blank piece of paper, pretend I was an esteemed professor teaching whatever it was I was trying to accomplish. I would &quot;ask my students&quot; questions and &quot;hear their answers&quot;. Then I would &quot;guide them to the correct path&quot;.<p>0 - <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Rubber_duck_debugging" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Rubber_duck_debugging</a>
评论 #34842349 未加载
favourableover 2 years ago
Code really badly, and feel no shame in that. Then after the sloppy code has been understood, you can start to iterate on it and polish it, making your code seem professional, but you know you started the project as a total noob.
评论 #34842331 未加载
rudasnover 2 years ago
Read the error message. In full. Google unknown terms, relevant phrases from the message. Don&#x27;t fix the bug unless its cause is understood.
评论 #34848786 未加载
greenyouseover 2 years ago
- getting used to designing abstractions before coding<p>- laying out how I&#x27;m going to program before starting<p>- using TDD for most bug fixes and refactoring efforts<p>- learning how to steal the best parts of code from other people<p>- code reading everyday via PRs (my mental VM is pretty close to a real VM)<p>- learning algorithms and data structures (at least the basics, I&#x27;m no competitive programming pro)<p>- learning how to do code archaeology with git blame
mattbgatesover 2 years ago
Writing code constantly and with each new product, how do I get it out faster and in less pages? This has made me a better programmer. I aim to try and get projects done from 1 weekend to 1 month and not take too much longer than that.
kbranniganover 2 years ago
Thinking at the function level. Instead of thinking: view, controller, Service , database .<p>I write a function that does what I’m trying to accomplish, like image upload.<p>It’s a small part that can be reused in some bigger system.<p>Then make it work with a few constraints: file size, file type.<p>I also hardcode stuff
评论 #34839461 未加载
chewzover 2 years ago
Writing programs...