Linked Questions

4
votes
2answers
188 views

Return type declaration and checks

I've been mainly programming PHP, and I recently started with C++. In PHP the return of a function can be of any type, so you can do checks like this: public function doSomething() { if (! this-&...
2
votes
4answers
475 views

If a function contains only a switch, is it bad practise to replace the break; statements with return; statements?

Lets say I have a function that takes an argument, does some action based on the value of that argument and returns false if there is no action for that value. (pseudo-code): bool executeSomeAction(...
1
vote
1answer
169 views

Which statements can be considered as exit points?

There are many discussions related to whether it is better to have only one or multiple exit points per function, but it is not clear to me which statements can be considered as exit points: only ...

15 30 50 per page
1
2