LogFAQs > #892551750

LurkerFAQs, Active DB, DB1, Database 2 ( 09.16.2017-02.21.2018 ), DB3, DB4, DB5, DB6, DB7, DB8, DB9, DB10, DB11, DB12, Clear
Topic List
Page List: 1
TopicWhy are there any code editors where there's an option to disable line numbers?
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!
Topic List
Page List: 1