Poll of the Day > Why are there any code editors where there's an option to disable line numbers?

Topic List
Page List: 1
SteamedHams
12/19/17 5:32:53 PM
#1:


Is there any reason you'd want to have line numbers turned off? It's especially annoying when the default is off and you have to go figure out what menu has the option to turn them on.
... Copied to Clipboard!
#2
Post #2 was unavailable or deleted.
TheWorstPoster
12/19/17 5:49:15 PM
#3:


My programs would have been piss easy to make, if GOTO was available.
... Copied to Clipboard!
#4
Post #4 was unavailable or deleted.
SteamedHams
12/19/17 5:51:34 PM
#5:


Never even heard of goto before, but it doesn't sound like something that makes line numbers themselves bad. It's just easier to debug when you get an error message with a line number, or to tell somebody "look at line 42" rather than reading them a function name, upon which they might look at the wrong location anyway.
... Copied to Clipboard!
DrPrimemaster
12/19/17 5:57:20 PM
#6:


SteamedHams posted...
Never even heard of goto before, but it doesn't sound like something that makes line numbers themselves bad. It's just easier to debug when you get an error message with a line number, or to tell somebody "look at line 42" rather than reading them a function name, upon which they might look at the wrong location anyway.


Yeah, have you never debugged code zang?
---
Metroids Suck
... Copied to Clipboard!
#7
Post #7 was unavailable or deleted.
Sahuagin
12/19/17 10:00:00 PM
#8:


SteamedHams posted...
Never even heard of goto before, but it doesn't sound like something that makes line numbers themselves bad. It's just easier to debug when you get an error message with a line number, or to tell somebody "look at line 42" rather than reading them a function name, upon which they might look at the wrong location anyway.

ignoring that you're probably a joke account, there's a difference between line numbers and showing the row and column of the cursor. line numbers are so obsolete it's ridiculous. row and column is like the most minimal of IDE features.
---
... Copied to Clipboard!
DrPrimemaster
12/19/17 10:05:16 PM
#9:


Sahuagin posted...
SteamedHams posted...
Never even heard of goto before, but it doesn't sound like something that makes line numbers themselves bad. It's just easier to debug when you get an error message with a line number, or to tell somebody "look at line 42" rather than reading them a function name, upon which they might look at the wrong location anyway.

ignoring that you're probably a joke account, there's a difference between line numbers and showing the row and column of the cursor. line numbers are so obsolete it's ridiculous. row and column is like the most minimal of IDE features.


I feel like Im missing something. What do you do when youre using notepad++ or vscode?

Im talking about the line the code is on when I look at it in the editor.
---
Metroids Suck
... Copied to Clipboard!
Duck-I-Says
12/19/17 10:11:19 PM
#11:


Zangulus posted...
Yes, many many many hours worth... which is why I said line numbers mean even less if you have a good IDE. It will take you directly to the offending line.


Now go do it with GDB while ssh'ed into a production box without x forwarding.
... Copied to Clipboard!
Sahuagin
12/19/17 10:22:09 PM
#12:


DrPrimemaster posted...
I feel like Im missing something. What do you do when youre using notepad++ or vscode?

I guess notepad++ actually has a line number column. that seems unnecessary, but yeah I was thinking of like gwbasic line numbers. all you really need is the line number of the cursor in the status bar, a whole column of line numbers is a waste of space.
---
... Copied to Clipboard!
#13
Post #13 was unavailable or deleted.
shadowsword87
12/19/17 10:33:22 PM
#14:


TheWorstPoster posted...
My programs would have been piss easy to make, if GOTO was available.


Bruh, that means you aren't thinking about programming well enough.
There are always other options.
... Copied to Clipboard!
Dikitain
12/19/17 10:48:26 PM
#15:


Line numbers are nice when you are doing code reviews, but in an editor they aren't really necessary. If I have to reference a line number, I just type ctrl-g, the line number, and boom I am there. What is a ton more useful is blame, so that when I look at a shitty piece of code I know immediately who the numb-nut was that programmed it.
---
I am a senior software engineer. If you see me post here, I am tired of writing TPS reports.
... Copied to Clipboard!
Dikitain
12/19/17 10:54:11 PM
#17:


DrPrimemaster posted...
Zangulus posted...
Duck-I-Says posted...
Zangulus posted...
Yes, many many many hours worth... which is why I said line numbers mean even less if you have a good IDE. It will take you directly to the offending line.


Now go do it with GDB while ssh'ed into a production box without x forwarding.


So what you're saying is me saying that if you have a good IDE you don't need line numbers, and then you post about a limited scenario where it doesn't apply...

Ok.


But you dont always have a good IDE, the topic is about code editors as well.

If you don't have a good IDE, you either:

A) Are working on shell scripts that are so small you probably don't care to have line numbers anyways or
B) Are working on a project that is so old/archaic it needs to be rewritten.

