• 0 Posts
  • 163 Comments
Joined 1 year ago
cake
Cake day: September 24th, 2023

help-circle








  • One nice thing about XML is that there’s an official way to link to the schema from within the document. If you do that you can easily automatically validate it, and even better you get fantastic IDE support via Red Hat’s LSP server. Live validation, hover for keys, etc.

    It’s a really nice experience and JSON schema can’t really match it.

    That said, XML just has the wrong data model for 99% of use cases.





  • Think of it from the company’s point of view. If you’re hiring a new employee then the options for a good candidate are a) move jobs and work for you, b) move jobs and work for someone else. You’re competing with other companies.

    If you’re reviewing an existing salary for a good employee their options are a) do nothing and accept the shitty raise, b) move jobs and work for someone else.

    Moving jobs has significant cost for most people - it’s time consuming, stressful, might involve moving house, etc.

    That downside gives employees who haven’t proven they are looking for a new job a significant negotiating disadvantage.

    If you really want you can tell your boss you are actively looking for new jobs. That will increase your chances of getting a bigger raise, but of course it has other downsides so most people don’t do that.



  • Languages that make use of references rather than pointers don’t have this Dualism.

    It’s not about references vs pointers. You could easily have a language that allowed “null references” (edit: too much C++; of course many languages allow null references, e.g. Javascript) or one that properly separated null pointers out in the type system.

    I agree with your point though, using a special Null value is usually worse than using Option or similar. And nullptr_t doesn’t help with this at all.



  • The biggest problems with gRPC are:

    1. Very complicated. Way more complexity than you want in most cases.
    2. Depends on HTTP 2. I’ve seen people who weren’t even doing web stuff reach for gRPC, and now boom you have a web server in your stack for now reason. Compare to Thrift which properly separates out encodings, transports, etc.
    3. Doesn’t work from the web. There are actually two modifications to gRPC to make it work on the web which means you have three different incompatible versions of gRPC with different feature sets. IIRC some of them require setting up complex proxies, some don’t support streaming calls, ugh. Total mess.

    Plain HTTP can be type safe. Just publish JSON schema or Typespec files or even use Protobuf.


  • TOML is not a very good format IMO. It’s fine for very simple config structures, but as soon as you have any level of nesting at all it becomes an unobvious mess. Worse than YAML even.

    What is this even?

    [[fruits]]
    name = "apple"
    
    [fruits.physical]
    color = "red"
    shape = "round"
    
    [[fruits.varieties]]
    name = "red delicious"
    
    [[fruits.varieties]]
    name = "granny smith"
    
    [[fruits]]
    name = "banana"
    
    [[fruits.varieties]]
    name = "plantain"
    

    That’s an example from the docs, and I have literally no idea what structure it makes. Compare to the JSON which is far more obvious:

    {
      "fruits": [
        {
          "name": "apple",
          "physical": {
            "color": "red",
            "shape": "round"
          },
          "varieties": [
            { "name": "red delicious" },
            { "name": "granny smith" }
          ]
        },
        {
          "name": "banana",
          "varieties": [
            { "name": "plantain" }
          ]
        }
      ]
    }
    

    The fact that they have to explain the structure by showing you the corresponding JSON says a lot.

    JSON5 is much better IMO. Unfortunately it isn’t as popular and doesn’t have as much ecosystem support.