30+ years of tech, retired from an identity intelligence company, now part-time with an insurance broker.
Dev community mod - mostly light gardening & weeding out spam :)
As with any other rule or best practice, do not just follow it all the time. Sometimes it's better to ignore it.
My mental process is:
If I refactor this code will it result in an easier code? (easier to read and easier to change later on) If the answer is yes then I do the refactor. If the answer is no, then it will stay as it is even if there are more than 5 imports.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Good rule :) I apply similar to most languages I work with. Can I use wildcards though?
Then there are auto import features in IDEs, which may be considered harmful?
Hey Phil:
As with any other rule or best practice, do not just follow it all the time. Sometimes it's better to ignore it.
My mental process is:
If I refactor this code will it result in an easier code? (easier to read and easier to change later on) If the answer is yes then I do the refactor. If the answer is no, then it will stay as it is even if there are more than 5 imports.