• 4 Posts
  • 9 Comments
Joined 2 years ago
cake
Cake day: June 1st, 2024

help-circle
  • Mistakes are easy to make and you want them to show up immediately instead of randomly at runtime. If you have lots of tiles, change the fields later, or manipulate the data in code you’ll make a typo or forget something eventually.

    With a class, every tile is guaranteed to have all the fields, and if you give the fields explicit types, they’re always guaranteed to be the correct type. If you do something wrong, you won’t have to figure out why it’s broken later, because the editor shows red before you even run it.

    Also, the editor autofill only works when it knows what it’s working with.