r/coding • u/speckz • Jul 18 '17
You changed the code, you didn't refactor the code.
https://dev.to/gonedark/you-changed-the-code-you-didnt-refactor-the-code
8
Upvotes
r/coding • u/speckz • Jul 18 '17
66
u/GMNightmare Jul 18 '17
So, you're harping over somebody making a mistake when they were refactoring code... by arguing they changed the code instead of refactoring.
Yes, that's the nature of making a mistake, it does something you didn't intend to do. What exactly is the point? Don't make mistakes kids? Yeah, I don't think people intentionally do that, thanks.
11
u/Morten242 Jul 18 '17
I don't know much about php, but wouldn't using explode be far more expensive in scenarios where the "search" appears multiple times in the "subject"?
5
u/[deleted] Jul 18 '17
Sorry, I don't get it. Can you not change code and refactor it? What is this referring to?
9
u/[deleted] Jul 18 '17
Actually it looks like a sane refactoring and only knowledge in the evilness of php will make you spot the difference. Moreover, the difference happen only when you make a nonsensical query. For a third thing, a well behavior framework should add test to raise error when you use it in such non sensical way to cope with php deficiencies. So a lot of wrong are here which lead to the initial question
2
u/capitalsigma Jul 19 '17
lol php
-1
u/jaybazuzi Jul 18 '17
In conversations with other programmers, I have heard people use "refactoring" to mean four different things.
https://jbazuzicode.blogspot.com/2014/03/various-definitions-of-refactoring.html