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
-
Why does the comment not say it is public?!? I am totally confused now and would not be able to use that method properly.
-
@Gxost it clearly says in the content that this will get the data, not the caller
-
foox674y@Ranchonyx agree that void isn't common, but in some languages heavy constructs are better built in place of the given parameter than returning by value 🤓
-
kamen69954yI'd be more concerned not about a comment someone probably forgot to remove but about the fact that a method that's supposed to return data is passed that data as an argument...
-
Given it returns `void` and accepts a `Data` object as a parameter, I would expect this to set the data... 🤷♂️
-
purist12164yWhat if the function gets the data from an api using some parameters inside the Data variable ?
-
@kiki that reminds me of
https://javascript.info/ninja-code
where it says:
The ideal name for a variable is data. Use it everywhere you can. Indeed, every variable holds data, right?
…But what to do if data is already taken? Try value, it’s also universal. After all, a variable eventually gets a value.
Related Rants
Unnecessary Redundant Comment:
// this get data
public void getData(Data data)
{
.......
}
Why Just Why?
rant
why