I don't write Java code exactly the same as I used to. Some of the ways my code has changed are due to using an excellent IDE.
One of these I mention in a previous article was about having fields public in some circumstances - I won't repeat the arguments here, I just want to mention that one reason I'd now make a field public when before I would have had a getter/setter is that it is trivial to convert a public field into a getter/setter when you need to (a refactoring called "encapsulate field"** in IDEA). (I still prefer not to have the internals of a class public whether accessed by fields or getters/setters though - tell don't ask.)
Another example is that now I only introduce an interface when it's really needed and not in anticipation of it being needed. Again, it's trivial to introduce the interface when it's needed using the "extract interface" refactoring of the IDE.
I was chatting to Nat Pryce about this and he was agreeing that using an excellent IDE has also changed the way he writes Java. I hope he and others will add comments to mention other ways their programming style has changed as a result of better IDEs.
I know for some people the idea of changing your programming style as a result of what a tool supports is heresy - but I think good development practice means using the tools and language so they work well together.
The examples given above refer to Java development where the team owns all the code rather than when writing an API - I'm not addressing API design here.
** BTW, I think calling the refactoring "encapsulate" is a bit of an exaggeration - really it is just replacing one form of non-encapsulation with another.
Copyright © 2010 Ivan Moore
Subscribe to:
Post Comments (Atom)
8 comments:
Since I am using excellent IDE I don't spend much time up front thinking about what private methods I will need in a class. I just write a code in one place and extract methods when I can see bigger picture. This got even more pronounced when I started to do TDD.
I use the approach you mention regarding extraction of interfaces when needed.
I believe it is important to change programming style (habits) according to used tools. I would certainly work differently if for example I did not use VCS :-)
It should be " IDE affecting" not "IDE eff..."
In the post has been define the IDE coding and how to do IDE coding . Mostly are very like it and used it in this technology.
Søgeoptimering
IDE coding is not always the same. it should be included new features and updated. The programming needs daily improvement.
Portland Condos
Java development where the team owns all the code rather than when writing an API - not addressing API design here.
camping equipment
It being needed. Again, it's trivial to introduce the interface when it's needed using the "extract interface" refactoring of the IDE.
nursery furniture
That people have done some research for these topics it's just not enough in particular, not by enough different groups or people.
Composite doors Huddersfield
Define about the data so that can be enjoy it in this post so nice and interesting post shared on the site so that can be enjoy it.unusually large amount of data onto disk or that your database query time is getting longer and longer.
Frossen skulder
Post a Comment