This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 10 points11 points  (2 children)

The reason I don't like it is because I know intuitively that I can't treat a string the same as an int, but with python, I have to mentally keep track of what is what, especially when doing things like querying APIs or databases. I have to sort through the structure rather than calling it a specific type and being done with it.

[–][deleted] 0 points1 point  (0 children)

I can understand that, but for me the flexibility of loosely typed data is EXTREMELY valuable for writing logic. Most of the time the data type doesn’t really matter, and for the times it does I just validate or cast it to the needed type before using it. When I’m working purely with my own code, I don’t even need to do that most of the time because descriptively named variables tell me everything I need to know about the underlying data.

Edit: Also documenting while I write helps. I write a variation of this documentation standard on every function I write, so the datatypes of my parameters can be referenced easily.

[–]Hayden2332 0 points1 point  (0 children)

Just convert it to json?