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

Programmer Humor

24957 readers
1952 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 2 years ago
MODERATORS
 
all 50 comments
sorted by: hot top controversial new old
[–] BloodSlut@lemmy.world 85 points 2 years ago

"Typed language? Yeah, I'm using a keyboard."

[–] stevecrox@kbin.social 55 points 2 years 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 17 points 2 years ago (2 children)

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

[–] OsrsNeedsF2P@lemmy.ml 6 points 2 years 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 2 years 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.

load more comments (1 replies)
[–] mark@programming.dev 1 points 2 years ago* (last edited 2 years ago)

...or skip em

[–] fiah@discuss.tchncs.de 8 points 2 years ago

the beatings will continue until typing improves

[–] hubobes@lemmy.world 7 points 2 years ago

Eslint is your friend :)

[–] Uplink@programming.dev 7 points 2 years 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 5 points 2 years 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 2 years ago

You told them not to?

[–] van2z@programming.dev 13 points 2 years ago (1 children)

I am happy there is no obvious "any" type in Rust.

[–] Hexarei@programming.dev 2 points 2 years ago

There is, it's just not easy to use

[–] TheCee@programming.dev 11 points 2 years ago (1 children)

Yeah, at some point my new team switched off null safety, because some consultants told them to.

[–] BeigeAgenda@lemmy.ca 5 points 2 years ago (1 children)

Ride into the Danger Zone ...

[–] TheCee@programming.dev 4 points 2 years ago (1 children)

Indeed, and just as my old team fell for consultants, my new team also went ahead and let them add some overcomplex garbage into their codebases. And crap still keeps piling up. It's just like it's impossible for them to understand that from an average consultants perspective the only way to go forward is to keep adding complexity, wether they are aware of it or not.

[–] OsrsNeedsF2P@lemmy.ml 3 points 2 years ago (1 children)

Oh, the consultants know, but they get paid, don't complain about "risks" and "code debt", and management only sees their delivery on time without increasing operation costs

[–] TheCee@programming.dev 1 points 2 years ago

This. However, in our specific scenario dynamics were even slightly worse. In a first meeting said consultants apparently met some resistance but management decided to go through with it anyway. So in a later meeting, if I was the consultant, would I go and claim "Alright, I fucked up, got paid and got you gaslighted, but now we have to refactor to clean up our codebase with no immediate tangible benefit for your bosses" in front of everyone? Honestly, I don't think so.

[–] mvirts@lemmy.world 9 points 2 years ago

Does it compile???

... Compile???

[–] jdeath@lemm.ee 8 points 2 years ago (2 children)

i like when my strongly typed language can type itself, why should i have to type extra words because the compiler is stupid?

[–] Wats0ns@sh.itjust.works 16 points 2 years ago* (last edited 2 years ago) (2 children)

So that next time your coworker uses the wrong type, the compiler can scream at him: "NO I WONT COMPILE THIS YOU DUMBASS, LOOK JOHN SAID ON LINE 863 THAT IT SHOULD BE A DOUBLE, NOT A FLOAT FOR FUCK SAKE"

[–] jflorez@sh.itjust.works 4 points 2 years ago (1 children)

Tell me you are a Java dev without telling me you are a a Java dev 😂

[–] mark@programming.dev 0 points 2 years ago

As a JS dev, I can only wish we had those types 🥲

[–] jdeath@lemm.ee 1 points 2 years ago

you can still have that without having to declare the type manually. check out Swift or OCaml for example

[–] vithigar@lemmy.ca 4 points 2 years ago

And if you have linter rules preventing any as a boundary type you just use Record<String, any>.

[–] joel_anderson@lemmy.world 2 points 2 years ago (1 children)

I mean that is the first step. ¯_(ツ)_/¯ The next step is to start defining the types more strictly than any.

[–] mark@programming.dev 6 points 2 years ago* (last edited 2 years ago) (1 children)

Hmmm a more reasonable first step would be to just not even type anything until you're ready. But TS makes it hard to iteratively type parts of your codebase over time. One could type using JSDoc syntax for these cases, though.

[–] joel_anderson@lemmy.world 1 points 2 years ago
[–] ZILtoid1991@kbin.social 2 points 2 years ago

Well, you can always just add the type definitions later on.

I did port some C code to D, by just pasting it in a D file, then fixing the differences (changing type names, rewriting precompiler macros with D metaprogramming and inline functions, etc.).

[–] darcy@sh.itjust.works 1 points 2 years ago

typescript is not a strongly typed language