Skip Navigation

InitialsDiceBearhttps://github.com/dicebear/dicebearhttps://creativecommons.org/publicdomain/zero/1.0/„Initials” (https://github.com/dicebear/dicebear) by „DiceBear”, licensed under „CC0 1.0” (https://creativecommons.org/publicdomain/zero/1.0/)CG
Posts
1
Comments
34
Joined
3 yr. ago

  • My workplace has the opposite problem.

    The company has been in dire need of programmers for years, so they hired people (including myself) without tests. However, the work involves lots of custom iterators and the occasional handcrafted parser, which most of the company is incapable of writing. The bright side is that management has their metrics mostly right, so I'm getting lots of raises for solving fun problems.

  • I recommend Pyright over Mypy if you don't mind it being owned by Microsoft. It has far fewer bugs, and if you do stumble on one, you don't have to fix it yourself because Microsoft's paid devs will fix it in a couple of working days (at least for the small bugs I've reported).

  • I do very little coding, but it's because our workplace has an abundance of junior developers, not because I'm pressed for time. My work is essentially just turning emails into technical specifications that others can implement and tutoring juniors when there are problems. Few to no pointless meetings because I insist on using emails or tickets whenever possible.

  • Agreed. I think operator overloading is a necessary feature in any math-oriented or general-purpose language. Being able to write formulae the same way as they're written in the source paper is a huge boon to readability.

  • Different applications require different tests, so no measure is going to please everyone. If you're making embedded devices for an airplane, the buyer might ask you to provide a formal proof that the program works. In contrast, web apps tend to simply use end users as testers, since it's cheaper.

  • What is the median amount of times you end up shuffling the array before it is sorted?

    The answer is n! where n is length of the array.

    I assume you meant mean instead of median. The median of a geometric distribution with parameter p is ceil(-1/log2(1-p)).

  • I personally don't like the idea, because keeping services entirely disconnected is good for privacy.

    Furthermore, I think it's funny that the author used Matrix as an example of a service benefiting from chat federation, when Matrix is about to be deportalled from Libera.Chat due to bad UX and leaking secret channels. If Matrix can't even federate properly with IRC, there's no way they can do it with modern services like Discord.

  • Another point in favour of databases is simplicity of client-server communication and data models.

    Many objects in WoW (not too sure about spells, but most likely them too) work such that the client asks the server for the related DB rows when it sees an object for the first time. So instead of sending code across the wire, which would be a bad idea for many reasons, you instead send structured data that the client interprets.

    Of course, you could just bake the spell code into the client at compile-time, but then dataminers will take it apart on day 0. WoW datamining mostly works such that you play the game normally and see what data the server gives you.

  • Although I’ve used a number of languages including Python, Javascript, and Go to build software, the bulk of my experience is working in Java.

    Notably, Python's type annotations are extremely similar to Typescript. I guess the author hadn't used Python's type annotations very much (which is understandable considering they're often missing from libraries and the implementations are buggier than Typescript).

  • In C++23, you can zip the two arrays, so there's no need to declare an otherwise useless index variable:

     C++
        
    int stdSumOfValidDataPoints(const MyData& data)
    {
        using namespace std;
        auto&& r = ranges::views::zip_transform(
            [](int data, bool valid){return data * valid;},
            data.dataPoint,
            data.dataPointIsValid
        );
        return accumulate(begin(r), end(r), 0);
    }
    
    
      

    Unfortunately, the current implementation of zip_transform in GCC doesn't understand that the output length is constant 8, so it does needless cmps every iteration to check if it should stop iterating. (Godbolt)

  • In languages with static and convenient type systems, I try to instead encode units as types. With clever C++ templating, you can even get implicit conversions (e.g. second -> hour) and compound types (e.g. meter and second types also generate m/s, m/s^2 and so on).