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

  • 0 Posts
  • 22 Comments
Joined 10 months ago
cake
Cake day: August 13th, 2024

help-circle



  • At the time JS was created, Perl didn’t have a this. A lot of the docs and books suggested using $self but a reference to the object would be passed as the first parameter to all class methods and you assign that to any name you wanted.

    It’s only very recently (as in the last year or so) with a new class system that Perl has hard-coded $self for that purpose.


  • Not strictly true.

    Perl’s default bitwise operators do differentiate between numbers and strings that look like numbers in a way that addition doesn’t*, and the readline/glob operator <> does different things depending on what (if anything) is between the signs.

    There’s also the whole overload pragma for objects, which doesn’t affect default data types, but if you’re sufficiently perverse, you can define a String class that uses ‘+’ like JavaScript.

    * in 2015, they added new operators so that those and the original operators don’t overload and have only one specific purpose if the bitwise pragma Edit: feature is turned on. You might know all this already though.


  • 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.



  • Ah, but the clueless code monkeys, script kiddies and C-levels who are responsible for writing the AI companies’ processing code only know how to scrape from someone else’s website. They can’t even ask their (respective) company’s AI for help because it hasn’t been trained yet. (Not that Wikipedia’s content will necessarily help).

    They’re not even capable of taking the ZIP file and hosting the contents on localhost to allow the scraper code they got working to operate on something it understands.

    So hammer Wikipedia they must, because it’s the limit of their competence.


  • 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.



  • Hard to say. I feel like it’s about as likely he would have found LLMs to be an overcomplicated false prophet or false god.

    This was a man whose operating system turned a PC into something not unlike an advanced Commodore 64, after all. He liked the simplicity and lack of layers the older computers provided. LLMs are literally layers upon layers of obfuscation and pseudo-neural wiring. That’s not simple or beautiful.

    It might all boil down to whether the inherent randomness of an LLM could be (made to be) sufficiently influenced by a higher power or not. He often treated random number outcomes as the influence of God, and it’s hard to say how seriously he took that on any given day.


  • We seem to be headed in that direction though. My most recent motherboard has built in LEDs for no practical reason other than “ooh shiny”. Took me a minute to find the UEFI setting to disable that. “Stealth mode” apparently.

    It’s also increasingly difficult, if not impossible, to find wired mice, keyboards and headsets in that ever-increasing gulf between “all singing, all dancing, expensive gaming device full of unnecessary LEDs” and “cheap, awful, bare minimum”. If it plugs in and there’s a 5v rail nearby, gotta draw on that to be shiny! Anything else would be sacrilege!


  • OK, it’s been a few hours. I’ll do the clumsy thing that everyone else has avoided and point out that it’s deliberately set up so that people who have never heard of operator precedence - those who do things purely left-to-right - don’t get a weird fraction when the division step is done, making them think that the answer they’ve reached must be the right one. You’d still get a handful who’d argue regardless, but that whole number ropes in a whole bunch more.

    Couple that with the fact that the value reached this way doesn’t match the value obtained from using operator precedence and you get arguments about what the right answer is. And a comment like the one you’re reading right now that’s too long for the hard-of-thinking to read.

    “More engagement, baybee [sunglasses smiley emoji] [cash bag emoji]” etc.




  • Has any study been done on how efficient they are as heaters? The electricity they use when idle doesn’t vanish; it’s given off as heat. In the winter it might be worthwhile to not bother to unplug them because what they’re giving off could offset what other, more conventional, heat sources might otherwise provide. i.e. you leave a charger plugged in, and your house heating goes off half a second sooner, saving you the pennies there that the charger costs otherwise.

    Admittedly, this doesn’t apply to summer and hotter climates, so most people, most of the time, probably ought to be unplugging them, but there’s a small percentage of cases where the reverse might actually be beneficial.




  • 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.