I’m still getting used to Julia’s broadcasting syntax, especially the use of . with functions and operators.
For simple cases, something like:
y = sin.(x) .+ 1
is very convenient.
But once the expression gets a little more complicated, I sometimes find an explicit loop easier to read.
So I’m wondering: in normal Julia code, when do you personally prefer broadcasting, and when would you switch to a loop?
Is this mostly a readability choice, or are there performance differences I should keep in mind as well?
I’m mainly trying to build good habits early rather than automatically adding dots everywhere.