If you choose a non-standard indent style, then does it matter?
This is the style that I see most often:
import java.io.FileInputStream; Import java.io.FileOutputStream; Import java.nio.biteBuffer; Import java.nio.channels.FileChannel; Public class test {Static Public Wide Men (String Array []) throws an exception {FileInputStream fin = new FileInputStream ("infile.txt"); FileOutputStream fout = New FileOutputStream ("outfile.txt"); Filechannel inc = fin.getChannel (); Filechannel outc = fout.getChannel (); Bytebuffer BB = Byte Buffer.Allocent Direct (1024); Whereas (true) {int ret = inc.read (bb); If breaks (rate == -1); Bb.flip (); Outc.write (bb); Bb.clear (); }}}
But I like this style where everything starts at the next line:
import java.io.FileInputStream; Import java.io.FileOutputStream; Import java.nio.biteBuffer; Import java.nio.channels.FileChannel; Public class test {Static Public Wide Men (String Array []) throws an exception {FileInputStream fin = new FileInputStream ("infile.txt"); FileOutputStream fout = New FileOutputStream ("outfile.txt"); Filechannel inc = fin.getChannel (); Filechannel outc = fout.getChannel (); Bytebuffer BB = Byte Buffer.Allocent Direct (1024); Whereas (true) {int ret = inc.read (bb); If breaks (rate == -1); Bb.flip (); Outc.write (bb); Bb.clear (); }}}
I find it easy to read, but if I use this style then am I having trouble working with others?
- Decide a conference on the team (preferably a standard one if you Later want to work with others)
- Configure your and everyone IDE to use that format and only those
- Automatically and better repetition on each Ctrl-S.
It will make all the sources uniform at all times, and will ensure that changes in the source repositories are actual changes and later not only improve.
It can be done to configure formatting (I like the defaults) for eclipse, and saves the preferences which can then be loaded by everyone. Also Java -> editor -> activates are allowed for auto refining in every Ctrl-S, which is also a savable priority too.
I have found from above that an additional estimate
- everything should fit on one line
Many designated locals Many give free refinancing, after which their nomenclature, which in turn works well for debugging because you usually have more values in variables, which are shown in the debugger in a single stage , And you have the NullPointerExceptions on each row Keep less opportunities for.
:
Edit on 2014-08-19: It appears that if the eclipse format settings are saved in a file, then IntelliJ IDEA can format the source using that file .
Comments
Post a Comment