On Monday, October 19, 2015 at 3:05:11 PM UTC-4, Phil Tomson wrote: > > Otherwise, if we keep telling people that they need to convert their code > to use for-loops, I think Julia isn't going to seem very compelling for > people looking for alternatives to Matlab, R, etc. >
You only need loops if you are optimizing critical code, and that is usually only a small percentage of most people's code. It's not like vectorized code is terrible (much worse than Matlab or R), just that it is often not as fast as C; this is also true in Matlab or R — a whole sequence of vectorized operations like x + 2*y.^2 + z.^3 .* (x - 5) is not nearly as fast as fusing all the operations into a single C (or Julia) loop. The exception, of course, is when Matlab vectorized operations are multi-threaded (as in the original post in this thread) then they can of course be faster than a non-parallel Julia (or C) vectorized operation or explicit loop.
