Are hard-coded STRINGS ever acceptable?

后端 未结 9 1046
臣服心动
臣服心动 2021-01-07 04:21

Similar to Is hard-coding literals ever acceptable?, but I\'m specifically thinking of \"magic strings\" here.

On a large project, we have a table of configuration o

9条回答
  •  暖寄归人
    2021-01-07 04:56

    I really should use constants and no hard coded literals.

    You can say they won't be changed, but you may never know. And it is best to make it a habit. To use symbolic constants.

提交回复
热议问题