this post was submitted on 26 Aug 2024
1186 points (99.2% liked)

Programmer Humor

19572 readers
1091 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
 
top 50 comments
sorted by: hot top controversial new old
[–] [email protected] 113 points 2 months ago* (last edited 2 months ago) (14 children)

Why are they even named like this?

When I read code, I want to be able to read it.....

Is this from a time when space was expensive and you wanted to reduce the space of the source files on the devs PC???

For me (with a native language != english), this made it a lot harder to get into programming in the first place.

[–] lukstru 86 points 2 months ago (3 children)

I recently held a science slam about this topic! It's a mix of the first computer scientists being mathematicians, who love their abbreviations, and limited screen size, memory and file size. It's a trend in computing that has been well justified in the past, but has been making it harder for people to work together. And the need to use abbreviations has completely gone with the age of auto completion and language servers.

[–] [email protected] 60 points 2 months ago (6 children)

mathematicians, who love their abbreviations

Man, I hate that so much. I swear this was half the reason I struggled with maths and physics, that these guys need to write this:

Rather than this:

At some point, they even collectively decided that not having to write a multiplication dot is more important than being able to use more than a single letter for your variables. Just what the fuck?

[–] MisterFrog 37 points 2 months ago (4 children)

Thing is, you usually define all your variables. At least we do in engineering (of physical variety, rather than software).

Mostly because we can't expect everyone reading the calculation to know, and that not everyone uses the same symbols.

Not explaining each variable is bad practice, other than for very simple things. (I do expect everyone and their dog reading a process eng calc to know PV=nRT, at a minimum).

Just like (in my opinion) not defining industry specific abbreviations is also bad practice.

Mathematicians don't do this? Shame on them.

[–] [email protected] 10 points 2 months ago (3 children)

I mean, it was rather physics that was worse in this regard.

Mathematicians do define their variable quite rigorously. Everything is so abstract, at some point you do just need to write down "this thing is a number". Problem with maths folks is rather that they get more creative with their other symbols. So, "this thing is a number" is actually written as "∃x, x ∈ ℝ".

But yeah, in the school/university physics I experienced, it was assumed that you knew that U is voltage, ρ (rho) is density, ω (omega) is angular velocity etc..
At one point, I had to memorize six pages of formulas and it felt like every letter (Latin, Greek, uppercase, lowercase, some Fraktur for good measure) was a shorthand for something.

load more comments (3 replies)
[–] [email protected] 4 points 2 months ago (1 children)

Still bad, i'm not a computer with a lookup table in memory.

I do expect everyone and their dog reading a process eng calc to know PV=nRT, at a minimum

What is "eng"?

[–] MisterFrog 4 points 2 months ago* (last edited 2 months ago) (4 children)

Lol fair point regarding Eng: "Engineering".

But Nah, I think assumed knowledge of PV=nRT is fair in context, since if you don't know what it is, you'll only be reading the conclusion, not getting into the weeds of a calculation document.

I'm not going even going to be explaining if I have a column that's says volumetric flow rate, with V=m/ρ. If I give mass flow rate and density (with units, of course), and use these extremely common symbols, and someone doesn't understand, then they have no real business getting to this level of detail anyway.

I do agree that in most cases not defining your variables is bad practice, but there is some nuance, depending on the intended audience and how common a formula is, and the format of whatever it is you're writing.

load more comments (4 replies)
load more comments (2 replies)
[–] [email protected] 15 points 2 months ago (1 children)

Using full names like that might be fine for explaining a physical rule, or stating the final result of some calculation - but it certainly would be cumbersome and difficult for actually carrying out the calculations. In many cases we already fill pages with algebra showing how things can be related and rearranged to arrive at new results. That kind of work would be intractable with full word names for the variables, partially because you'd be constantly spilling off the end of the page trying to write the steps; but also because having all that stuff would actually obfuscate what you are trying to do - which is algebra. And during that process, the meanings and values of the pronumerals is not as important has how they interact with each other. So the names are just a distraction.

