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 Code Snobs Are Invaluable

69 pointsby ignacesabout 10 years ago

18 comments

picks_at_nitsabout 10 years ago
Consider a colleague who constantly objects to non-idiomatic variable name casing (snake_case_in_ruby, camelCaseInJavaScript, dashes-in-lisp, scheme-predicates?, &amp;c.)<p>When you first get a comment like this, it may feel like friction. After all, the code works. The cost of holding up a deploy and changing your code feels all out of proportion to the benefit. And it’s easy to extrapolate this: “If I get this objection to every pull request, I’ll never get anything done!”<p>But you don’t need to get this objection to every pull request. If the objection has some merit, no matter how trivial, you can change your naming, and never hear this objection again.<p>And the entire code base will be a little bit better. Your change is for now, a little bit better is forever, and everyone changing the way they name variables to be a little bit better adds up to a lot better.<p>And so it is with other forms of code snobs. Although it may feel like it’s not worthwhile to change the code today, if it’s a meritorious objection, then the right thing to do is change it and learn to write it that way the first time around, to develop a habit of writing it that way.<p>And then everyone will end up being a little bit better. And with every new commit, the code will get better. And that adds up like compound interest into making the code a lot better.
评论 #9113753 未加载
评论 #9114981 未加载
评论 #9115569 未加载
taericabout 10 years ago
I&#x27;m fine for code snobs. I just despise swimming against the tide in tooling and formatting. If you care enough that the code look a certain way, make sure this way is a few keystrokes away for any developer using standard tools.<p>Then there are those that insist on highly flexible and overly engineered solutions. Yes, they got it to work. No, they aren&#x27;t doing any favors to anyone that was wanting to pick up the code and make changes. (Been there, done that. On both ends.)<p>Basically, if you encounter a large amount of friction for every new contributor to your codebase. Consider that the source of that friction is not necessarily the &quot;low quality&quot; of the contributors.
评论 #9113833 未加载
gumbyabout 10 years ago
The last sentence is key: &#x27;Perhaps a &quot;code snob&quot; is simply the term lazy programmers use to describe their more disciplined peers.&#x27;<p>If your colleagues really are your peers -- in that you trust each other, don&#x27;t get pissed off when someone else makes a stupid comment, or when someone points out (hopefully politely) that <i>you</i> made a stupid comment -- then &quot;code snob&quot; is a joke term.<p>If you aren&#x27;t lucky enough to have fallen into one of those high performance teams, then both types exist: the helpful code snob and the condescending one. The latter isn&#x27;t help at all.
评论 #9114058 未加载
jemfinchabout 10 years ago
Singletons were perhaps the worst possible example of code snobbery: code snobs (<i>real</i> code snobs, as in &quot;no true code snob&quot;) typically detest the singleton pattern as less maintainable, less testable, and less flexible than dependency injection.
评论 #9113977 未加载
评论 #9113811 未加载
pekkabout 10 years ago
Code review is really useful. People should listen to reviews of their code, even if they&#x27;re arguable, for the sake of team harmony and having a system of checks and balances.<p>But a &quot;code snob&quot; is not necessarily correct just because he is a snob and sounds confident. There is sometimes a calibration problem where someone is trying hard to enforce practices which are actually wrong, or argues vehemently against things which are normal and okay. This is actively counterproductive and it would be better just to have less enforcement.<p>One way to check for this calibration would be to ask whether the snob is advocating something that will obviously benefit people beyond the snob objectively, e.g. fewer broken builds or adhering to a widely used standard style. A useful reviewer isn&#x27;t just pushing his own agenda.
eldavidoabout 10 years ago
It depends a lot on your mentality toward writing code. I find matching the long&#x2F;short-termness of engineering practice to the overall mentality of the organization results in the least friction.<p>Concrete example: if you&#x27;re building a system to last 5-10 years, act like it. Spend time getting the architecture, the variable names, and the module structure correct. But realize not everything must be built to last. I read somewhere else on HN that some groups inside of Google plan a piece of code to handle 10x growth in traffic&#x2F;storage&#x2F;resource use before it&#x27;s thrown out outright and rewritten -- so don&#x27;t overdesign.<p>Maybe the real lesson is to invest in sufficiently good modularity that it&#x27;s easy to throw things out without too much pain. Nothing lasts forever.
评论 #9115155 未加载
评论 #9114175 未加载
wmilabout 10 years ago
It depends what you mean by code snob... I&#x27;ve had a dev replace large section of my code with &quot;cleaner&quot; code that didn&#x27;t work in all cases, comment out the failing tests, then push that.<p>Some people are convinced that making components isolated and aesthetically clean is more important than making them functional.
评论 #9114138 未加载
评论 #9114279 未加载
评论 #9114054 未加载
dkarapetyanabout 10 years ago
What about type theory weenies? The title is also a little link-baity. The person commenting on his pull request was not being a snob. He was making sure there was architectural coherence across the board. When codebases grow large having an idea of the overall architecture becomes an invaluable resource and the more consistent the codebase the easier it is to make sense of the architecture.
评论 #9114483 未加载
评论 #9114573 未加载
评论 #9116160 未加载
andhof-mtabout 10 years ago
But your thinking like a programmer. Some times it is also valuable to think like a business.<p>What is the goal of this software? Ship now? MVP?<p>Are we trying to polish the software? Or just get it to work? Is it a prototype?<p>Some thoughts to take into consideration.
评论 #9114446 未加载
jquastabout 10 years ago
I work very hard to have <i>tools</i> reject pull requests as much as possible. For python I am making good use of <a href="https://github.com/landscapeio/prospector" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;landscapeio&#x2F;prospector</a> to enforce pep257 and pep8 compliance. It also catches a lot of things (through pylint and frosted&#x2F;flake8) that humans often do not, such as unused variables.<p>The advantage is that tools reject the pull request, and not a person. It doesn&#x27;t harm ego to be rejected by a tool.
j_sabout 10 years ago
It is nice to be able to point to a static code analysis tool and&#x2F;or project guidelines to shift the discussion away from anyone&#x27;s interpretation of best practices.
goshxabout 10 years ago
Well, I guess there is a need for a single definition of what a &quot;code snob&quot; is.<p>In OP&#x27;s example, the singleton is a design pattern, not a coding standard. It should be used if it is applicable to the scenario, as it seem like it was.<p>Other people here in the comments are talking about &quot;code snobs&quot; as people that like to follow certain coding standards. IMHO, coding standards should be defined by the entire team and everyone has to follow. There is no way to have a consistent code without that, so it is not about being snob, it is about having a consistent codebase.<p>Now, if there are coding standards or an architecture defined but someone wants to use a different one because they want to be snob about it, then you have a problem. If there is a standard, let&#x27;s say a naming convention as a simple example, and someone wants to change it at some point, you either have to change everything else to follow the same new standard, or don&#x27;t start a new standard at all. Otherwise you are not resolving the original issue, you are simply making it worts by having more than one standard in your code base.
joesmoabout 10 years ago
Suppose that in the example given, changing the existing classes to <i>not</i> be singletons was just as valid as changing the new ones to be singletons. Or there was a good reason for the new classes not being singletons that the code reviewer did not understand. In these cases I&#x27;d call the reviewer a code snob. I don&#x27;t think the reviewer in the example given is a code snob. A code snob to me is one who asks for or makes changes that have no benefit except to himself and might even be detrimental to the project. Since all changes do take time, the benefit of the changes absolutely need to outweigh the time spent making them for them to be valid.
klagermkiiabout 10 years ago
I certainly support any drive for code that is cleaner or more consistent, I just feel like for every good &quot;code snob&quot; there are a lot of &quot;code snobs&quot; that are basically just bikeshedding.<p>By that I mean that they don&#x27;t know how to fix poorly structured code, suggest a better algorithm, or improve the interface... but they still want to feel and look useful, so they instead burn a lot of time finding relatively trivial things to change.
richardlblairabout 10 years ago
Where I work we keep on each other about nitpicky things, but when we do it, we declare it. You will frequently see &quot;Nitpick: don&#x27;t like the variable name. Maybe try &lt;somethingLessCrappyThanWhatTheyWrote&gt;&quot;<p>And you know what? No one complains. If you don&#x27;t want nitpicks, conform to the coding standard of the place of which you work. It is _their_ code after all.
serve_yayabout 10 years ago
My experience tends to agree. A lot of things done in the name of not being a snob are really just laziness, the bad kind. And I know my own act shaped up almost instantly when I switched jobs and found myself surrounded by such folks.
Kiroabout 10 years ago
OT but when do you need singletons in JavaScript?
评论 #9116877 未加载
TEMPLEOS_DEVabout 10 years ago
Depends on whether they have personality disorders.