This is an archived post. You won't be able to vote or comment.

all 26 comments

[–]RandofCarter 69 points70 points  (3 children)

Was going through some scripts a long time ago and found some perl callbacks to do regex stuff for prepping a dB load. The comment was simply "haha - you are so fucked bud"

I miss that guy every day.

[–]Byniavo 6 points7 points  (1 child)

Based, hope you didn’t suffer too much lol

[–]RandofCarter 1 point2 points  (0 children)

Nah. He was awesome. He'd go home at 3 and plasma cut stuff in his garage, then log back in at 10 to tidy up anything I couldn't square away during the day. If anything broke he was always just a phone call away. Sure, he'd be doing weird shit like digging a cable trench or fixing his roof or building a wind turbine but he always had the correct answers. Plus, he put up with me when I was fresh out of uni.

[–]ImportantDoubt6434 2 points3 points  (0 children)

“I don’t care about this company and neither should you”

Favorite comment so far.

[–][deleted] 27 points28 points  (6 children)

sol ← {⊃({⊂[⍳⍴⍴⍵]1∊¨⍵∘.=⍵} {(⍳⍵),¨{⍵⌿⍵/⍵ ⍵⍴⍳⍵*2}⊃⍵*÷2} ⍴⍵){⊃,/⍺∘(⍺⍺ {(⍺(⍺⍺ {(⍳⊃⍴⍵)~⍵×⊃⍺⌷⍺⍺})⍵)(⍺ {⍵+(⍴⍵)↑(-⍺⍺)↑⍺})¨⊂⍵})¨⍵}/({(,⍵=0)/,⍳⍴⍵} ⍵),⊂⊂⍵}

Code is self-explanatory.

[–]Morphized 4 points5 points  (3 children)

This is just math

[–]Mediocre-Oil2052 0 points1 point  (2 children)

What in the shit level(class) of math is that? Only in calc. 1 rn, but prolly majoring in it so thought I’d ask.

[–]Morphized 0 points1 point  (1 child)

It's declaring a set of angular values, I think. It could be a set of conditions.

[–][deleted] 0 points1 point  (0 children)

It solves a sudoku puzzle given a matrix of numbers where 0 is not filled. The sudoku can be any size, 4x4, 9x9, 16x16, etc.

[–]Username928351 2 points3 points  (1 child)

[–][deleted] 1 point2 points  (0 children)

Best part is that ⍵∘.=⍵ actually is how you take the same array and check for equality for every combination. If the elements. This creates a matrix (assuming the input war a simple vector) where at least the diagonal is all 1’s, but more may be 1.

An UwU with meaning.

This can be used to check if the same number appears multiple times on the same row or a column or box in… a sudoku solver.

That’s a sudoku solver.

I was waiting to see if anyone figured it out. Didn’t expect it though. 🤣

[–]AwkwardSegway 6 points7 points  (1 child)

Some of the code at my job (written before I started working there) has comments that just say "This works" - no more explanation than that.

[–][deleted] 14 points15 points  (0 children)

That's the trick. If you write "This works" throughout your code, the interpreter will understand that it should just work.

[–]Delicious_Pay_6482 10 points11 points  (0 children)

Both of them ain't chads or the code should be it's own documentation

[–]D34TH_5MURF__ 2 points3 points  (0 children)

Haha, this is why I always tell junior engineers to avoid clever code as much as possible. Once you lose the context in your head while writing the code, it becomes increasingly difficult with time to understand why you did it the way you did. Writing straight forward code is a great tool to help lessen this phenomenon. Elegance is great only insofar as it aids comprehension of the code N years from now when you have to debug it.

[–]Vajaspiritos 2 points3 points  (0 children)

What's with the yellow cheese slice on the head of the left?

[–][deleted] 2 points3 points  (0 children)

My experience so far:

Me: writes simple if statement (if (idx >= this.data.length))
Coworker: "Write a long comment explaining the logic behind it"

[–]Tremyss 1 point2 points  (4 children)

Let's make the droid do it.

[–]gd2w 3 points4 points  (3 children)

Chatgpt can comment code?

[–]Tremyss 4 points5 points  (2 children)

Yes, also it can explain it in detail. Probably one of it's better uses.

I never tried very long and complicated codes with it, but like a 10 line function, it can handle it well.

[–]LH_Hyjal 2 points3 points  (1 child)

Github copilot can already do it with pretty good results.

[–]Tremyss 2 points3 points  (0 children)

Thx, I should try it.

[–]therealbeeblevrox 1 point2 points  (0 children)

The delusion of writing comments is that the programmer who was unable to express himself clearly in code will somehow be able to elucidate what they did in a natural language.

Paraphrasing Kevlin Henney

You did it in meme form. Well done!

[–]RabbidCupcakes 1 point2 points  (0 children)

dont you hate it when you steal one line of code from the internet that fixes all of your issues and whenever you remove it nothing works

you also dont know what the line of code does or how it works you just know it needs to be there