Apr-28-2017, 05:42 PM
One of the biggest arguments against Python compared to C++ - or any compiled fixed-type language - that I can make is that Python hides real data types. When you use integer, you are seldom aware how many bytes of code it occupies. You may stumble on encoding issues, but you don't care how many bytes is each character in your string. This thread is a good indication.
I actually stumbled on that issue at a job interview last summer, when I was asked to write a test for Fibonacci function that will check that the return value remains positive. And, being used to Pythonic tolerance, I did not think about possible overflow in 4 or 8-byte integer.....
I actually stumbled on that issue at a job interview last summer, when I was asked to write a test for Fibonacci function that will check that the return value remains positive. And, being used to Pythonic tolerance, I did not think about possible overflow in 4 or 8-byte integer.....
Test everything in a Python shell (iPython, Azure Notebook, etc.)
- Someone gave you an advice you liked? Test it - maybe the advice was actually bad.
- Someone gave you an advice you think is bad? Test it before arguing - maybe it was good.
- You posted a claim that something you did not test works? Be prepared to eat your hat.