this post was submitted on 16 Sep 2024
127 points (95.0% liked)

Programmer Humor

32571 readers
100 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS
 

top 6 comments
sorted by: hot top controversial new old
[–] Dunstabzugshaubitze 33 points 2 months ago

good Tester.

If something stupid can be done, it will be done.

[–] hellfire103@lemmy.ca 17 points 2 months ago

I've seen this enough times that I laughed without watching it. Funny stuff.

[–] deadbeef79000@lemmy.nz 15 points 2 months ago* (last edited 2 months ago) (1 children)

This is why it's important to have tests that assert a system's failure modes too.

shouldFitTriangleInTriangleHole()

shouldNotFitTriangleInAnyOtherHoles()

Bonus points for just parameterizing it.

[–] elvith 4 points 2 months ago
 assert triangleObject.shouldFitInHole(triangleHole) == true

assert triangleObject.shouldFitInHole(squareHole) == false
[–] pastermil@sh.itjust.works 10 points 2 months ago

Anything can be a square hole if you're brave enough.

[–] Dirk@lemmy.ml 9 points 2 months ago

If a function takes all types of variables it's your own fault!