Functions – Side Effects

What is a side effect? According to Wikipedia, a function has a side effect when “it has on observable interaction with calling functions or the outside world”. Uncle Bob says that side effects are lies. A side effect happens when a function is supposed to do something, but it also does other things you don’t…

Continue reading

Functions – Arguments

A very important thing you should have in mind when writing functions, is how many arguments each functions should have. Just like shorter functions are easier to understand, functions with few arguments are easier to understand and use. How many arguments should a function have? The short answer for this question is that a function…

Continue reading