Skip to main content

Questions tagged [functions]

Function is a block of code which performs a specific task.

7 votes
8 answers
942 views

According to Is it wrong to use a boolean parameter to determine behavior?, I know using boolean parameters to decide the behaviour is bad, for example, when using boolean parameters as the following: ...
wcminipgasker2023's user avatar
9 votes
7 answers
3k views

For example, if the sleep time of a function would change after first execution but the output remains unchanged, e.g.: public static int myFunction(){ try { Thread.sleep(MyClass....
wcminipgasker2023's user avatar
17 votes
8 answers
5k views

When is it better to pass data to a function in a parameter, and when is it better for the function to just fetch the data itself? Here's some simplified examples in PowerShell: Option 1 (give the ...
Nova's user avatar
  • 181
6 votes
4 answers
3k views

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 ...
Christian's user avatar
  • 171
0 votes
1 answer
595 views

I've just accidentally came across this answer about inlined functions and I'd like to know how this affects call stack. But I can't add comments because I don't have enough rep so I decided to ask ...
b3rry's user avatar
  • 3
0 votes
0 answers
325 views

I have a question related to the best approach when resources are limited, such as on the Azure Function consumption plan. I have an IoT device, and the number of IoT devices is likely to increase to ...
user8400863's user avatar
0 votes
0 answers
149 views

From what I understand from this answer, it is not possible to use a typeddict and typechecking in a function. So for example, if one has a function: def some_func(some_int: int, some_dict:...
a.t.'s user avatar
  • 225
2 votes
2 answers
263 views

I have an intuition, that I'd like to read what others have talked about. To me, it seems fairly intuitive that when you have a function which is called multiple times with the same arguments, it ...
Thiago Pereira Maia's user avatar

15 30 50 per page
1
2 3 4 5
22