Wednesday, January 30, 2013

Down With Magic Strings

Patrick Hughes shares a script for scanning the files in his app’s images folder and generating macros that load and verify the images. I agree with his goals, although I’ve solved this particular problem a bit differently. I redirect all image loading through a helper class (with a method per image), which also handles caching and can be unit-tested. I’ve found this level of indirection helpful, as some images need to be processed a bit or loaded in different ways on different OS versions.

Comments RSS · Twitter

Leave a Comment