• 18 Posts
  • 753 Comments
Joined 6 years ago
cake
Cake day: May 31st, 2020

help-circle

  • Hmm, that sounds exactly like my setup. Weird.

    I did have the file created, with {} inside (empty Nix expression). If I git add it, it works as well:

    And yeah, I understand that it’s supposed to be a stacktrace, but other error messages look similarly horrendous and I can often only try to guess what’s wrong by reading the stacktrace top-to-bottom, so I’ve somewhat gotten used to doing that.

    But good to know that these terrible error messages might be a problem with my system. Thanks!


  • Hmm, that’s interesting. For me, it looks like this:

    I actually thought, it said somewhere in there, that the file isn’t staged, but apparently not even that (anymore?).

    You don’t happen to be using Lix or something, do you? I’ve heard that it’s supposed to have better error messages, but I was never sure how much better it might be…

    Edit: Perhaps I should add that those code locations it shows, are not from my code. Only the modules/terminal/new_file.nix in the second-last line is relevant.




  • Yeah, I was gonna say, that might be the root cause.

    In the vast majority of cases, you want Box<dyn Error + Send + Sync>, but folks tend to leave out the Send + Sync, because it looks like additional complexity to them, and because it doesn’t cause problems when they’re not doing async/await.
    It’s better to define a type alias, if you don’t want that long type name everywhere.















  • In my experience, the biggest problem is that maintainable code necessarily requires extending/adapting existing structures rather than just slapping a feature onto the side.

    And if we’re not just talking boilerplate, then this necessarily requires understanding the existing logic, which problems it solves, and how you can mold it to continue to solve those problems, while also solving the new problem.

    For that, you can’t just review the code afterwards. You have to do the understanding yourself.
    And once you have a clear understanding, it’s likely that the actual code change is rather trivial. At least more trivial than trying to convey your precise understanding to an LLM/intern/etc…