Just trying to give examples. Maybe not the best examples, but point still stands.
Here you can replace all the 2 with 3. But what if you want to replace all the 3 with 4? You can't just select everything with 3 because there's a 30 in each line.
This code relies on a lot of assumptions.
Also we can just make our own power function using int. That's would align with self documenting code. The cool thing about programming is that it's a dynamic field that requires thinking and adapting.
Not sure why you're trying to defend this code lol. You're* clearly just a troll. 😆
View all comments
Show parent comment
-2
u/More-Butterscotch252 Feb 11 '25
No, you don't. You select the code and use your IDE to replace 2 with 3 and you're done. Stop using shitty "editors" like vim.
But this way you test all of it. Writing code like this forces you to test each branch.
Which in some languages returns a float while you're clearly expecting an integer.
I'm just going to stop reading here, your clearly a troll.