• 0 Posts
  • 11 Comments
Joined 1 year ago
cake
Cake day: January 16th, 2024

help-circle
  • Test driven development. It’s a technique where you know what behaviour or result the code should produce, but you haven’t written any producing code yet. So you break down the problem into small steps which each produce a testable result or behaviour that brings you closer to what you need. And before writing any implementation for each of these small steps, you write a unit test which checks whether an implementation would execute this step correctly. Once you have each test set up, you can start writing the implementation, keeping it as simple as possible, and running the test until it passes for your implementation. This keeps going in a cycle.

    Once all your tests pass, provided you’ve written good and correct tests for every step, there are several benefits of this approach:

    • you can be quite confident that your code works as expected
    • making changes to existing code is much less scary, because you can change the thing you need to change, adjust or add tests accordingly, and rerun all the other tests to make sure everything else still works as expected
    • there is a big psychological benefit when you force yourself to define exactly what you expect the code to do before you actually write it
    • it can help others understand what the intent behind the code is by looking at its expected behaviour

    The downside is that it takes more time to write tests for everything. But for complex applications, it will save you a lot of time in the long run if the code will be changed very often in the future or is complicated, because many bugs will be caught by your test landscape.








  • Derp@lemmy.mltoPrivacy@lemmy.mlDuckDuckGo failed me today
    link
    fedilink
    arrow-up
    2
    ·
    edit-2
    11 months ago

    You are correct, I don’t care about cookies was acquired by avast. It is still GPL3 licensed and, according to the privacy policy, does not capture user data. But for those who don’t trust avast (which includes me), there is an independent fork called I still don’t care about cookies. The builtin Firefox cookie deletion settings are not granular enough for my usecase (with container tabs) and a hassle to configure for imo, which is why I still recommend the forked extension if it suits your usecase.


  • Derp@lemmy.mltoPrivacy@lemmy.mlDuckDuckGo failed me today
    link
    fedilink
    arrow-up
    4
    ·
    edit-2
    11 months ago

    In Firefox, you can use the cookie autodelete extension (it’s open source) which deletes all cookies for sites you haven’t explicitly whitelisted. Same thing, integrates well with other privacy features on Firefox (like container tabs and I still don’t care about cookies, and is probably better maintained than the feature in DDG.

    IMO starting with a more minimalistic base, and adding whatever features you need is a better approach that suits more use cases. Just reduce your extensions to what you really need, and deactivate or uninstall those you don’t need. Make sure what you are installing is open source, well-maintained and trustworthy (look at the github page: when was the most recent commit or release? how many contributors and stars are there? It’s not foolproof, but a good start and definitely beats closed source extensions). Having access to more extensions is not a bad thing.

    EDIT: don’t use I don’t care about cookies as it was acquired by some shady companies. Use the independent fork called I still don’t care about cookies instead.