Even then, VI or Emacs has the option to go to a line number without needing to have it visualized for you.
---
I am a senior software engineer. If you see me post here, I am tired of writing TPS reports.
... Copied to Clipboard!
SteamedHams
12/19/17 11:29:02 PM
#18:


Why am I "probably a joke account"
... Copied to Clipboard!
SteamedHams
12/19/17 11:30:42 PM
#19:


Also what is this about row/column? Isn't having a row reference basically the same as a line number? I guess you'd have to elaborate more as to how it's so much better than a line number
... Copied to Clipboard!
Sahuagin
12/20/17 12:47:25 AM
#20:


SteamedHams posted...
what is this about row/column? Isn't having a row reference basically the same as a line number?

yes a single line number (as well as column number) of the text cursor, as opposed to a line number for every single line in the document at all times.

as diktain points out, you almost don't even need that with Ctrl-G, or these days sometimes there are tools that will auto-hyperlink a stack trace for you, even one you copied yourself
---
... Copied to Clipboard!
Duck-I-Says
12/20/17 2:46:10 AM
#21:


Zangulus posted...
So what you're saying is me saying that if you have a good IDE you don't need line numbers, and then you post about a limited scenario where it doesn't apply...


What I'm saying to you is that there are still use cases for wanting line numbers. Also you completely missed my point given that you don't seem to realize in the scenario I brought up most people will have a a good IDE up so they can, you know, look at the code in an IDE while using GDB. Of course you would know that if you were more than a hobby coder because it really isn't THAT rare of a use case in the professional world.

I don't think anyone's arguing that you can't do things without line numbers, but they're definitely helpful and there really isn't much of a reason not to have them. They're not intrusive and it's extra information. Hell you don't even technically need to have line numbers showing for your original use case, gotos, either. It's just that like with many other cases, it's helpful.
... Copied to Clipboard!
Yellow
12/20/17 3:13:28 AM
#22:


It's probably worth noting a goto @label is probably more efficient than most other loops. Goto might actually be underrated.

Why

do {} while (true)

when you can

label:
goto @label

It's just as modular, and the program doesn't have to waste time checking if true is true.

Now, goto "line number", that's some terribad programming lol. Add one thing to the top of your program and the whole thing breaks. It's so ridiculous not even the version of basic I knew used it.
---
... Copied to Clipboard!
shadowsword87
12/20/17 3:52:29 AM
#23:


Yellow posted...
It's probably worth noting a goto @label is probably more efficient than most other loops. Goto might actually be underrated.

Why

do {} while (true)

when you can

label:
goto @label

It's just as modular, and the program doesn't have to waste time checking if true is true.

Now, goto "line number", that's some terribad programming lol. Add one thing to the top of your program and the whole thing breaks. It's so ridiculous not even the version of basic I knew used it.


Because you can just use

while (true){
}


you goober.

And are you really needing all of that extra two cycles for the CPU to pull the number (which is just 1) to the acc and test greater than zero to then move to the same point?

It's fine, just use what is easier on the programmer.
... Copied to Clipboard!
Yellow
12/20/17 4:15:33 AM
#24:


shadowsword87 posted...
Because you can just use

while (true){
}

you goober.

And are you really needing all of that extra two cycles for the CPU to pull the number (which is just 1) to the acc and test greater than zero to then move to the same point?

It's fine, just use what is easier on the programmer.


In that regard

while (true){
}

would be the same as

do {} while (true)

It's just one has to solve for true at the start of the loop and the other does it at the end. Either way it's solving for true every single loop. It might make a difference if the loop is unthrottled. It could be a significant difference on extremely time intensive loops.

I remember on the old basic we were using, someone actually discovered that

i = 0
@Loop
if i > 4 then goto @Exit
i = i + 1

'Insert time intensive task here

goto @Loop
@Exit

Was actually much faster than a regular for loop, even though it does the exact same thing. It could be worth playing with. Note Visual Studio is much smarter than that old interpreter I was using and uses all kinds of tricks to speed up code under the hood, so it might not be that straightforward.
---
... Copied to Clipboard!
kind9
12/20/17 4:21:06 AM
#25:


Most people use

while (1);

for an infinite loop
---
... Copied to Clipboard!
#26
Post #26 was unavailable or deleted.
kind9
12/20/17 8:31:08 AM
#27:


Yellow posted...
It's probably worth noting a goto @label is probably more efficient than most other loops. Goto might actually be underrated.

Why

do {} while (true)

when you can

label:
goto @label

It's just as modular, and the program doesn't have to waste time checking if true is true.

Now, goto "line number", that's some terribad programming lol. Add one thing to the top of your program and the whole thing breaks. It's so ridiculous not even the version of basic I knew used it.

