Been doing a lot of coding in python lately. While some of the hackability of the language is nice for doing some cool things, overall, I cant say im a fan. Its a little too obscured for writing algorithms where effiency is important. Its hard to tell what data types are truly backing various variables and thus makes it tricky to pick the right implementation. I think im working with raw arrays and they turn out to be linked lists or worse. Even then things like a "Dict" isnt always clear if its a Tree implementation or a hashmap implementation or something else entirely.

Granted this isnt an impossible task, I have managed to figure it out by pulling open the source code of the libraries I call and using profiling tools. But python seems to not care or obscures a lot of that.

@freemo
I really like this post and the discussion it started. When coding in python I'm especially annoyed by the lack of typing information, but less from a efficiency perspective and more from a readability standpoint. Knowing the type of a function usually gives you enough information to guess what it does or understand the documentation better. And the fact that you have to run code to find type errors in python is just a bonus...

Follow

@timorl I would imagine you dont like any dynamically typed languages then or at the very least weakly typed languages... I can stand dynamic typing but only if its strongly typed... weak and dynamically typed I have the same complaint you do, its hard to know what and if a variable can do what you want. I mean sure yo ucan test for the methods and arguments, and in python you can even check what type an instance is technically, but its very convoluted.

Generally the advice in python is to just assume the type passed in is the type expected and let the exceptions do the rest. But while that works to a point it makes debugging a PITA.

ยท ยท 0 ยท 0 ยท 1
Sign in to participate in the conversation
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.