- cross-posted to:
- programmerhumor@lemmy.ml
- cross-posted to:
- programmerhumor@lemmy.ml
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.
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.
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?
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.
I don’t have to write with pen and paper anymore though
Yep, that’s what it usually boils down to. However, I think a slight approach shift for basic materials could be useful, where introductory books / papers / … write out formulas. That makes it easier to understand the basic concepts before moving onto the more complex stuff. It should be easy to create such works, as they are usually created digitally, and autocomplete is available. Students can and will abbreviate those written outs words by themselves (after all, writing is annoying), but IMO reading comprehension is the key part that can be improved.
Also, when doing long formulas that you want to eliminate members of, writing stuff out can be a nightmare.
/s?
Nope.
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
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.
Btw i am all for local aliases. I see them most of the times.
i.e, [equation], where a = area of the surface, v= velocity,…
But without short codes it would be a pain to write and remember. Some of the shortening like del operator really reallh simplifies the original expression with better showcase of physical meaning, but looks alien to people who don’t know. But we can’t stop using it since it makes everything else difficult for people in that area
I would have quit math if I had to do algebra with names instead of letters.
What OP is talking about is readability, so in a situation where you’re taking your own notes and have your own set of defined symbols, full words aren’t necessary.
I personally lost all interest in math because there are way too many opinionated or non-standard symbol definitions
I personally lost all interest in math because there are way too many opinionated or non-standard symbol definitions
That seems like a strange reason to quit math since most symbols are pretty well agreed upon, and maths has little to do with the actual notation either way.
I should’ve said “anything math-heavy,” but even then, it seems like switching fields or applications of math requires understanding a new definition of the same symbols, and a lot of that could be avoided with words.
I mean, if you get into any real depth with math, you are going to reach a point where you can’t use conveniently use words to describe the symbols being manipulated.
As an example for the math I am doing literally right now, I very much prefer using C+R compared to “semi circular arc in the upper half of the complex plane with radius R”, or M+(f(z)) which means “Maximum of the magnitude of the function f(z) over C+R”, which if I were to write out in full, would just become a clusterfuck.
Also you still wouldn’t be able to get rid of symbols because some symbols are placeholders and straight up don’t have any meaning in natural language. This occurs often in physics as well, not just pure maths. For example, the laplace transform of any function is written as a variable of “s”, but “s” doesn’t have a clear meaning (at least as far as I know).
It’s been really holding me back in learning coding. I felt pretty comfortable at first learning javascript, but as I got further the code was increasingly hard to look back to and understand, to the point I had to spend a lot of time understanding my own code.
Does it truely matter after the code has been compiled if it has more full words or not?
It matters as soon as a requirement change comes in and you have to change something. Writing a dirty ass incomprehensible, but working piece of code is ok, as long as no one touches it again.
But as soon as code has to be reworked, worked on together by multiple people, or you just want to understand what you did 2 weeks earlier, code readability becomes important.
I like Uncle Bobs Clean Code (with a grain of salt) for a general idea of what such an approach to make code readable could look like. However, it is controversial and if overdone, can achieve the opposite. I like it as a starting point though.
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.
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.
Kids these days have it so easy, pshh
I’ve heard it’s because old screens were like 60 character wide
Also punched cards had around 80 columns, which put a hard limit on the number of characters per line.
strncpy becomes stringnumbercopy. You can see why short version is used.
And with a bit of namespacing and/or object orientation and usage of dots, it becomes perfectly readable.
There are also camel case and underscores in other languages…
BTW: How on earth should a newcomer know that the letter “n” in that word stands for number without having to google it? The newcomer could even assume that it’s a letter of the word string… And even, if you know that it stands for number, it’s still hard for me to understand what it means in this context… I actually had to google it… But that’s probably some C++ convention I don’t know about, because I don’t program in C++…
C is a little older than namespacing and object orientation. C++ wasn’t even a glimmer in Bjarne’s eye when these conventions were laid down.
And yes, having to google it is part of the design. Originally C programmers would have had to read actual manuals about this stuff. Once you learn the names you don’t really forget so it works well enough even now for ubiquitous standard library functions.
And yet, C was an ergonomic revelation to programmers of the time. Now it’s the arcane grandpa that most youngsters don’t put up with.
man strncpy
Removed by mod
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?”
Why are they still so hung up on 8.3 long after Win95?
I get not wanting to have spaces in a filename. Those suck.
Is there something low-level that still doesn’t like long filenames?
Well this was Vista era, they were probably doing that to ensure some sort of expectation from particularly tricky legacy apps. Windows prefers not to break old apps if at all possible.
sounds interesting~, any chance that I can find this post?
Like I said this was in the Vista era. Or possibly before the Vista release, part of the Longhorn hype train (Longhorn got some super hyped features, such as an epic next-generation filesystem to replace NTFS, which Microsoft ultimately canned, and Vista ended up, you know, being Vista).
This was so long ago that I unfortunately don’t remember what exact feature this was about, but it was about some new Windows component.
Thanks anyway, first time know the 8+3 filename thing in MS
man -k
to the rescue:mbsrtowcs
,strxfrm
andwcstold
are C functions.Oh no. You tell them forbidden knowledge of reading manual.
The function wcstol appears to be missing. Cross platform C is difficult.
Who wants to write C functions for the rest with me?
I thought I would be better at this game than I am.
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.
Wmffre is actually the Welsh spelling of the name “Humphrey”
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.
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.
I get that, and i also understand that English shifted it’s vowels compared to similar languages. But aside from French, my American brain can kinda figure out how to pronounce Germanic and Romance languages, whereas languages such as Welsh and Polish seems to have applied completely different rules to the Latin alphabet than everyone else.
So, you’ve got no issues with “g” being sometimes kinda “h”, “j” being same kind of “h” always, “h” not being a sound a all, “d” sounding like “th”, and “z” sounding like “th” but another “th”, not the one for “d”. Oh, and “c” sounding either like “k” or like the latter “th”
I know some people that claim that everyone should use Latin alphabet, because you then know what things sound like, but that is the most bullshit take I ever heard. I guess that knowing how to write letters helps, but it looks like every other language pronounces those letters different, and English makes extra effort to pronounce different even the same things
at least welsh and polish actually read the letters that we write down, unlike some languages
Having read your comment I’d like your views on “Wrwgwai” - the South American country of Uruguay.
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.
In English it is literally called ‘double u’
Even tho it’s more like a double v. Always struck me as odd.
Bug is supposedly a Welsh origin word that is spelt bwg. and that’s the limit of my knowledge
Afaik, comes from Latin that had no “U” and “V” was both vowel and consonant until some point in time.
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.
One last joke played on the colonizers invading them
Nice.
Easy. The ones with vowels are C library functions.
Are there any of them that are both?
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?
So you’re saying we should create a programming language called “Welsh” with C-like function names?
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.
Rhowch, mwyn, and wnffre are Welsh. The rest is nonsense.
What are those in English?
Rhowch = give / enter supply? Kinda? Like “enter password” is where i’ve seen it.
Mwyn = mine as in dig
Wmffre = welsh version of humphrey and i only know that due to my great-grandfather.
wcs?
Welsh?
Ugh apparently my asterisks turned into italics.
All the words with wcs should be functions. Not sure about the rest of them
I still vote for Welsh
You need to escape them with backslashes like so: \*
I’m bad at naming things too🖐️
Yep