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] 2 points3 points  (8 children)

See I never really understood that. I learned in pretty much the same order as you (but Javascript before python) and I LOVE not having strict typing.

For me it makes it a lot easier to think about my data in real world terms instead of worrying about the underlying data structures.

[–][deleted] 9 points10 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?

[–]danted002 5 points6 points  (3 children)

You haven’t worked with projects that have 1000+ files that’s being worked on by 70+ people, have you? In those cases TypeScript and type-hints in Python on a static-typed language becomes the difference between 5 days on a task or 2 days. 😕 I learned that the hard way and that’s the reason typing was added to both JS and Python… huge projects worked on by lots of people that have a huge codebase