4 ms·
Lack of static typing and explicit destructors are two things that keep me from using Python for anything but toy scripts that I can monitor myself. It's a sha
by 01100011 7y ago
Lack of static typing and explicit destructors are two things that keep me from using Python for anything but toy scripts that I can monitor myself. It's a shame, because the syntax and built-ins are expressive, readable, and powerful.
It's also slow, but I can deal with slow. Machine time is often cheap, while developer time is expensive.
- joshuamorton 7y agoPython has both of those, static typing is easy to use (all my new code is type checked!) and destructors can be used, they just like really, really shouldn't be. Context managers instead. Why do you even want destructors in python?
- war1025 7y agoPython does have explicit destructors, at least when using CPython. Having worked on a python codebase for the past eight years, static typing isn't really much of an issue. Just document what types you expect, and write the code to match. If it runs, it runs. Plus, you have pylint to catch most of the silliest mistakes.
- dragonwriter 7y ago> Python does have explicit destructors, at least when using CPython Python has finalizers rather than destructors, though they are sometimes referred to as destructors (the Python docs explicitly note that this is incorrect but not why, there is discussion of the difference—inbthe context of C#—here: https://blogs.msdn.microsoft.com/ericlippert/2010/01/21/whats-the-difference-between-a-destructor-and-a-finalizer/ https://blogs.msdn.microsoft.com/ericlippert/2010/01/21/what... )
- overgard 7y agoPython has destructors but I can't remember ever seeing a good use for them. I think with statements pretty much capture almost every use case for destructors
- narimiran 7y ago> Lack of static typing and explicit destructors are two things that keep me from using Python (...) the syntax and built-ins are expressive, readable, and powerful. > It's also slow It looks to me like you're describing Nim. Static typing, similar syntax to Python, expressive, readable, powerful, fast; and destructors are being worked on as we speak.