For setting up an equation, and for stating the final result, the meanings of the variables are very important; but during the process of manipulating the equations to get the result you want the meanings of the letters are often ignored. You only need to know that it is something that can be multiplied, or inverted, or subtracted, or whatever. Eg. suppose I want to rearrange to get the velocity. I don't care that I'm dividing both sides by the air density times the drag coefficient and the area... I'm just dividing ρCA, which is an algebraic blob whose interpretation can be saved for some other time.

load more comments (1 replies)
[–] trolololol 10 points 2 months ago (2 children)

Try to write the above with pen and ink and then tell me if you can read it back yourself.

Single letters is not a good system but it was the less bad one.

load more comments (2 replies)
[–] [email protected] 7 points 2 months ago (1 children)
[–] [email protected] 11 points 2 months ago (1 children)
[–] [email protected] 15 points 2 months ago (3 children)

Bruh how large should our notebook pages be? Also how should we speak about the equation? What if the terms should be represented in a matrix? What if mathematical functions e^x, sin, ln etc. are present? Would you write sine of e^(velocity of the particle B) ? Notations are necessary for readability

[–] [email protected] 6 points 2 months ago (1 children)

I don't know what to tell you. They obliterate readability for me.
I also genuinely believe these shorthands hinder access to research for the 99.9% of humanity who are not experts in the given field. Obviously, you do need to understand the context to use a formula correctly, but that also becomes harder when everything is written with hieroglyphs.
In university, I had to assess this paper. It took me 3 weeks to decipher that alien language, and it doesn't even say anything particularly riveting.

To address your points:

  • I'm hoping that at least published math can be typed out with full names.
  • I'm not opposed to local aliases. E.g. if the point is that some values in the matrix are negative and others not, then absolutely write "with air_resistance as 'a', the catapultation matrix is { a, -a, -a, ... }".
  • I don't actually want to introduce spaces into variable names, that's just an example I randomly found online. I was rather thinking e.g. sine(euler^velocity_b).
    Bonus point: You can reasonably type it on a computer, because you don't need Greek letters and subscripts anymore.
load more comments (1 replies)
[–] MisterFrog 4 points 2 months ago (1 children)

You only have to define it once in a document, book, whatever. Also, it's not like you'd ever need to do this for handwritten notes, only for a wider audience, or if you intend for something to be read by not just you.

No one is suggesting you don't use symbols, just that you define them, and not assume the reader uses the same symbols as you. Which, so often, they don't. (How many different ones have you come across just in highschool and uni. I came across multiple)

I'm no physicist, but surely there is a huge range of symbols for the same thing, especially the more niche you get.

load more comments (1 replies)
load more comments (1 replies)
load more comments (2 replies)
load more comments (2 replies)
[–] trolololol 40 points 2 months ago* (last edited 2 months ago) (1 children)

It's from a time keyboards were so hard that you needed to do push ups on your finger tips if you wanted to endure a 9 to 5 programming job.

[–] [email protected] 13 points 2 months ago (1 children)

The reason people love IBM Model Ms nowadays is because the springs have been worn in now and can easily be pressed without additional training.

load more comments (1 replies)
[–] orangeboats 37 points 2 months ago

I recall reading somewhere the earlier compilers had a hard limit on the length of function names, due to memory constraints.

[–] Gutek8134 29 points 2 months ago (1 children)

I've heard it's because old screens were like 60 character wide

[–] [email protected] 24 points 2 months ago

Also punched cards had around 80 columns, which put a hard limit on the number of characters per line.

[–] sandalbucket 19 points 2 months ago (1 children)

Did you know that in the first version of php, each function name would be hashed to lookup the code to run it? And the hashing algorithm was: the first letter. So all the functions started with a different letter.

[–] rainerloeten 8 points 2 months ago (2 children)
[–] FooBarrington 18 points 2 months ago (1 children)

It's not. PHP used to use the function length as hash buckets, so by having evenly distributed lengths the execution time was faster. No idea where GP came up with that.

load more comments (1 replies)
load more comments (1 replies)
load more comments (9 replies)
[–] umbraroze 99 points 2 months ago (5 children)

