Hacker News new | ask | show | jobs
by Terretta 1300 days ago
First two of these examples may be on the religious or yak shaving end of debates, where the best practice is probably not an absolute.

1. There are code bases and PRs where coalescing many small changes into one "this changes how we do this" commit is encouraged when it's a semvar level change requiring coordinated edits to keep working, rather than a purely iterative change.

2. Most research shows universal unit test coverage is lower ROI than judicious coverage of intefaces and risks.

If many of your discussions fall in this zone, it's possible you, yourself, may be taking guidelines as too black and white.

Meanwhile ...

3. That one is just bad.

3 comments

> If many of your discussions fall in this zone, it's possible you, yourself, may be taking guidelines as too black and white.

I have very mixed feelings about this. On the one hand, I’m no fan of following process for the sake of it.

On the other, the way to address policies that need an update is to sit down with the lead/manager and propose changes with evidence as to why.

Deciding to just do things your way and then arguing about it is not the way.

If you can automate the rules, do it. If you can’t automate the rules, don’t try to enforce them, just ask why.

I worked at a place where 10k LoC PRs were the norm. At my next place, I’d open a 1k PR and people would lose their shit. They’d ask for it to be broken up into smaller PRs and my response was “it’s already ridiculously small”

Personally, I’d rather see the big PR and spend time reviewing that than trying to figure out what they’re trying to set up and do. As long as the big PR is coherent and well-written. If it’s spaghetti monster, I’ll pass.

I mostly agree due to the nature of not all code is straight up assembly/c/cpp, LOL. Knowing your target audience is key. In this case the team size, company size, ect.

I would be okay with larger PRs especially for configuration as code like ansible and terraform hcl. Hoping that people actually use comments and keep code chunks in relevant sections (I've begun paraphrasing ansible to use more whitespace between different "sections". This of course becomes more acceptable when one playbook or hcl folder is copied to another area for promotion purposes, but of course using tooling to check for diffs is crucial here.

IME it’s pretty much impossible to change rules adopted by a bureaucracy if you are just a cog.
Do you have source on item #2? I've been looking for some to back this point, but can't find any.
I would honestly find #3 a tough pill to swallow as well, and where do you draw the line? If I copy a line of `arr.map()` and use my own variable names does that count? Direct copying from SO can be bad generally but also adding all the license hoop jumping overhead just seems annoying.

The first two are fine though as long as there is room for interpretation, but if the person is pushing back every single time that’s just obnoxious.

The "license hoop jumping overhead" is a legal requirement. If it ever comes out that your software contains code copied from some random web site, you're asking for a copyright infringement lawsuit. If you stick GPLed code in your code base, then your entire codebase is GPL and you're required to give away the source code on request. Even if something is MIT or BSD or similar license, you probably need to give the author credit in your software (this is why so many games have an "Open Source Licenses" option where you can read the licenses of various open source libraries they stuck in the game). If you forget to credit the author of the MIT licensed library you used, that's also a potential lawsuit.

In short, don't play loose with software licenses. The legal system has about as much interest in debating whether a company has to follow intellectual property laws as the tax collection agency does in debating whether you have to follow tax laws.

Yes I do understand the legal requirement for these kind of things, I was more trying to be understanding of why there was push back from the person the OP is describing. I also think anyone would be hard pressed to find an engineer who has _never_ copied anything from SO without attribution.
Plenty of us coded before SO, but I think you're being too general. Using SO to see examples of syntax is completely different than copying a chunk/function/page of original code someone wrote to solve a problem.
I absolutely have never put stack overflow code into a prodiction code base and I dont think Ive heard anyone talking about or seen anyone do that. I dont think that is typical all.

I use stack overflow to understand a concept or a technique frequently, but always type my own code from scratch.