News for hackers. Stuff that matters.
Re:You Want Modules, Not Microservices by sbergot on Tuesday January 03, 2023 @08:13AM (#34230905)
I disagree with this stance. Creating a file and naming it gives it a purpose. It creates a unit of change that tools like git can report on.
Re:You Want Modules, Not Microservices by nonethewiser on Tuesday January 03, 2023 @08:33AM (#34231064)
A line is a unit of change that git can report on.

If it's a separate file that is scoped to some specific concern, sure. But its tgat grouping by concern that is key. Not separation into another file. Extracting ra dom bits of code into separate files would be _worse_.

Re:You Want Modules, Not Microservices by swsieber on Tuesday January 03, 2023 @11:03AM (#34233165)
> A line is a unit of change that git can report on.

Yes and no.

Git doesn't store lines, it stores files. Git diff knows how to spit out line changes by comparing files.

So to run git blame on a 10k line file you're reading multiple versions of that 10k file and comparing. It's slow. Worse still is that trying to split said file up while trying to preserve history won't make the git blame any faster.

Re:You Want Modules, Not Microservices by karamanolev on Tuesday January 03, 2023 @12:33PM (#34234693)
Yes and yes. While agree with the general points, note that they didn't say "unit that git stores", but "unit git can report on". Git can totally report on lines as a unit of change.
Re:You Want Modules, Not Microservices by beagle3 on Tuesday January 03, 2023 @08:27AM (#34231017)
got diff understands function boundaries, and for many languages will “report” equally well on a single file.

It’s a good idea to break things down to files along logical boundaries. But got reporting isn’t a reason.

Re:You Want Modules, Not Microservices by joshuamorton on Tuesday January 03, 2023 @04:41PM (#34238490)
Git diff absolutely does not understand function boundaries, it's diff algorithms routinely confuse things like adding a single new function, thinking that the diff should begin with a "}", instead of a function definition.