this post was submitted on 17 Jun 2025
182 points (97.9% liked)

Programmer Humor

37520 readers
341 users here now

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

Rules:

founded 6 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] AmazingAwesomator@lemmy.world 29 points 1 month ago (7 children)

the fact that these are strings instead of an object that is broken up by country code, area code, and number makes me irrationally angry.

[–] wizardbeard@lemmy.dbzer0.com 27 points 1 month ago* (last edited 1 month ago)

Could be tests for a parser to convert it from string to object.

Not like your end users are going to type each piece into a separate field.

[–] gandalf_der_12te@discuss.tchncs.de 22 points 1 month ago (1 children)

i think you think that telephone numbers are well-structured. they are not. they are messy. they do not fit a certain schematic.

I recommend also the following topic: "people have names". https://www.kalzumeus.com/2010/06/17/falsehoods-programmers-believe-about-names/

Names do not in general fit into the schematic "first name, last name"

[–] CanadaPlus@lemmy.sdf.org 3 points 1 month ago* (last edited 1 month ago) (1 children)

Is there not a "falsehoods programmers think about phone numbers" yet?

Edit: And once again, I'm still confused about some of these. Do we need to expand unicode for names? It's supposed to be universal. WTF is up with 40?

[–] gandalf_der_12te@discuss.tchncs.de 2 points 1 month ago* (last edited 1 month ago) (1 children)

WTF is up with 40?

People have names.

I suppose that a counterexample to this might be Tibetan children, who get named at puberty, IIRC. Before that, they have no names. They are just referred to as "child" or "somebody's child".

People’s names are all mapped in Unicode code points.

I suppose a counterexample to that might be cultures which do not use script in general. Then, obviously, there's no Unicode characters for these non-existant glyphs.

[–] CanadaPlus@lemmy.sdf.org 1 points 1 month ago

Ah, so it dovetails with the whole "children get a name reasonably fast" thing. I was interpreting that as "ever, in a natural lifespan". My bad, haha.

I suppose a counterexample to that might be cultures which do not use script in general. Then, obviously, there’s no Unicode characters for these non-existant glyphs.

True, but there's little risk of a name being entered into a form without some kind of transcription.

[–] JackbyDev@programming.dev 11 points 1 month ago

You absolute buffoon. How do you figure this code isn't testing how to parse a string into such an object??

[–] MyNameIsRichard@lemmy.ml 5 points 1 month ago (1 children)
[–] AmazingAwesomator@lemmy.world 7 points 1 month ago

microsoft java :p

[–] HiddenLayer555@lemmy.ml 3 points 1 month ago

Better than an integer at least.

[–] ddplf@szmer.info 3 points 1 month ago

You seem to enjoy overengineering your code, don't you?

[–] Clent@lemmy.dbzer0.com 1 points 1 month ago

"The number" is itself two parts hence the dash. The first section being the prefix and the last part being the line number.