• 0 Posts
  • 175 Comments
Joined 1 year ago
cake
Cake day: August 9th, 2023

help-circle





  • PHP extension might be telling. Consider that phpBB had an extention system that didn’t have any kind of hooks. All extensions were installed by modifying the code in place. They did not use any of the diff formats already out there; in a gross case of Not Invented Here, they made their own. Took them a while to make their own patch tool to automatically apply their custom diff, and it was buggy as hell.

    So that shop might have just been following the lead of one of the most successful PHP apps.

    Someone will be along to say “PHP is good now, actually”, but I don’t care. The community was shit back then, and I don’t see why anyone should care beyond legacy software at this point.




  • I’m not sure it is. Like, yes, it does exist in the Left/Right, Auth/Lib political compass, but that’s just a model. The stance has some inherent contradictions.

    And so does Right/Lib, for that matter. “Fiscally conservative/socially liberal” is a nonsense position, and those taking it tend to just be conservative in practice.


  • BufferedReader cannot accept file name because it makes arbitrary reader… well buffered. It’s not BufferedFileReader, even that would accept something like Path or File, not string, because File can be remote file, should Reader now know all possible local and remote protocols and path formats? What else it must do?

    You’re just describing the problem. Yes, I see where they’re going with this. It’s still a usability nightmare. I can’t think of another language that makes you jump through hoops like this on IO, and they get along fine without it.


  • Eh, I’d still go for it. I find the Rust compiler tends to amplify my impostor syndrome–it tells you all the ways you are objectively being stupid. I know that’s not really selling it, but it’s doing that stuff for a reason. I’m especially hopeful that it becomes the standard way to do things with microcontrollers; that’s about the only place I write C/C++ at all.


  • Progressive at first, but then sorta forgot about it.

    At the start, women were given rights that suffragists in the UK or USA could only dream of. Then it stopped. By the 1960s, women in the USSR found that they were still expected to do all the same old household chores while also holding a job outside the home. Meanwhile, western feminism had developed a strong second wave, and later a third (arguably more since, but that gets complicated). Those waves dealt with increasingly abstract issues in the patriarchy, including the problem of household chores.

    This simply didn’t happen in the USSR. Developing one would have required greater freedom of speech than anyone had in that country.


  • It’s slightly less close to the metal as C. Array bounds checks are always going to cost you something, for example. However, if you look at the speed of numeric computation in C, Rust, and Go, they’re all in the same order of magnitude performance compared to things like Python or JavaScript (not including things like PyPi, which is C with extra steps).



  • frezik@midwest.socialtoProgrammer Humor@programming.devLanguages
    link
    fedilink
    arrow-up
    15
    arrow-down
    1
    ·
    edit-2
    1 month ago

    Its standard library reads like someone’s Object Oriented Programming 101 final project, and they probably got a B- for it. Everything works and follows OO principles, but they didn’t stop to think about how it’s actually going to be used.

    Let’s try to read a file line-by-line:

    BufferedReader reader = new BufferedReader(new FileReader("sample.txt"));
    String line = reader.readLine();
    

    We’re having to instantiate two objects (FileReader and then BufferedReader) just to get an object that has a readLine() method. Why? Can’t BufferedReader take a file name on its own and work it out? Or FileReader just provides readLine() itself?

    Not only that, but being parsimonious with what we import would result in:

    import java.io.BufferedReader;
    import java.io.FileReader;
    

    But we’re much more likely to be lazy and import everything with import java.io.*;. Which is sloppy, but I understand.

    I can see what they were thinking when separating these concerns, but it resulted in more complexity than necessary.

    There’s a concept of “Huffman Coding” in language design. The term itself comes from data compression, but it can be generalized to mean that things you do often in a programming language should be short and easy. The above is not good Huffman Coding.





  • Mostly, yes.

    I’d like to find a better way to phrase "why aren’t you . . . " questions. It carries an accusatory tone in text, even if you don’t intend that. The answer is almost invariably going to be either “I didn’t know it existed” or “because reason X”. Neither case justifies the accusatory tone. Maybe if the “I didn’t know it existed” answer was something so basic that they really should have known it existed, but probably not even then.