Wouldn't the compiler create the same or very similar machine code for both of those? I'm not sure but I know compilers are pretty smart in that regard.
---
... Copied to Clipboard!
Dikitain
12/20/17 8:54:13 AM
#28:


kind9 posted...
Yellow posted...
It's probably worth noting a goto @label is probably more efficient than most other loops. Goto might actually be underrated.

Why

do {} while (true)

when you can

label:
goto @label

It's just as modular, and the program doesn't have to waste time checking if true is true.

Now, goto "line number", that's some terribad programming lol. Add one thing to the top of your program and the whole thing breaks. It's so ridiculous not even the version of basic I knew used it.

Wouldn't the compiler create the same or very similar machine code for both of those? I'm not sure but I know compilers are pretty smart in that regard.

Pretty much, modern compilers haven't implemented goto in the way it was originally intended in ages. In most cases they treat it as a function call. Plus in most cases having a infinite loop like that is a bad programming practice as well. You would want some kind of service that gets called when it needs to do work, not something that needs to constantly check if work is available. The only time you should be doing something like that is if you are writing an idle process for an operating system.
---
I am a senior software engineer. If you see me post here, I am tired of writing TPS reports.
... Copied to Clipboard!
DrPrimemaster
12/20/17 11:56:33 AM
#29:


I don't understand why you guys are so vehemently against having line numbers displayed. If they were displayed by default would you ever go in and get rid of them?
---
Metroids Suck
... Copied to Clipboard!
#30
Post #30 was unavailable or deleted.
SteamedHams
12/20/17 12:17:49 PM
#31:


I don't understand it either. The space argument is dumb because:

- Many editors pre-reserve that space even if the numbers aren't displayed
- Writing code that requires too much scrolling to the right is bad practice regardless
- You lose a lot more space from what editor you're using. A lean editor like N++ lets you see a lot more code than a VS window with a bunch of project/debugging panes. What are you really losing with 2-5 extra characters at that point?
... Copied to Clipboard!
#32
Post #32 was unavailable or deleted.
Sahuagin
12/20/17 8:43:10 PM
#33:


SteamedHams posted...
- Many editors pre-reserve that space even if the numbers aren't displayed

it's used for other more useful things

SteamedHams posted...
- Writing code that requires too much scrolling to the right is bad practice regardless

not sure what this means. mostly I just don't want to stare at a bunch of line numbers all day that I'm not actively using. in the rare case that I need to know the line number, it's in the status bar.

SteamedHams posted...
a VS window with a bunch of project/debugging panes.

you don't need "a bunch of panes" when you have multiple monitors.
---
... Copied to Clipboard!
#34
Post #34 was unavailable or deleted.
SteamedHams
12/20/17 8:49:02 PM
#35:


I have multiple monitors, but when you drag the code pane out of VS it's just a sub-window of VS IIRC, unless they changed that in newer version. By that I mean it doesn't have a full menu or a spot in the taskbar, which I don't like. Anyways, my point is that other things are going to affect space and code readability much more than line numbers
... Copied to Clipboard!
#36
Post #36 was unavailable or deleted.
knivesX2004
12/20/17 9:22:09 PM
#37:


The only reason I like line numbers is so I can tell a coworker to "put a breakpoint on line x" when I review code.
... Copied to Clipboard!
SinisterSlay
12/20/17 11:19:41 PM
#38:


Line numbers have a ton of uses. Sometimes even just screenshots so you can send code and line numbers so other developers can find it again.
And it really sucks when you lose the line numbers. Like minified code or scripts that get mashed together at compile, making the line number wrong. Try debugging shit in xcode for mobile development, it just outputs basic console logs, no line numbers. You usually have to search your code for the console outputs to have a chance of finding it.
---
He who stumbles around in darkness with a stick is blind. But he who... sticks out in darkness... is... fluorescent! - Brother Silence
... Copied to Clipboard!
RedPixel
12/20/17 11:24:34 PM
#39:


When the loop gets caught in a loop and it makes you forget how to loop...

ApCIWgU
---
Working in a team is great! It always helps to have someone else to blame.
... Copied to Clipboard!
Yellow
12/21/17 4:59:31 AM
#40:


Might as well keep this off topic coding topic off topic.

I just made my own .zip format using QT. Woohoo. I just finished the code that zips, now I just have to code the unzip.

I'm in the middle of making a mod manager for Wii U games to be used on PC with the Cemu emulator (or Cafe too if anyone knows about that). It's turning out pretty good, I have to say. No roadblocks, UI and functionality on par with the Nexus Mod Manager. Attention to detail in terms of adding future functionality.

I hope to help Wii U games become what Skyrim was with PC modding.

Top secret, shh. No one on gbatemp will hear about this until I'm done.
---
... Copied to Clipboard!
Topic List
Page List: 1