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

help-circle



  • 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.





  • JSON would be perfect if it allowed for comments. But it doesn’t and that alone is enough for me to prefer YAML over JSON. Yes, JSON is understandable without any learning curve, but having a learning curve is not always bad. YAML provides a major benefit that is worth the learning curve and doesn’t have the issues that XML has (which is that there is no way to understand an XML without also having the XSD for it)




  • DrM@feddit.detoProgrammer Humor@lemmy.mlNo rest for the virtuous
    link
    fedilink
    arrow-up
    20
    arrow-down
    1
    ·
    edit-2
    1 year ago

    I don’t really code in my free time, every merge request for a FOSS project I wanted to do so far was for company projects where a feature was missing or buggy. My GitHub and Gitlab accounts are full of outdated forks we needed for a minor change in the FOSS project which I was not allowed to merge upstream



  • Shared hosting sounds like you don’t have your data stored privately and doesn’t sound like less work for the company.

    Don’t look at the name from a technicians perspective, but from the perspective of a manager of a small startup who wants to reduce the overhead for hosting it’s service as much as possible. Also serverless is not wrong per sé, it’s exactly what you as the customer get.

    You could spin it the same way for every other instance. Why do you call GoDaddy “shared hosting”, in the end it’s just a pod on a kubernetes cluster. So why don’t you call it “private kubernetes pod”?






  • Why do companies feel compelled to punish people who use their free product?

    Companies don’t exist out of generosity. When Spotify looses money from non-premium users, they obviously want to encourage you to buy premium. They probably had to make the decision to play more ads or do this and decided that this makes more sense


  • We had a management course in the university where this was one of the main things they highlighted:

    Managers faults are the managers fault.
    Employees faults are the managers fault. Without exception.

    And if you think about it, that’s completely true. If an employee does something stupid, it’s most of the time because they a) had the opportunity to do it and b) they weren’t taught well enough. If the employee keeps doing this mistake, the manager is at fault because he allows the employee to do the job where he can make the mistake. He obviously isn’t fit for that position.