230
submitted 3 weeks ago by Thelie to c/[email protected]
all 21 comments
sorted by: hot top controversial new old
[-] [email protected] 67 points 3 weeks ago

A MONAD IS A MONOID IN THE CATEGORY OF ENDOFUNCTORS

[-] Thelie 12 points 3 weeks ago

Wow you sound so smart!

[-] [email protected] 36 points 3 weeks ago

Typical Computer science vs typical computer engineering

[-] Thelie 10 points 3 weeks ago

Inside me are two wolves I guess…

[-] gravitas_deficiency 5 points 3 weeks ago

Chief O’Brien:

Sorry about that transporter malfunction, sir! Won’t happen again!

[-] [email protected] 29 points 3 weeks ago

I have to say, I'm getting more and more frustrated by the bad code I have to write due to bad business circumstances.

I want clean, readable code with proper documentation and at least a bit of internal consistency and not the shoehorned mess of hacks, todos and weird corner cases.

[-] [email protected] 13 points 3 weeks ago

todos

I found a simple trick against this: just remove them. Accept it ain’t gonna happen man.

[-] [email protected] 5 points 3 weeks ago

Well, yes, but the underlying issues still persist, so it's not exactly a sustainable strategy.

[-] [email protected] 3 points 3 weeks ago

It’s mostly a joke, but often when I find todos they’re so old they’re no longer relevant.

Of course you shouldn’t blindly remove todos.

[-] [email protected] 1 points 3 weeks ago* (last edited 3 weeks ago)

Don't just put "TODO". If they're in the final pull request, they need to mention a ticket that's intended to fix that TODO. If you/your team decides it's not important, then remove it and close out the ticket. Either way, you're required to do something with it.

[-] [email protected] 14 points 3 weeks ago

Rust mentioned!

[-] [email protected] 7 points 3 weeks ago

At least the code on the bottom is actual code and not just signatures

[-] [email protected] 5 points 3 weeks ago

Instead of

if let Some(a_) = a{
    ()
} else if let Some(b_)=b{
    ()
} else {
    dostuff 
}

you could just use

if a.isNone()&&b.isNone(){
    dostuff
}

Also if you don't use the value in a match just use _

[-] [email protected] 4 points 3 weeks ago

Also you can use enums insteas of string literals

[-] Thelie 1 points 2 weeks ago

I'm not sure how I would go about this in an elegant way since I'm matching the string I get from a message…

[-] [email protected] 1 points 1 week ago

If the message used enums for actions/procedures like SPAM_MEMES, then using enums would be more performant

[-] Thelie 2 points 2 weeks ago

That's a good point, thanks. Maybe I'll go without the if entirely, the (janky) code is still very much in flux ;)

[-] [email protected] 2 points 3 weeks ago

is this a section of a discord api implementation?

[-] Thelie 2 points 3 weeks ago* (last edited 3 weeks ago)

Almost, but not quite. It's built against Presage

[-] [email protected] 1 points 1 week ago

I don't nearly know enough to understand this but is anyone willing to help me get the thing on the top :>

this post was submitted on 11 Jun 2024
230 points (96.7% liked)

Programmer Humor

18240 readers
19 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 1 year ago
MODERATORS