Default Line Numbers in Eclipse
Join the DZone community and get the full member experience.Join For Free
i rediscovered an “ide hot topic” yesterday: line numbers in the editor. for me, this rediscovery started with a tweet:
to me the single thing that epitomizes the shittyness of eclipse as an ide is that line numbers are off by default. #fb
hopefully my kids aren’t reading this (i don’t like them to see misspellings).
frankly, i don’t get why this is a big deal. when i require line numbers, i turn them on. it’s just a preference. i don’t understand how anybody can be so passionate about the default state of something that can be so easily changed (turning on line numbers is as simple as enabling the option in the context menu from the left-gutter of the editor). frankly, there’s lots of other areas for improvement in eclipse (like word wrap, for example). like many other things in life, however, just because i don’t understand it, it doesn’t mean that it’s wrong.
i really don’t understand anything more than an infrequent need for line numbers in a code editor.
my response stirred up a few responses from some people for whom i have a great deal of respect. clearly this is a bigger deal than i’m inclined to believe.
@waynebeaton personally, it drives me nuts when i go to someone else’s desk and they don’t have line numbers turned on.
@waynebeaton possibly a force of habit. i didn’t use debuggers when i first learned java. @irbull made some good arguments though i see.
@waynebeaton stack traces / build failures (from hudson), working remotely with someone (see line xxx).
@waynebeaton personally i always turn line numbering on.
@kingargyle @waynebeaton +1 for default line numbering in eclipse
@waynebeaton its not like line numbers takes up huge amounts of space in your editor and when you debug in php its always needed
rt @kingargyle @waynebeaton personally i always turn line numbering on < line numbers are for people who learnt to program in basic
i’m not sure if @alblue is coming out for or against line numbers. i learnt to program in basic on an apple ii plus (who needs lower-case letters?), so line numbers are a familiar enough concept to me (i vividly recall the excitement of finding a utility that could renumber a basic file).
ah, nostalgia. excuse me while i queue up van halen – van halen .
personally, i almost never need line numbers when i’m writing java code. this is most likely a carry-over from my smalltalk days. in my experience, the combination of my personal preference to write very concise methods (i tend to follow a seven-ish lines of code per method metric), great debugging support, and that cool ability to click on a line from a stack trace in the console or junit view seem to give me everything that i need for day-to-day development. probably the only time that i might even want line numbers in java is if i had to debug a bunch of stack traces from a production system. but code compiled for production deployment doesn’t always have line number information anyway…
php is a different story. it doesn’t take too long for me to turn on line numbers when i’m editing php code using the php development tools . of course, i haven’t quite sorted out the debugging story in php (this is similar to @rcjsuen’s argument about familiarity: i didn’t have a debugger for so long that i got used to not having it).
i’m sure that there are many more opinions than have been expressed in this short exchange. line numbers on by default was requested in bug 191154 , but didn’t generate any traction (i.e. nobody added themselves to the cc list, or voted) before it was closed as wontfix. bug 293888 proposes to set this as the default in the eclipse ide for education project (this–by the way–is a real easy bug to submit a patch for if you’re a student wanting to get involved with eclipse).
in the end, it comes down to personal preference. but an “epitomizing feature”? i don’t buy it.
Opinions expressed by DZone contributors are their own.