News for hackers. Stuff that matters.
Re:Why Python Is Not My Favorite Language (2016) by LyndsySimon on Tuesday June 20, 2017 @10:25AM (#14594852)
I think the author has good points, but from where I sit they seem fairly subjective.

I've written Python for several years, and as a result the way I reason about problems have been heavily influenced by it.

I'm fluent in Ruby as well, but it takes mental effort for me to conform to its "flow", for lack of a better term. My time in Ruby has made me a better Python programmer, too - I understand more fully the idea of a DSL and how it should work. Ruby is great for writing DSLs and writing concise code that's guided by the language of the domain in which you're working.

I'm competent in Clojure, which if nothing else has given me a distinct distaste for impure functions - if a Python function takes an array, it should not modify that array in place unless it's very clear from the name that's it's going to do so, and a function should not both modify its input and return it.

At the end of the day, Python is still the language that I reach for whenever I'm writing pretty much any personal project. It's clean, easy to read, and the overall feel of the language guides me to write maintainable code.

Re:Why Python Is Not My Favorite Language (2016) by crimsonalucard on Tuesday June 20, 2017 @10:30AM (#14594889)
Don't get how any competent programmer can recognize a glaring flaw... type checking. A program without type checking will inevitably lead to less maintainable code.
Re:Why Python Is Not My Favorite Language (2016) by scriptkiddy on Tuesday June 20, 2017 @11:56AM (#14595614)
Python does type check - at runtime. That said, I understand where you're coming from. Maybe it's because I'm very familiar with Python, but lack of static typing has not been a problem for me in a long time. If I really need to be sure that something is the correct type, i can try to catch `TypeError` and handle it. Not the most terse of methods, but I rarely find that I'm all that concerned with types in my Python work.
Re:Why Python Is Not My Favorite Language (2016) by KirinDave on Tuesday June 20, 2017 @12:36PM (#14596056)
I think you fundamentally misunderstand what type checking is.
Re:Why Python Is Not My Favorite Language (2016) by scriptkiddy on Tuesday June 20, 2017 @12:58PM (#14596264)
I don't think so. I think you're referring to static type checking. I'm referring to dynamic/runtime type checking.

For instance, `1 + "hello"` will throw a `TypeError` at runtime because the `+` operator is not supported for use with `str` and `int` types. In a statically typed language, the code would not run or compile unless a `+` operator has been defined that takes a `str` type as it's first argument and an `int` type as it's second argument.

I guess you could say that a `TypeError` at runtime isn't really "type checking" in a sense. I guess it would be more like "type enforcement".

Re:Why Python Is Not My Favorite Language (2016) by KirinDave on Tuesday June 20, 2017 @01:05PM (#14596338)
> I don't think so. I think you're referring to static type checking. I'm referring to dynamic/runtime type checking.

No, you're referring to type-related errors at runtime. That's not checking. Nothing is checked. Code breaks and may recover, but it has no idea what the types of the arguments to the offending expression were, only that it didn't work with that bit of code.

This is not type checking.

> I guess you could say that a `TypeError` at runtime isn't really "type checking" in a sense. I guess it would be more like "type enforcement".

All it does is say, "This code cannot execute with this implicit prior state." It has nothing to do with types except in the most tangential way.

Re:Why Python Is Not My Favorite Language (2016) by bendbro on Tuesday June 20, 2017 @01:49PM (#14596808)
1 + 'hello' resulting in a seg fault would be a "type related error"

1 + 'hello' resulting in an Exception would be a product of dynamic type checking.

A language would not be able to explicitly throw a type related error unless it had some information regarding the type of the data.

Most resources show little confusion on this, I think you are wrong. https://stackoverflow.com/questions/1347691/static-vs-dynami...

Re:Why Python Is Not My Favorite Language (2016) by KirinDave on Tuesday June 20, 2017 @01:59PM (#14596911)
> 1 + 'hello' resulting in an Exception would be a product of dynamic type checking.

Incorrect. It might be the product of a run time type check. It is not inherently so. You ca't even be sure you actually had a type error when you get a TypeError.

But even then, this is using "type check" in the most vacuous and equivocal way possible. It's not the concept most people are referring to.

> A language would not be able to explicitly throw a type related error unless it had some information regarding the type of the data.

You (and this resource to some extent) are confusing strong vs weak typing with static vs dynamic typing. A + method might have a type check embedded (esp python since + is magical), but it's actually quite rare of that a.foo(b) is anything other than an assertion that the object A's vtable-analogue has an entry.

This is sort of dynamic typing, in the sense that I can think of formalisms that model this (named extensible row types come to mind), but this is a profoundly useless defintion of "type."

I'm not sure why we'd tolerate redefining type checking to a worthless concept and then using that divergent definition to imply that it's unhelpful. It's 2017, functional languages are fully baked. Powerful static type systems exist even for the Javascript environment and they are taking over that ecosystem rapidly.

Re:Why Python Is Not My Favorite Language (2016) by bendbro on Tuesday June 20, 2017 @03:22PM (#14597638)
It seems python itself also confuses these topics then. https://wiki.python.org/moin/Why%20is%20Python%20a%20dynamic...
Re:Why Python Is Not My Favorite Language (2016) by blain_the_train on Tuesday June 20, 2017 @07:58PM (#14599563)
I find it amusing that the first look Google gives me on strong vs weak typing says there like static vs dynamic typing. Then wiki says there is no strong definition for either term. Maybe it would be easier to drop those terms and go one level deeper?
Re:Why Python Is Not My Favorite Language (2016) by KirinDave on Tuesday June 20, 2017 @08:03PM (#14599587)
There isn't too much confusion, but people bend over backwards to avoid having their type system called "Weak."
Re:Why Python Is Not My Favorite Language (2016) by someSven on Tuesday June 20, 2017 @12:10PM (#14595780)
Isn't this covered by IDEs, which warn you when switching the type?
Re:Why Python Is Not My Favorite Language (2016) by joshuamorton on Tuesday June 20, 2017 @11:39AM (#14595431)
Modern python supports optional type checking.
Re:Why Python Is Not My Favorite Language (2016) by kyberias on Tuesday June 20, 2017 @01:11PM (#14596398)
What is modern python?
Re:Why Python Is Not My Favorite Language (2016) by joshuamorton on Tuesday June 20, 2017 @01:19PM (#14596472)
3.4+ (really 3+ with syntactical support, and really 2.7+ with comment support).