|
|
|
|
|
by morelish
1451 days ago
|
|
> I'll make these four lines of code a function in case I need to call it more than once later on - you know, what if that's needed? The code example is not always right. Beware, if you know it will be needed, you might as well make it a function now. Likewise if you think probably it will be needed, why not make it a function now? It’s not a good review comment or rejection to say “yeah but I don’t want to do that because it’s not yet needed”. Sure, but what if you are just being lazy and you don’t appreciate what it should look like long term? The “I don’t want to write a function yet not needed” is not a clear cut example. |
|
I wasn't aware that some devs have a side hustle as fortune tellers?
On a more serious note, you should take a look at Sandi Metz's "the wrong abstraction". https://sandimetz.com/blog/2016/1/20/the-wrong-abstraction