Email or username:

Password:

Forgot your password?
Dr. Quadragon ❌

I think, the most valuable skill for a developer or project manager is to learn to throw stuff out.

I now work with a guy who's a major code hoarder, and whom I fight tooth and nail for every piece of shit in the repository, regardless if it's referenced elsewhere or not.

And some of this shit is not just dangerous, but outright flammable. I found 148 unescaped SQL selects over the whole project.

At this point "being hacked" is less of a "cybercrime" and more like a "natural selection" sort of thing. Like leaving your password on a post-it note on your desk or something.

15 comments
Dr. Quadragon ❌

By the way, what I respect about Go - is that it strives to exclude the situation where you have unreferenced entities. If you're gonna import a lib, or declare a variable, or whatever else, you MUST use it somewhere down the line, otherwise the project just wouldn't build.

I love it when the tools are built in such ways that they shape good habits. Mandatory indentation is one of the reasons I loved Python so much.

yesfreenet

@drq
Probably ; liked it a lot, too.
I wonder if 'life' really depends on the space bar there? 😅

Christian Espinoza

@drq What it's awful IMO in Go it's that to export something from a module you need Capital letters, years of hating that.

loonycyborg
@drq
C++ has warnings about unused variables too, and that stops any project that uses -Werror from building.
Dr. Quadragon ❌

@loonycyborg
> warnings

Warnings are nothing.

Warnings are inconsequential.

Warnings are easily ignored.

Warnings don't shape behaviors.

Dr. Quadragon ❌

@loonycyborg
It's the case of the same old "rules are meaningless unless enforced".

Yes, you *could* build with -Werror flag on, but you also could *not* do that. It was opt-in, completely ignorable.

But with newer tools opting to enforce those rules globally and universally, this also carries new meaning.

Dr. Quadragon ❌

I'm picking apart my client's codebase for refactoring. As expected, there's a lot of duplicates.

But duplicates are easy. fdupes lists them quick. The real, actual problem is near-duplicates! The files that differ by couple of lines, but otherwise are identical. How do I find them? Is there any tool for that?

hkc (Carbonated)

@drq czkawka works great for images and some other files, not sure about text tho

hkc (Carbonated)

@drq just checked, nothing about text similarity checks. I guess you can try checking each file with others using `diff` but that gonna take a while

Or you can just throw files away until it breaks :blobfoxgooglymlem:

Dr. Quadragon ❌

@hatkidchan I'm not comparing 4587 files manually unless I'm paid VERY large amount of money.

Moana Rijndael 🍍🍕

@drq
0) generate all possible pairs of files
1) generate diff
2) if diff has too few lines, print a warning with diff
3) otherwise, check next pair
ofc this should be done by script

:ageblobcat:

@hatkidchan

Moana Rijndael 🍍🍕

@drq do it in parallel then, shell has tools for that :ageblobcat:
Anyway, tools for findind duplicates works somehow???

@hatkidchan

Enigma Voice

@drq
4587!/(2*4585!), actually, which means 2293*4587.
Still a lot, yes.

@mo @hatkidchan

Go Up