What features of Odin do you dislike?

We have a few unnecessary duplicate features for the sake of a couple characters, which goes against the first Odin principle—Simplicity:

  • do (including do if)
  • cond ? x : y since if and when variants exist, which match their use (run/comptime) elsewhere wonderfully
  • multiple ways to cast
  • @thing and @(thing)

Consistency in minimizing useless additional code (already done for unused imports and variables):

  • unnecessary casts/transmutes int(an_int)
  • unused procedure parameters
  • place the errors for unused code after a panic call behind a flag, as we do with the rest

Sometimes you can’t follow code without knowing how the compiler works:

  • require parentheses if there’s any possibility of ambiguity in equations/expressions

Flags making things more strict rather than more lax means you have to both be aware of flags as well as remember to apply them yourself:

  • code quality can only go down by default
  • people have to now fix lax library code to use them alongside flags that force correctness, instead of library authors being heavily incentivized to be correct by default
  • you have to enable a bunch of flags to force correctness, adding that much more friction to do the right thing instead of a single -be-chill-and-enjoy-the-party flag while experimenting

Already mentioned by others, but the way we’ve normalized certain instances of implicitness causes implicit issues when being able to tell if we’ve fucked something up or not would be vastly preferred:

  • I have to know when something allocates since it always requires additional work/thinking (changing the allocator and/or having to deallocate it), so it only does harm to hide the allocator parameter from plain view
  • @(require_results): I have to check every procedure I call to ensure I’ve used all the return values, so my application doesn’t have the ability to magically blow up in my face. We already have the ability to assign to _, and outside of a few procs such as print, are necessary in order to have more reliable software. There’s hundreds of these in the codebase, and there should be far more—reversing it so a flag is required when you want optional results makes more sense

The usual motivational video to help get the spec written ^ _ ^ https://www.youtube.com/watch?v=ZXsQAXx_ao0

1 Like