Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
orijin20208y@viking8 but you NEED to do something with the input parameter before you return it. Otherwise why bother making the function? 😃
-
hoggchan7918ymaybe there will be some modifications to this function? It serves as a temporary placeholder now? but so far it's a fair award :)
-
arekxv10528yWell. I guess it would be a feature to check if the id is in the database if you remove the "fix" somebody did.
But yeah... kinda useless :) -
@hoggchan but why would you ever create a function called "get_id_user" that requires the id of the user you want to get the id for as the only parameter? Even as a placeholder? :P
-
willol13898yWhat IDE is this?
The real question being: can I have those sexy arrows with PHPStorm? -
Zixalf478yBefore looking at the uselessness of the method I'd probably say it's not the model's responsibility to retrieve data or to execute queries or to store a reference to the database connection :)
-
hoggchan7918y@NathanDoesDev No for your first question. Actually this function does not do what its name means, therefore, it's just a joke as far as I can tell from this edition of code. No more judgements I can make until former or later code is shown.
(´ー`) -
flag020318y@hoggchan that's what I was thinking. There is a commented out return below it. Meaning it was used to return something else before and they chose to move the resolution somewhere else. And since this fn was called at many places, easier option is to just make it return the passed value. I have done something like this everywhere in a personal project of mine. Yes that thing is a mess and I have to do a almost full rewrite before I can make major changes. but it works.
-
@willol this article explains what those arrows are (https://medium.com/larsenwork-andre...) and this is a list of some of the best ligature-enabled programming fonts (https://slant.co/topics/5611/...)
-
fergor2328y- "quickly! The code runs too fast, we must slow It down!!"
- "Lets put random db queries everywhere encapsulated in functions!"
- "yess perfectttttt durdur hur dur" -
infekted4898y﴾͡๏̯͡๏﴿ O'RLY? Even my two level comments are more meaningful than this piece of code. [•_•]
-
lewdogg9958yI guess it is missing a //TODO
LOL
Pointless in two ways... 1. Because you already know the user is and number 2 is obvious.
I love this shit! -
mrlkts1028yWhen you copy useless shit from stackoverflow :D used to happen to me a lot tbh
Relevant keyword: cargo cult programming -
@the-alias - good thinking outside the box - seems like the only reasonable explanation
-
ultrono23508y@NathanDoesDev could be a legacy function that is used extensively throughout. Granted, the code hitting the db should have been removed. However, if some form of ongoing refactor is happening that function may, at s push, make sense.
Related Rants
And the most useless function of the year award goes to...
undefined
function
query
db