MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/badcode/comments/bpevsv/most_useful_helper_function_ever_made/ensev2d/?context=3
r/badcode • u/Andrejfsantos • May 16 '19
100 comments sorted by
View all comments
337
Things this person knew:
How to write a function
Supply a variable to a function
Create and instantiate variables
Create a working for loop
s.Length();
Things this person didn't know:
148 u/Andrejfsantos May 16 '19 My felling is:Look for size()Doesn't exist, make own sizeRealise needs help to count sizeGoogle says use length()Still on the same thinking process and used length () to countI am not seeing any other reason for anyone to write this. That or it used to be a really long method that eventually got refactored to this... 16 u/Fredulom May 16 '19 Yeah, it seems like they didn't realise that "size" wasn't the name of the object property they were looking for lol
148
My felling is:
Look for size()
Doesn't exist, make own size
Realise needs help to count size
Google says use length()
Still on the same thinking process and used length () to count
I am not seeing any other reason for anyone to write this. That or it used to be a really long method that eventually got refactored to this...
16 u/Fredulom May 16 '19 Yeah, it seems like they didn't realise that "size" wasn't the name of the object property they were looking for lol
16
Yeah, it seems like they didn't realise that "size" wasn't the name of the object property they were looking for lol
337
u/Fredulom May 16 '19 edited May 16 '19
Things this person knew:
How to write a function
Supply a variable to a function
Create and instantiate variables
Create a working for loop
s.Length();
Things this person didn't know:
s.Length();