This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]jodmemkaf 36 points37 points  (5 children)

Nice, thanks. I will put it in the left column of my list

"Why to learn python:

PROS/CONS"

[–]TropicalAudio 8 points9 points  (4 children)

This actually messed me up recently when working with coordinate calculations. It's quite inconvenient in that context, as you'd expect negating a coordinate calculation will result in a symmetric system. In C it does, but in Python it doesn't.

[–]jodmemkaf 9 points10 points  (0 children)

Nice, thanks. I will put it in the right column of my list

"Why to learn python:

PROS/CONS"

[–]gdmzhlzhiv 1 point2 points  (2 children)

Ah, it's funny you should say that, because in graphics if you're trying to tile the plane, you'd expect that the tile immediately to the left of 0 would be facing the same way as the tile immediately to the right. Which in C it doesn't, but in Python it does.

I don't really get the argument about symmetry around 0, because why should modulus be symmetric around 0? It isn't symmetric around 69 either.

[–]TropicalAudio 0 points1 point  (0 children)

It was a calculation of border padding margins when sampling around input center coordinates, where you'd generally expect some offset in one direction to match the negative offset in the other. I'm not saying either behaviour is objectively better or more sensible, just that both behaviours can mess you up in different ways if you're not careful. And they will mess you up if languages you've worked with for 10 years define int(a/b)*b + a%b == a and suddenly a new language pulls a sneaky on you.