Questions tagged [methods]
A method is a procedure that is associated with a particular object. The purpose of the method is to guide the behavior of the object, and the tag should be used when this is the case.
206 questions
-4 votes
2 answers
340 views
What to name a method which reads and sets value without return value?
I have a method like this private void foo() { this.myValue = readSomeValueFromFileSystem() } What is the good name for that ? Is there any convention about it ? I feel that it is kinda set but ...
6 votes
4 answers
3k views
How do you honour the principle to only do "one thing" in a method in reactive streams?
Uncle Bob mentions in his book "Clean Code" that "[f]unctions should do one thing [...] only" and advocates that a method should stick to one abstraction level (I'd call it flight ...
-4 votes
1 answer
119 views
Is it possible a class method have the same name as an existing function? [closed]
Courtesy link: What Are The Specific Meanings Of The Terms: Functions, Methods, Procedures, and Subroutines? What's the difference between a function and a method? In the linked question: function,...
1 vote
2 answers
799 views
For more than one parameter, when NOT to introduce parameter object?
I know there are some questions about "Introduce parameter object", eg: Is "Introduce Parameter Object" actually a good pattern?, Should we avoid custom objects as parameters?, ...
-1 votes
1 answer
137 views
Most relevant objectively-quantifiable reason to choose to use an object method vs. a function that just accepts the object as a parameter? [closed]
When writing code in a programming language that has the option of creating standalone functions vs. methods of a class or struct, what is the most relevant objectively-quantifiable reason to choose ...
1 vote
2 answers
517 views
In what language does a method not return a value and a function does?
I don't know from where I got this but in my head a function returns a value and a method does not. I know that with OOP a method is a function related to a class. But I am trying to remember where I ...
0 votes
1 answer
165 views
Different gateway method implementations
Sometimes I need to use the same use case with different details implementation. It is easy and straightforward for presenters as each use case has its own output port and therefore different ...
-1 votes
1 answer
455 views
What should be a method prefix that makes calculation based on the parameter [closed]
I have a method, that takes a list of students, and returns the student with the best score. Part of me wants to call it Student getBestStudent(List<Student> students), but I think that get ...