Search code examples
delphidelphi-xe7

Is it ok to mix unit names in my USES clause?


Is is ok to have something like this?

Uses SysUtils, System.Classes;

instead of

Uses System.SysUtils, System.Classes;


Solution

  • The code will compile if you have included System in the project's unit scope names option. So in that sense what you are proposing is alright.

    However, in terms of readability, it is surely better to settle on a policy and stick to it. Mixing and matching like this makes your code less clear, in my view.