shoes4 icon indicating copy to clipboard operation
shoes4 copied to clipboard

Mutable Constants

Open jaredmoody opened this issue 9 years ago • 2 comments

  • Shoes::LOG
  • Shoes::FONTS
  • Shoes::COLORS
  • Shoes::Common::Style::DEFAULT_STYLES

Each of these constants can be modified at runtime, so shouldn't be constants. There should be a different way of configuring these settings.

jaredmoody avatar Nov 20 '16 06:11 jaredmoody

I think these are Constants that return a mutable objected. That is not evil but can be unexpected. It's way down on the To-do list for Shoes 3.3 to create a class for fonts and colors but there are serious backwards compatibility issues and C level startup 'fun' with fonts.

ccoupe avatar Nov 20 '16 08:11 ccoupe

Agreed, don't think constants should be mutable. Should/could be instance variables on the class then accesses through Shoes.colors etc. imo

However, it's a question how far we want to take the backwards compatibility as it'll definitely break some apps.

However, DEFAULT_STYLES is something we built ourselves imo, so that could/should definitely be fixed and we might want to even split it in a separate issue.

PragTob avatar Nov 20 '16 10:11 PragTob