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
  • 1.19K Comments
Joined 2 years ago
cake
Cake day: August 13th, 2024

help-circle



  • because some languages allow you to write statements  
        that wrap over multiple lines
            in order to space things out that would
                otherwise be crammed onto one line,
        so for the compiler to know when the statement ends
            a character is needed so that it doesn't think the next line
                is part of the previous;
    statement number 2 goes here
    

    Without that semicolon, you might have continued to read “previous statement” which makes sense at first, until the words that follow.

    Without the allowance for multiple lines in one statement, that second physical line makes no sense at all, despite the first one making perfect sense on its own.

    And without the spacing, the run-on sentence would be a lot harder to read.

    Sometimes you have to write code a particular way. Here I was making a point. In a programming language there are other reasons.










  • Ctrl+C and Ctrl+V for copy and paste come from non-Unix (I’d say Windows itself, but they may have stolen it from elsewhere), and so it makes sense that those two keys have other special meanings under Unix and its descendants.

    Specifically, they mean “Stop what you’re doing” and “The next character is to be entered without special meaning” in most shells, the most common programs that run, often as the main program, in/on a terminal.

    As such, most terminal emulators in Linux GUIs reserve those keypresses for their Unix-y functions. Most of the good ones move copy and paste to Ctrl+Shift+C and Ctrl+Shift+V instead.

    MS-DOS and Windows command prompts also inherit their use of Ctrl+C from Unix, by way of 86-DOS and CP/M, and were in there long before Microsoft adopted Ctrl+C for copy in a GUI, which is where those other Insert-based keybinds you mention came in.

    For an example of Unix Ctrl+V, try echo hello[Ctrl+V][Ctrl+H]world in a Linux terminal shell and press Enter. You’ll see the command as echo hello^Hworld and when you press Enter, it will display hellworld, because that embedded Ctrl+H is a backspace.