• 0 Posts
  • 348 Comments
Joined 1 year ago
cake
Cake day: June 21st, 2023

help-circle
  • TehPers@beehaw.orgtoProgramming@programming.devBaby unit tests
    link
    fedilink
    English
    arrow-up
    1
    ·
    52 minutes ago

    If in PHP or JS I make a change, hit F5, and get an error, that’s not any better than the IDE already showing it beforehand.

    This is even worse because it can happen in prod without you ever triggering this case. For some projects, it doesn’t matter because the impact of a bug is small. For most, you put a subpar, buggy experience in front of your users, waste more time looking for the cause and debugging later with upset users, and at worst cause actual damages (depending on the project anyway).


  • TehPers@beehaw.orgtoProgramming@programming.devBaby unit tests
    link
    fedilink
    English
    arrow-up
    10
    arrow-down
    1
    ·
    2 days ago

    Types aren’t unit tests. Unit tests only test a discrete set of inputs and outputs for correctness, and can miss cases that aren’t tested for.

    In sound type systems, they are closer to formal verification. The compiler guarantees the properties you expect of the type hold.

    As for the rest of the article, do what works best for you in your projects, but if I need to work with you, I’m going to ask for types. I need to know what types the interface expects to receive. Names are not enough. Document them, use type hints, whatever, just put them somewhere because I’m not psychic and I don’t know what you thought about when writing the function.








  • Chuck Feeney is over here looking like a gigachad though:

    He [Feeney] decided to give virtually all his money away to various domestic and international charities and philanthropic efforts over his last 40 years or so. In September 2020, Feeney closed down his philanthropy company, having given away his wealth, minus retirement savings for him and his wife.












  • Sometimes when I don’t leave comments like that, I get review comments asking what the line does. Code like ThisMethodInitsTheService() with comments like “what does this do?” in the review.

    So now I comment a lot. Apparently reading code is hard for some people, even code that tells you exactly what it does in very simple terms.