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...

@timorl @freemo FWIW, there is the option of advisory typing in pything. They use uh, annotations I think? Something that Guido said would always be a completely useless no-op, so it isn’t a syntax error to stuff typing into it. https://docs.python.org/3/library/typing.html

There are also some programs that’ll analyze those annotations, and actually try to warn you if the typing is messed up. I never used ‘em though, so dunno.

Follow

@cy

Yes I use the optional typing in python... but it really doesnt solve the problem unless everyone uses it everywhere. Since its optional it tends to not really work out.

@timorl

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.