I can't remember it, but I read one Microsoft blog post (in Vista era?) about how one team at Microsoft would develop some amazing new Windows component. They'd proudly name it AmazingNewService.dll. And then the operating system team would come in and say "that's all fine and good, but you have to conform to the naming convention." 8+3 filenames. First two letters probably "MS", because of reasons. ...and 15 years later, people still regularly go "What the fuck is MSAMNSVC.DLL?"

load more comments (5 replies)
[–] [email protected] 82 points 2 months ago (3 children)

man -k to the rescue: mbsrtowcs, strxfrm and wcstold are C functions.

[–] pelya 20 points 2 months ago

wcsoll is a mispronunciation of wcscoll

[–] [email protected] 17 points 2 months ago

Oh no. You tell them forbidden knowledge of reading manual.

[–] ZILtoid1991 4 points 2 months ago

Who wants to write C functions for the rest with me?

[–] davidagain 56 points 2 months ago (1 children)

Rhowch, cwtch, mwyn have to be Welsh. Classicly Welsh sounding words, and mbrsrtowcs, strxfrm can't possibly be Welsh. Source: my welsh uncle taught me to pronounce Welsh place names.

Wcstold, wcsoll wmffre could be either but sound really weird as Welsh to me.

[–] [email protected] 55 points 2 months ago (2 children)

Wmffre is actually the Welsh spelling of the name "Humphrey"

[–] [email protected] 22 points 2 months ago (3 children)

I love the Welsh, but holy shit that's not what those letters are supposed to be for. They and the Irish just made a bunch of shit up when they started to standardize spelling. It makes me understand how Russians feel when Westerners use Cyrillic letters improperly.

[–] [email protected] 26 points 2 months ago (3 children)

the letters are "supposed to be" for Latin, a language with only five different vowel sounds.

everyone since has just been making a bunch of shit up.

load more comments (3 replies)
[–] [email protected] 7 points 2 months ago (1 children)

Having read your comment I’d like your views on “Wrwgwai” - the South American country of Uruguay.

[–] [email protected] 8 points 2 months ago (2 children)

It's easy. W is a vowel in Welsh. It sounds similar to ö in German and it can be modified as ŵ to elongate the sound such as in the word dŵr which means water.

Wrwgwai or Wcrain (for example) are the natural way to spell those countries using the Welsh alphabet. Its a highly phonetic language believe it or not.

[–] davepleasebehave 7 points 2 months ago* (last edited 2 months ago) (3 children)

In English it is literally called 'double u'

load more comments (3 replies)
[–] [email protected] 4 points 2 months ago

Yeah, I’m Welsh myself. I just wondered how somebody who struggled with Wmffre / Humphrey would do with the whole Wrwgwai thing. Some English speakers get it immediately others get a headache thinking about it.

load more comments (1 replies)
load more comments (1 replies)
[–] [email protected] 52 points 2 months ago

I thought I would be better at this game than I am.

[–] [email protected] 51 points 2 months ago

Easy. The ones with vowels are C library functions.

[–] [email protected] 26 points 2 months ago

Are there any of them that are both?

[–] [email protected] 18 points 2 months ago (1 children)

I prefer names like these to names that are common words. Even the name of the language is annoying because the letter C isn't exactly uncommon in other contexts. I can't blame the people who named the language because they did it long before search engines were a thing, but what excuse do people now have?

[–] [email protected] 23 points 2 months ago (1 children)

So you're saying we should create a programming language called "Welsh" with C-like function names?

[–] [email protected] 10 points 2 months ago

No because that would imply that Welsh is not just as valid a language as English and I don't want to be wedi'i gywiro'n gwrtais.

[–] [email protected] 9 points 2 months ago (4 children)

Rhowch, mwyn, and wnffre are Welsh. The rest is nonsense.

load more comments (4 replies)
[–] [email protected] 5 points 2 months ago (5 children)
load more comments (5 replies)
[–] [email protected] 4 points 2 months ago

I'm bad at naming things too🖐️

load more comments
view more: next ›