this post was submitted on 17 Jul 2023
518 points (97.6% liked)

Programmer Humor

19512 readers
315 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
 
you are viewing a single comment's thread
view the rest of the comments
[–] stevecrox@kbin.social 54 points 1 year ago (6 children)

I am currently teaching python and JavaScript devs Typescript. Everytime they hit a problem they switch to any

Sigh

[–] jubilationtcornpone@sh.itjust.works 16 points 1 year ago (2 children)

Must be the same people who just comment out failing unit tests.

[–] OsrsNeedsF2P@lemmy.ml 5 points 1 year ago (1 children)

"Your crappy tests are failing again on my branch. I've commented them out until you fix them."

[–] Hudell@lemmy.dbzer0.com 2 points 1 year ago (2 children)

Sadly that sort of thing got so common where I work that I'll run the tests three times before considering looking into the error message to see if it is something I broke.

From time to time we take some days just to fix tests with inconsistent results, but there's always more popping up.

[–] Darorad@lemmy.world 1 points 1 year ago

Yeah, we have a team whose job is to make sure all our tests run well and fixing them if they don't

[–] OsrsNeedsF2P@lemmy.ml -1 points 1 year ago

Serious answer: You can't write tests for untestable code. Your code needs to be pure if you want reliable tests: https://en.m.wikipedia.org/wiki/Pure_function

For integration tests, they should handle retries themselves

[–] mark@programming.dev 1 points 1 year ago* (last edited 1 year ago)
[–] fiah@discuss.tchncs.de 7 points 1 year ago

the beatings will continue until typing improves

[–] hubobes@lemmy.world 7 points 1 year ago

Eslint is your friend :)

[–] Uplink@programming.dev 7 points 1 year ago

That's why I kinda don't like Python and JavaScript anymore. Every time I want types for a library it's gonna take me time to get it working. For every serious project I do, I use a strongly typed language.

[–] jflorez@sh.itjust.works 6 points 1 year ago

Just create a al Inter rule that rejects Any types and a pre-commit hook that refuses the commit if the linter fails. Sometimes the brute force approach is the best way to teach

[–] jibz@burggit.moe 5 points 1 year ago

You told them not to?