Hello,
This is a wide topic and I am going to illustrate it with one example from ExUnit.
Sometimes when a test fails, especially when `%Plug.Conn{}` is one of the arguments, in the stacktrace the reported function call is shown. The issue is that when there is a big map/struct as an argument and a few other arguments, it is very hard to see where one function argument ends and another starts.
One approach to improve the experience in this case is to paint the arguments in different colors.
Here is an artificial example that shows the problem.
Take a look at the %SomeModule.three_arg_function/3 function that takes 3 arguments - %Plug.Conn{}, map and %Plug.Conn{}.
Without any visual distinction in the terminal you would see something like this:
https://ibb.co/NnqMc1TBut if we throw some colors in, the arguments are clearly distinguished:
https://ibb.co/NnXYfcnThis ability to better visually distinguish the arguments can be applied in a wide variety of situations and not only in the ExUnit stacktrace. The problem can be solved in different ways that can be applied either separately or combined. One such another "trick" I use to better understand what happens is to copy the function header in a file and replace `\n` with actual new lines.