6

I've recently switched environments from c++ to python. I've noticed that I really miss types in python. If I know a function type, param types and so on, I can debug a lot faster.

So, my question: what are the benefits of soft typing? It seems more stupid the more I use it.

Comments
  • 1
    I agree, it's stupid. Still not as bad as with JS.

    On first glance it's more convenient, until it does a division with the wrong datatype or something and everything falls apart without anyone knowing why.

    Python is fantastic for trying out things or making some quick prototypes though.
  • 1
    Typically, the tool you use depends on your preferences. If a concept or a programming paradigm does not sit well with you, what's the point of using it even if the benefits were provided? My advice is to pick your tools based on *your* preferences and not based on what others say. If you like strongly typed languages then use strongly typed languages.
  • 2
    @ymas true, but training neural nets without python and tensor flow brings a high amount of other terribleness. I choose the lesser of annoyances.
  • 0
    @megamocni sadly, in a significant number of cases, coders choose a dynamically typed language and proceed to write code that is better suited for a statically typed language. I feel not enough time is invested in understanding the different paradigms. I appreciate that Python has loads of pre-made packages, however, if you don't like the paradigm, nothing I can say will change your mind. The largest loser in this trench is JavaScript - this is among the more misunderstood languages. It is unfortunate its beauty is not appreciated more.
  • 0
    @ymas well if you know of any resources/tips that might help me write better soft typed code, please share :)
  • 0
    I can't really tell ya man. I find no problem since I always code in Python with a repl open and if I don't understand a type I just check it on my repl, it would be more convenient to see the types. But then again Python does not have soft or weak typing, it is a strongly typed language with no static typing. It does not bother me, but as previously stated by some others it is mostly because my py projects are not really that big.
  • 0
    @irene Read Eval Print Loop, like the interactive prompt found in Python, irb for Ruby, lein repl for Clojure, node for js etc etc. The js console in our web browsers can be thought of as a repl (for another example)
  • 0
    @irene like previously stated. But indeed, a Python console.
Add Comment