Let's not look at some stylistic conventions just is about placement of precess we're already doing 2
that. 3
Right the beginning is should be at the end of the line while ending braes should be at the start of 4
the statement. 5
You may also come across quote that beginning base is also at the start of the statement. 6
But I think the style is pretty uncommon. 7
I'm so you can avoid doing that next. 8
Inundation always in any block of code by force basis. 9
Here is an example. 10
The method is indented by force basis and within the method the block is again intended by an adult 11
for business. 12
Lot of programmers also prefer to use DOPs instead of spaces where each stop would pick up on four spaces 13
. 14
If you look up in the Internet you will find that there is this this is going on whatever program most 15
using space would argue that spaces would look consistent across different machines on IDS as a single 16
spaced represents one column on programmers. 17
Tops would argue that DAB would involve fewer keystrokes. 18
Additionally they also argue that each developer can configure the number of spaces that construct each 19
duck. 20
This is something that can be done in the editor setting. 21
So wonderful but much so Bob says to force basis while the other two or three spaces since there is 22
no strict consensus on this. 23
I think you can use whichever you like if it disappears you can stick to four spaces. 24
Otherwise you can use it single to Jindalee for the sake of readability. 25
It is recommended to limit each line to 80 characters but it is always not possible to stick to this 26
lament as some expressions can be really long in this because those long expressions can be wrapped 27
into multiple lines by following these principles. 28
Let me go with these principles first and then I will demonstrate this in my Eclipse already. 29
The first one is about 13 locations and method declarations bevvy me a long list of arguments or parameters 30
. 31
And this is you can break after the comma. 32
That is what arguments or parameters after the comma. 33
Going to next line. 34
Next you may have an if statement with several conditions supported by logical operators. 35
In this case you can brigge before an operator that is an operator rebin the new line followed by subsequent 36
conditions and the same rule also applies to long arithmetic ops. 37
In general when you do such dropping into multiple lines Beder it is after the comma or before an operator 38
always indent newlines by 8 spaces or it's hard to do two types from the first line that got split. 39
So for language split into three lines then second line will be entered by 8 inches from the fast lane 40
and even the total line will be entered by HP says from the first line so second and third lines will 41
be in line with each other. 42
Now let's look at this principles in my lives through a simple command. 43
Eclipse will automatically format the code by applying these principles so these good principles are 44
already incorporated into eclipse. 45
Here is a sample method and here is a method declaration and it has a long list of parameters. 46
So the declaration goes beyond 80 characters and here is an if statement with several conditions. 47
It also goes beyond 80 characters. 48
Then Witan the if statement. 49
We have a turnout operation. 50
It also goes beyond the characters and it is an arithmetic operation with several operators and operands 51
. 52
It also goes beyond 80 characters on the matter and also has a long comment with more than 80 characters 53
so it should also get rocked. 54
So we are in Eclipse now and let me just use this command control chef f that does all the wrapping 55
here and it does the wrapping only for this particular class which we are looking at. 56
So first let's look at the method declaration and the first one was that it needs to be proper after 57
the comma. 58
And that's what is happening here. 59
We also talked about displacing the indentation that it needs to be a space or two paths. 60
In my Eclipse I used tab as the setting so I have good jobs here and same with her. 61
The third line and next is the if statement and we know that the wrapping should be before the operator 62
and you can see that here. 63
Same here. 64
And we said that it has to be a does. 65
I mean look it up lines should be indented to the same column from the last line. 66
So at please you can see that this line this line and also this line are intended to the same column 67
and the space is also two tabs. 68
No it's just that this particular condition is a long condition or two very long. 69
The expression is long and because it was going beyond the characters so it got robbed separately and 70
so. 71
But then when it got wrapped the next line was. 72
Is it on 8 basis from the previous line or I'm here. 73
So that's about the if statement with the operators. 74
Even the Kennedy operation got robbed. 75
And also before this operator which is the colon here and next is it Medich operation. 76
It also got rid of before the operator and there is the eight space or the tab rule which has got it 77
right. 78
Same with that unary operation here and also the comment also got grub. 79
So that said so the Eclipse does everything for us. 80
So that's the nice thing about using an ID so it has incorporated all the conventions for. 81
In addition are not overlapping. 82
So that's the nice thing about using Eclipse. 83
So that's about the conventions for the style stylistic conventions for inundations or not so for wrapping 84
long lines and that set