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/)A
Posts
21
Comments
20
Joined
2 yr. ago

  • Integration tests against a real database can and should still be performed. The idea here is the ability to test business logic in isolation without using mocks. Effect systems also have other benefits. You basically get cross-cutting concerns like logging and profiling for free. Every single database call, API request, and file read in your entire application can be easily logged and profiled.

  • You can still test the functions individually or run the entire flow against a test database, but without an effect system like this, it's very hard to test business logic in isolation.

  • I've added JSDoc type annotations to the library.

  • Author here. In my experience, AI coding tools like Claude Code can write code in the Effect system style, and that could be a great starting point for getting developers not familiar with this approach on board.

    I considered adding JSDoc type annotations, but that would make the code a bit verbose.

  • Programming @programming.dev

    Managing Side Effects: A JavaScript Effect System in 30 Lines or Less

    lackofimagination.org /2025/11/managing-side-effects-a-javascript-effect-system-in-30-lines-or-less/
  • Programming @programming.dev

    The Innocent Loop

    lackofimagination.org /2025/04/the-innocent-loop/
  • Programming @programming.dev

    Lessons from David Lynch: A Software Developer's Perspective

    lackofimagination.org /2025/02/lessons-from-david-lynch-a-software-developers-perspective/
  • Programming @programming.dev

    Runtime Diagnostics: Catching Bugs as They Happen

    lackofimagination.org /2025/01/runtime-diagnostics-catching-bugs-as-they-happen/
  • Programming @programming.dev

    Writing Composable SQL using Knex and Pipelines

    lackofimagination.org /2024/11/writing-composable-sql-using-knex-and-pipelines/
  • Perhaps I was unclear. What I meant to say is that, whenever possible, we shouldn't have multiple versions of a field, especially when there is no corresponding plaintext password field in the database, as is the case here.

  • I appreciate the security concerns, but I wouldn't consider overriding the password property with the hashed password to be wrong. Raw passwords are typically only needed in three places: user creation, login, and password reset. I'd argue that having both password and hashedPassword properties in the user object may actually lead to confusion, since user objects are normally used in hundreds of places throughout the codebase. I think, when applicable, we should consider balancing security with code maintainability by avoiding redundancy and potential confusion.

  • Thanks for the tip. password.trim() can indeed be problematic. I just removed that line.

  • Programming @programming.dev

    Self-documenting Code

    lackofimagination.org /2024/10/self-documenting-code/
  • Programming @programming.dev

    Avoiding if-else Hell: The Functional Style

    lackofimagination.org /2024/09/avoiding-if-else-hell-the-functional-style/
  • Programming @programming.dev

    Firewalling Your Code

    lackofimagination.org /2024/08/firewalling-your-code/
  • Programming @programming.dev

    Teaching Programming with BASIC

    lackofimagination.org /2024/07/teaching-programming-with-basic/
  • Programming @programming.dev

    I Don't Trust My Own Code

    lackofimagination.org /2024/05/i-dont-trust-my-own-code/
  • Seriously, why the negative tone? If I've offended you, I'm sorry. You might think that I'm wasting time, but there are multiple ways to skin a cat. I prefer not to use DEB packages for deployment, though others might.

  • Cleanup can be as simple as deleting the latest deployment directory, if the script gets that far. The article is about using built-in Linux tools for 'easy' application deployments. One can also use dedicated tools, as you suggested, to further automate the deployment process.

  • Author here. In case it’s not clear, this article isn't about installing Linux packages; it's about deploying multiple versions of software to development and production environments.

  • Programming @programming.dev

    Easy Application Deployments with Linux

    lackofimagination.org /2024/05/easy-application-deployments-with-linux/
  • Author here. My blog is also generated with Hugo, and it's great. I just prefer not to generate HTML and CSS from JavaScript unless it's necessary.

    Sorry, I haven’t seen that movie. Thanks for the recommendation though.

  • Web Development @programming.dev

    Back to Basics in Web Apps

    lackofimagination.org /2024/04/back-to-basics-in-web-apps/
  • Alpine.js @programming.dev

    Reusable HTML Components Powered by Alpine.js Reactivity

    github.com /markmead/alpinejs-component
  • That idea crossed my mind too, but you can’t really use the full capabilities of SQL in graph databases, and that’s a deal breaker for me.

  • There's certainly the danger of creating too many ad-hoc or sparse relationships, which can cause issues. That said, when used for supplementing foreign keys, Tie-in can be a useful tool in a production system as well.

  • Yes, that's correct. Here's how an entry in the join table looks like:

     json
        
    {
      "id": 6,
      "sourceComp": "user",
      "sourceId": 2,
      "targetComp": "post",
      "targetId": 3,
      "type": "author",
      "createdAt": "2024-03-28T13:28:59.175Z",
      "updatedAt": "2024-03-28T13:28:59.175Z"
    }
    
      
  • AFAIK, no NoSQL database fully supports SQL, and only some offer support for transactions and joins. The idea here is to augment a relational database by adding capabilities for dynamic relationships.

  • Programming @programming.dev

    Beyond Foreign Keys

    lackofimagination.org /2024/04/beyond-foreign-keys/
  • Alpine.js @programming.dev

    Converting a Vue 2 App to Alpine.js

    www.raymondcamden.com /2024/03/04/converting-a-vue-2-app-to-alpinejs
  • Alpine.js @programming.dev

    Code Examples and Guides of Functionality with Alpine.js

    js.hyperui.dev
  • You're welcome.

  • Agreed, this article is old, but I think it does a good job of showing how similar Alpine and Vue are.

  • That idea crossed my mind too. AFAIK, you can't really use SQL in graph databases, and that's a deal breaker for me.

  • Alpine.js @programming.dev

    A comparison of a simple app in Vue.js and Alpine.js

    medium.com /@wearethreebears/a-comparison-of-a-simple-app-in-vue-js-and-alpine-js-2a8c57f8b0e3