3 ms·
What about code that naturally represents tables, like this? rotationMatrix = [[ cos(x), -sin(x), 0], [ sin(x), cos(x), 0],
by Too 9y ago
What about code that naturally represents tables, like this?
rotationMatrix = [[ cos(x), -sin(x), 0],
[ sin(x), cos(x), 0],
[ 0, 0, 1]]
- Stratoscope 9y agoYup, that's a great example of where a monospaced font helps. I don't claim that proportional fonts are ideal for every kind of code, only that it's an educational experience to try them out, even if just for a while. Your example is interesting because it combines two different kinds of alignment. One of them I find unhelpful - pushing everything to the right to match the length of the variable name. The other is the useful alignment within the matrix. So personally I would make this minor change: rotationMatrix = [ [ cos(x), -sin(x), 0 ], [ sin(x), cos(x), 0 ], [ 0, 0, 1 ] ] Now you have the nice matrix layout without having to realign the code if you ever rename rotationMatrix.
- qrbLPHiKpiux 9y agoThis is such a nice display of art and it is what I mostly judge a coders ability by.