#Code review on beatsaber mod

1 messages · Page 1 of 1 (latest)

honest glacier
#

I modernized the mod but I still had to use the old code to work off of, so keep in mind that this is not all mine or how i would do it

#

but i got it in a working state and want a code review just to see what i could make better

chilly swan
#

Seeing a few magic numbers and magic strings

chilly swan
#

@honest glacier

honest glacier
#

wym

#

@chilly swan

limpid rover
#

@honest glacier "magic values" are fixed values randomly distributed throughout the codebase. They usually should be avoided, because you oftentimes can't immediately see what they are meant to do. Also, when using "magic" string values, you are prone to making typos.
A better idea generally speaking, is to put constant values that you use in multiple places into constant variables. That won't only prevent typos, but also make maintaining the code a lot easier, if you ever need to change said values.

I haven't looked through your entire code, but I imagine nt was referring to places like this: https://github.com/Redageddon/BeatSaberCustomBackgrounds/blob/master/CustomBackgrounds/UI/Settings.cs where you use the same string literal repeatedly.

honest glacier
#

how do i close this post, i am abandoning this now

limpid rover
#

Imma close it for ya blobOk

chilly swan
honest glacier