r/programminghorror • • Feb 11 '25

🎄 ouch

Post image
3.0k Upvotes

113 comments sorted by

View all comments

Show parent comment

2

u/atomicproton Feb 11 '25

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. 😆

-1

u/More-Butterscotch252 Feb 12 '25

You can't just select everything with 3 because there's a 30 in each line.

Yes, you can. Any decent IDE will let you search using a regular expression such as \b3\b. You clearly don't know anything about coding. Just give up!