A person who has been driving for 20 years may not be as particular in watching all the mirrors before turning, holding the steering wheel at ten to two or only make legal u-turns. That person is still probably a better driver than he/she was in the beginning.
However, if you do an illegal u-turn once, you may do it again, all of a sudden you may do it just whenever, by routine, because it works.
A programmer, who has programmed for over 15 years, is in the same way probably a better programmer than he/she was in the beginning of the carrier. However, also programmers may become lazy in obeying all the programming rules.
A common laziness is to make all access modifiers of the java methods public.
New java developers may do it by mistake, but senior developers do it by laziness.
By setting access modifiers in a planned way, we can steer the use of the class to be correct. We also make the readability of the class better and help in debugging, since we have made the doors in to the class more visible. (Otherwise we can’t see the forest because of the trees in front) We build a good fundament! And of course – by being lazy we may just ruin the fundament of the whole class.
My suggestion is what?
I think that if we revise the basics of the language and its rules, we will be inspired to also skip some of our laziness.
And maybe most of all – maybe we get reminded about some good finesse in the java language that we can use!
Instead of being lazy and writing our own code, we could use the capabilities of the language and write less code...This was a tricky sentence, wasn’t it!
I bet most experienced programmers when reading a beginner’s book of java, will be reminded about something useful or even learn something new!
At least I do! I know there are so many good things in java that I should use more often. And by saying it here – I force myself to also take action and do so.
The basic of the java language is not like “once you know how to cycle you will always know how to cycle”. I think it is more like “even if you have been fluent in French – when not practicing you don’t speak as fluent anymore…”
Inga kommentarer:
Skicka en kommentar