No relation to the sports channel.

  • 1 Post
  • 884 Comments
Joined 2 years ago
cake
Cake day: June 9th, 2023

help-circle
  • But if someone creates a file called HEAD, should it overwrite a file called head?

    That shouldn’t matter to the “nontechnical” end-user at all. To the nontechnical user, even the abstraction of “creating a file” has largely gone away. You create a document, and changes you make to it are automatically persisted to storage, either local or cloud.

    Only the technical command-line user cares about whether /usr/bin/HEAD and /usr/bin/head are the same path. And only in a specific circumstance — such as the early days of Mac OS X, where the Macintosh and Unix cultures collided — could the bug that I described emerge.


  • I recall a case-insensitivity bug from the early days of Mac OS X.

    There are three command-line utilities that are distributed as part of the Perl HTTP library: GET, HEAD, and POST. These are for performing the HTTP operations of those names from the command line.

    But there’s also a POSIX-standard utility for extracting the first few lines of a text file. It’s called head.

    I think you see where I’m going with this. HEAD and head are the same name in a case-insensitive filesystem such as the classic Mac filesystem. They are different names on a Unix-style filesystem.

    Installing /usr/bin/HEAD from libwww-perl onto a Mac with the classic filesystem overwrote /usr/bin/head and broke various things.















    • The compiler hates you
    • The compiler sees nothing wrong with your code and is just giving error messages to look busy
    • The compiler was written by a maniac with a semicolon fixation
    • The compiler could optimize your code, but it’s just not feeling it today
    • The compiler wonders why you can’t match braces right like your brother does
    • The compiler had a torrid affair with a Perl interpreter in 2006
    • The compiler likes big butts and cannot lie
    • The compiler wants to grow up to be an IDE but hasn’t told its parents they need to send it to GUI school yet
    • The compiler reads Nazis on Twitter but only to make fun of them
    • The compiler works for the Servants of Cthulhu



  • Regex is good for a few very specific things, and sysadmins used to use it for goddamn everything. If all your server logs are in lightly-structured text files on a small number of servers, being able to improvise regex is damn useful for tracking down server problems. Just write a shell loop that spawns an ssh logging into each server and running grep over the log files, to look for that weird error.

    These days, if you need to crunch production server logs you probably need to improvise in SQL and jq and protobufs or systemd assmonkery or something.

    But if you actually need a parser, for goodness sake use a parser combinator toolkit, don’t roll your own, especially not with regex. Describing your input language in plain Haskell is much nicer than kludging it.

    (This is the “totally serious software engineering advice” forum, right?)