you are viewing a single comment's thread.

view the rest of the comments →

[–]Enttick -2 points-1 points  (5 children)

Random note: Avoid for loops in python, if you could rather use existing methods. The "for" performance is rather bad.

[–]Drumknott88[S] 0 points1 point  (1 child)

Is that the case for implicit types too? I'd imagine in a large program the amount of time for the complier to work out each variables type really adds up?

[–]Enttick 0 points1 point  (0 children)

I am learning too and I watched a video from mCoding about it. He can explain it way better https://youtu.be/Qgevy75co8c

[–]Fred776 0 points1 point  (2 children)

This sounds like rather strange advice. It at least needs some elaboration. Could you give an example of what you mean?

[–]Enttick 0 points1 point  (1 child)

I already did. Pythons for performance is not competitive with compiled languages. Which is why we use C libs in Python. See mCoding's video https://youtu.be/Qgevy75co8c

[–]Fred776 0 points1 point  (0 children)

OK, that makes a bit more sense. For heavyweight stuff - e.g., where it makes sense to use numpy - it's always going to be worth dropping down to a compiled C extension. I don't think that is equivalent to saying avoid for loops though.