Re:Yes, Python is Slow, and I Don’t Care
by notacoward on Friday September 08, 2017 @11:38AM
(#15201037)
I'd take the point about literals a half-step further. It's really nice to be able to throw a string at a function and have that function compare it to a literal value using == instead of strcmp - and oh yeah, someone was just about to reply saying I should always use strncmp for extra productivity loss. Or I can throw a list/dict of any random type around without lots of ceremony. Do I lose type checking? Sure. Then again, those "expected int, got unsigned int" warnings aren't very helpful sometimes. "Must compile without warnings" is a good idea for long-term maintainability of long-term code, but when you're writing a simple script or still experimenting with an algorithm that crap just gets in the way. A minute or two defining and aligning types might not seem to much, but when you have to do it ten times in the course of what was only a one-hour task to begin with it's a pretty significant hit.
[ Parent
| on HN ]
Re:Yes, Python is Slow, and I Don’t Care
by scarface74 on Friday September 08, 2017 @09:59PM
(#15205186)
It's really nice to be able to throw a string at a function and have that function compare it to a literal value using == instead of strcmp - and oh yeah, someone was just about to reply saying I should always use strncmp for extra productivity loss.
Who uses straight C? C++ and C# have operator overloading. You can overload any of the operators for a class and get sane semantics for addition, subtraction, equality, etc.
Re:Yes, Python is Slow, and I Don’t Care
by notacoward on Saturday September 09, 2017 @07:49PM
(#15209716)
A lot of the largest and most critical codebases, probably including most of the software you cause to execute every day, is still in C. Also, operator overloading doesn't solve the general problem and creates a few of its own, but thanks for the condescension anyway.