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.

Why most programmers hate code that they don't write?

4 pointsby grillorafaelabout 9 years ago
Hi!<p>I work as a Front End developer in Dublin and I was wondering the following:<p>- All companies that I worked, I never saw a programmer saying good things about someone else&#x27;s code.<p>Since I realised this thing, I always look at someone else&#x27;s code in a different way. I try not to thing of how bad the code actually is but I try to criticise architecture problems and things that might be optimised. Not the code itself.<p>What I say about not the code itself would be something like:<p>Trying to avoid to criticise micro optimisations and&#x2F;or things that I know it is bad but I do it anyway for reasons that might be due to time constraints.<p>The thing is, It is very easy to criticise someone&#x27;s code but it is very hard to at the same time have a great code quality AND meet all constraints to deliver that.<p>And the point is, at the end, someone will look and still think it is bad.<p>I would like to know your thoughts about this problem and how to address them in a better way.

3 comments

greenyodaabout 9 years ago
<i>&quot;All companies that I worked, I never saw a programmer saying good things about someone else&#x27;s code.&quot;</i><p>I think that this may have to do with the fact that reading code (even code that you yourself wrote a while ago) is harder than writing code. When you&#x27;re writing code, you have an image fresh in your mind of what you want to create, but when you&#x27;re reading code, you&#x27;re struggling to build up a mental model of what that code does. And if, because of this, you perceive the other person&#x27;s code as being harder to understand, it might bias you into thinking that it&#x27;s bad code.<p>People who have a lot of programming experience become better at reading other peoples&#x27; code - it&#x27;s a learnable skill, like sight-reading music.<p>I read a lot of other peoples&#x27; code, and I find code that&#x27;s all over the spectrum: worse than mine, about the same as mine and better than mine (sometimes a lot better). I have co-workers who write sloppy code and other co-workers who write very clean code.<p>A programmer who has never seen code that they can say good things about is probably fairly inexperienced (hasn&#x27;t read very much code in their life).
评论 #11340581 未加载
JoeAltmaierabout 9 years ago
Levels of experience vary all over the map. Orders of magnitude differences. When experienced people get called in to deal with problem code, it&#x27;s most likely been written by someone with less experience. There is very often room for critical comments. Just statistics.
评论 #11340471 未加载
评论 #11340481 未加载
askRichabout 9 years ago
There are multiple different psychological theories that might explain why we dislike code that we don&#x27;t write. I do agree it is an interesting thing to think about.<p>Two that I can immediately think of are<p>1. Ikea Effect(1) - We place a higher value on things we create vs. things we didn&#x27;t create<p>How it applies: We place more value on code we wrote compared to what others wrote.<p>2. Fundamental Attribution Error (2) - We tend to look at our own accomplishments as evidence of our own ability, and our failures as events caused by external influence. When it comes to others it&#x27;s the reverse, we look at others accomplishments as the result of external events, and their failures as evidence of their internal lacking of ability<p>How this applies: Let&#x27;s face it, if you&#x27;re working as a software developer, you don&#x27;t always have the time to write 100% perfect code (which is not an excuse to write bad code) but a reason why we often settle for &quot;good enough&quot; code. We probably accept this rationalization when reading our own code but are less lenient when reading others code. This then frames their judgment of the code in a negative light. &quot;I hate this code because the developer took shortcuts&#x2F;didn&#x27;t do things the right way... &quot; Even though we do the same.<p>3. Mere Exposure Effect (3) - We like things we&#x27;re familiar with.<p>How it applies: Since we wrote our code, know how it works (most of the time right...) and what we were thinking when we wrote it, that familiarity is pleasurable vs code that we don&#x27;t know how it works (yet), and have less of an idea of the mindset that the developer had when writing it.<p>Those are just a few... there are probably more theories you can apply to this problem but I do agree it&#x27;s a real thing.<p>[1] <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;IKEA_effect" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;IKEA_effect</a><p>[2] <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Fundamental_attribution_error" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Fundamental_attribution_error</a><p>[3] <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Mere-exposure_effect" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Mere-exposure_effect</a>