this post was submitted on 06 Jul 2024
1510 points (99.4% liked)

Programmer Humor

19149 readers
1127 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
[–] Aux@lemmy.world -1 points 2 months ago (1 children)

Hard disagree - that's just dumb:

// Calculates tax
function calculateTax() { }
[–] uis@lemm.ee 10 points 2 months ago* (last edited 2 months ago) (2 children)

Hard disagree - that's very helpful:

// Calculates Personal Income Tax by formula from section 1.2.3 of tax code. Other taxes like VAT are not calculated.
function calculateTax() { }
[–] potustheplant@feddit.nl 5 points 2 months ago

This guy gets it.

[–] Aux@lemmy.world -4 points 2 months ago (2 children)

If it calculates personal income tax, just call calculatePersonalIncomeTax.

[–] plecks@programming.dev 2 points 2 months ago (1 children)

Is that state, federal, or combined?

[–] Aux@lemmy.world 0 points 2 months ago
[–] uis@lemm.ee 2 points 2 months ago (2 children)

Why not calculatePersonalIncomeTax123 then?

[–] usernamefactory@lemmy.ca 3 points 2 months ago

I'm a new developer. Is that referring to page 123 of the in-house documentation? Version 12.3 of the code? I have no clue.

You'd have to call it something like calculatePersonalIncomeTaxPerTaxCodeSection1_2_3, but I get exhausted just looking at that. There comes a point where the cognitive work of reading crazy long camel case names is more trouble than it's worth.

An explanation of what specification a function was written to implement is a perfectly appropriate comment. Could be improved by a direct link where possible. But it's worth noting what that comment isn't doing - specifying any implementation details. For that, I really can just read the code.

[–] Aux@lemmy.world 1 points 2 months ago

Yeah, why not?