• 0 Posts
  • 40 Comments
Joined 1 year ago
cake
Cake day: June 12th, 2023

help-circle





  • DrM@feddit.detolinuxmemes@lemmy.worldsystemdeez nuts
    link
    fedilink
    arrow-up
    38
    arrow-down
    1
    ·
    7 months ago

    I updated my sources.list to something non-existing at some point and run sudo apt update && sudo apt dist-upgrade -y && sudo apt autoremove once and it also basically uninstalled everything. But that didn’t even matter, I popped in a recovery disk and could reinstall everything. Pretty great to be able to do all that with Linux, fuck everything up in an instant but after a few hours everything is back again













  • The main problem with JavaScript and TypeScript is that there is such a little entrybarrier to it, that way too many people use it without understanding it. The amount of times that we had major issues in production because someone doesn’t understand TypeScript is not countable anymore and our project went live only 4 months ago.

    For example, when you use nest.js and want to use a boolean value as a query parameter.

    As an example:

    @Get('valueOfMyBoolean')
    @ApiQuery(
      {
        name: 'myBoolean',
        type: boolean,
      }
    )
    myBooleanFunction(
      @Query('myBoolean') myBoolean: boolean
    ){
      if(myBoolean){
        return 'myBoolean is true';
      }
      return 'myBoolean is false';
    }
    

    You see this code. You don’t see anything wrong with it. The architect looks at it in code review and doesn’t see anything wrong with it. But then you do a GET https://something.com/valueOfMyBoolean?myBoolean=false and you get “myBoolean is true” and if you do typeOf(myBoolean) you will see that, despite you declaring it twice, myBoolean is not a boolean but a string. But when running the unit-tests, myBoolean is a boolean.