Some middle-aged guy on the Internet. Seen a lot of it, occasionally regurgitating it, trying to be amusing and informative.

Lurked Digg until v4. Commented on Reddit (same username) until it went full Musk.

Was on kbin.social (dying/dead) and kbin.run (mysteriously vanished). Now here on fedia.io.

Really hoping he hasn’t brought the jinx with him.

Other Adjectives: Neurodivergent; Nerd; Broken; British; Ally; Leftish

  • 1 Post
  • 89 Comments
Joined 10 months ago
cake
Cake day: August 13th, 2024

help-circle
  • You’re right. I’ve got too much Perl on the brain and forgot my roots. There is a language that does what you’re talking about with the ‘+’ operator: BASIC

    Good luck getting the same thing retrofitted into JavaScript though. I can imagine a large number of websites would break or develop mysterious problems if this (mis)behaviour was fixed.



  • Perl is an old but notable exception. + is purely for addition in the base language.

    If you try to add two strings with it, they’ll be converted to numbers based on any number-like characters they have at their left hand ends, and, if warnings are enabled (and you should definitely do that), you’ll get runtime warnings about it if there’s even anything vaguely non-numeric about them.

    e.g. “1”+“11” will get you 12 with no complaint, warnings or otherwise. Not even the string “12” either, although it’s hard to determine one from the other in Perl. It’s a need-to-know kind of thing. And you generally don’t.

    “a”+“bb” gives 0 as the result because they’re not numbers and “1a”+“11bb” will give 12, but these latter two will give warnings. Two each, in fact, one for each dodgy parameter.

    String concatenation is done with the dot operator instead. “1”.“11” gives “111”. This comes with it’s own minor problems, but at least + is safe.





  • A lot of the original C coders are still alive or only very recently gone (retired, or the ultimate retirement, so to speak), and they carried their cramped coding style with them from those ancient and very cramped systems. Old habits die hard. And then there’s a whole generation who were self-taught or learned from the original coders and there’s a lot of bad habits, twisted thinking and carry-over there too.

    (You should see some of my code. On second thought, it’s probably best you don’t.)


  • For writing loops, many early BASICs had FOR/NEXT, GOTO [line] and GOSUB [line] and literally nothing else due to space constraints. This begat much spaghetti. Better BASICs had (and have) better things like WHILE and WEND, named subroutines (what a concept!) and egads, no line numbers, which did away with much of that. Unless you were trying to convert a program written for one of the hamstrung dialects anyway, then all bets are off.

    Assembly style often reflects the other languages people have learned first, or else it’s written to fit space constraints and then spaghettification can actually help with that. (Imagine how the creators of those BASICs crammed their dialect into an 8 or 16K ROM. And thus, like begetteth like.)

    C code style follows similarly. It is barely concealed assembly anyway.

    COBOL requires a certain kind of masochist to read and write. That’s not spaghetti, it’s Cthulhu’s tentacles. Run.



  • Depends if you go with the original idea, or the battery idea designed by Hollywood execs who didn’t think the audiences would understand.

    … thus proving that Hollywood execs and the people they make their changes for are only good for batteries*, but I digress.

    * For legal reasons, this is a joke. I have to say this because some Hollywood execs have more lawyers than braincells**.

    ** For all the same reasons, this is also a joke.



  • Can’t vouch for any other distro, but aplay is alive and well on Mint. The package that contains it — alsa-utils — seems to be a core dependency for Cinnamon, even.

    So basically, your example runs fine on my machine, screechy sounds and everything.


  • “A 'ISO” where that apostrophe represents hard attack on the vowel sound.

    As for what that is, consider the phrase “Paula asked a question.”

    If enunciated clearly there’ll be a hard attack between “Paula” and “asked”.

    (In this example, some — chiefly British — people will put an R sound between them if they don’t enunciate clearly. The R wouldn’t show up in “A ISO”, but this is to demonstrate hard attack, not get into those weeds.)




  • And if you dare take the risk of lobbing a SIGCHLD at the parent process, most of the time, that doesn’t even do anything, and now you’ve been through the stress of signalling a perfectly healthy parent process.

    I like to analogise and anthropomorphise signals, but there’s no non-depressing way to do this one. SIGCHLD is basically “clean up after your kids, even if that means tidying their corpses away”.

    Often the parent can’t do that or doesn’t know how. It’s hugging them close and they’ll only leave once the parent also leaves.

    These things aren’t even sentient and that stings a bit.




  • True. I think of it more as a semantic shift. In the old days, processes would actually quit and some other process would resurrect it as necessary, but then someone had the idea of having some processes catch the HUP and do all that itself without actually bothering any other processes.

    And the implementation might actually involve an exec of the process’ own executable, meaning that it actually does self-terminate, but it leaves a child in its place.