Renaming a lot of variables in many Java classes at once

前端 未结 6 1127
清酒与你
清酒与你 2021-01-04 01:51

I work in a pretty large Java-project (2500+ classes) that uses an old code standard where all member variables are prefixed with \"m_\" (e.g m_temperature). There is reall

6条回答
  •  旧巷少年郎
    2021-01-04 02:13

    To answer your second question (are there any more problems)

    1. I would avoid global variables. Favour encapsulation such that you can localise functionality.
    2. I would implement some unit tests such that you can verify future changes. At the moment it appears your only available check is that your project compiles properly.

    I realise both of these are potentially sizable issues in an existing project. But it's worth lookingto identify possible pain points and work on those first of all.

提交回复
热议问题