java - reason for two eclipse warnings -
i wondering main reasons why eclipse warns developers following things:
- the value of local variable xxx not used
- the import xxx never used
i'm thinking 1 reason make code cleaner. knows list of reasons behind warnings (like memory concerns, , things that)?
thanks!
it's make code readable , avoid clutter - it's easy loose track when file starts getting large, , having non-functional lines of code therefor best avoid. it's readability... well, , removing unused imports, ease compilers job ever (read: very slightly).
if eclipse notice unused import or variable, can damn sure compiler (since eclipse compiling code while code generate warnings). compiler try optimize as possible, if sees unused variable (or import), doesn't bother include them in compiled byte code.
but it's coding style not have unused code;
in java , (most) other high-level languages, don't have worry things, since don't have manage memory-allocation. supposing compiler didn't catch whatever reason when compiling (perhaps if writing in programming language), object or data referenced variable taking memory space, , if lot of unused variables took memory space... potentially lot of memory used nothing.
Comments
Post a Comment