3 ms·
I agree things could be better in c++, but never was never anything like python 3, redefining / , or removing printf. Also, usually once you fixed your code, it
by CJefferson 7y ago
I agree things could be better in c++, but never was never anything like python 3, redefining / , or removing printf. Also, usually once you fixed your code, it still worked in older compilers (although not always).
- gpderetta 7y agoYes also often the compiler would tell you exactly what to do (90% of the time it was a missing typename).
- hermitdev 7y agoWhile I generally agree with your comment, Python generally gives easily accessible migration paths. Regarding your division example, you could import from __future__ integer_division (maybe it was another name?) Since I think Python 2.5 before it became the default in, I think, 2.7. I wish the wallrus operator was available as a future import, bit it's not. Also, Python never had printf. It had a print statement; print became a function in Python 3. Yes, its a syntax change, but its for the better. Having print as a first class statement expands its utility and versatility.
- CJefferson 7y agoRemoving printf was an example of a change C++ could make of similar effect (they could argue you should be using cout, so you don't need it). Sorry it was unclear
- lenzm 7y agoI don't understand people complaining about the removal of the print statement. Switching that to a function call is the easiest part of porting to Python 3. You don't even have to do it yourself, just run 2to3. If you're complaining about that I feel like you're just looking for something to complain about.
- CJefferson 7y agoYou are right. The print statement is easy to complain about. My main issue was all the strings/unicode changes, which were hard to track down as often code would continue to work until a non-unicode input came in, when it would error. Debugging all those issues took ages.
- gpderetta 7y agoThis is a good point, because of the dynamic nature of python, the incompatibility is not always visible at compile time (parse type?), but can happen at run time and only rarely. You need very good test coverage.