Skip to content

Instantly share code, notes, and snippets.

@lancejpollard
Last active June 4, 2023 07:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lancejpollard/f0e05792495967b26481733573ff2191 to your computer and use it in GitHub Desktop.
Save lancejpollard/f0e05792495967b26481733573ff2191 to your computer and use it in GitHub Desktop.
Ideas for Optimal Software Implementations

Ideas for Optimal Software Implementations

This gist is a potentially slowly evolving collection of ideals when it comes to coding. It's hard to think of it all at once, and sometimes it's hard to find an answer ever until you discover it for yourself. So going to try and capture that kind of stuff here. Going to try and include the reason why each note is important to consider as well.

Show all of the errors at once

When writing code like in TypeScript, it shows you all of the possible errors in your code at once (here is the bottom of an error trace showing 9 errors):

...
s/node_modules/.pnpm/ts-node@10.9.1_@types+node@18.11.17_typescript@4.9.4/node_modules/ts-node/src/esm.ts:409:15)
    at async nextLoad (node:internal/modules/esm/loader:163:22)
    at async ESMLoader.load (node:internal/modules/esm/loader:605:20)
    at async ESMLoader.moduleProvider (node:internal/modules/esm/loader:457:11) {
  diagnosticCodes: [
    2345, 2339, 2339,
    2339, 2339, 2339,
    2339, 2339, 2339
  ]
}

This is helpful so you don't have to step through one error, fix it, see another error you didn't see before, fix it, etc. Most programming languages are like this, showing potentially dozens of errors at once (I'm thinking C or Rust in addition to TypeScript). But most apps are not like this, REST APIs often just show you one key at a time that is error-pronne, and you have to fix, try, fix try etc. rather than seeing them all at once, which is annoyoing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment