-1

Lately I've been reading the Java Code Conventions, and I noticed that lines shouldn't have more that 80 characters, and because I work in a 24 inch screen the code lines can be quite large and I still can read it easily, so the question is:

Does eclipse has any option to read code lines, like in the vertical way?

If not is there any option I could use?

Mureinik
  • 297,002
  • 52
  • 306
  • 350
Antonio Aguilar
  • 532
  • 1
  • 6
  • 14
  • If you are working on a team, there may be a formatting convention for the codebase. So even if the formatting were changed on your setup, the changes would be taken out each time you save or commit. – Tim Biegeleisen May 26 '15 at 01:22
  • 1
    Personally, I've never once followed that code convention. I can't stand having `println()` statements, function calls, function declarations/etc split up into several lines. To me, that's the hardest stuff to read. I ended up changing Eclipse's settings to allow 160 characters per line.... – Aify May 26 '15 at 01:24
  • I think this might be what you're looking for? http://stackoverflow.com/questions/1248895/is-there-an-eclipse-line-width-marker – Mark May 26 '15 at 01:36
  • i got eclipse setting of auto-format code , guess it should auto-follow general standards – Srinath Ganesh May 26 '15 at 02:07
  • If I should add, if you want to do it on the fly (by habit I do this) hit CTRL+F on Windows (Linux too?); I think it would be Cmnd+F on Mac. – CoderMusgrove May 26 '15 at 02:27

2 Answers2

1

I use Eclipse Kepler.
From the toolbar, Click on Window and select Preferences.
In Preferences, Expand General-->Editors-->Text Editors.
Enable Show Print Margin.

The default is 80 characters.

0

If you look at the bottom and a little to the right of the IDE window by having selected a line, you can see this (active by default):

Bottom of Eclipse

Where the pair 246:103 is a line:column pair (image works as an example).

I suggest though that you follow a coding convention agreed between your coding team, or even your own for a good coding style if you want. This coding convention was applied in old ages - in fact, it came out of IBM punch cards and was useful in small terminals. Of course, you are free to follow this convention if you want, in order to be in line with the book.

Community
  • 1
  • 1
Nick Louloudakis
  • 5,856
  • 4
  • 41
  • 54