12

Learning python and JavaScript. I kind of miss function overloading.

Comments
  • 1
    Welcome to devRant.
  • 2
    But you can kind of "overload" a function internally, through if's on the variable type,inside the function. Function arguments and return values have no static type in python by default. Or am I wrong?
  • 1
    Not sure about Python but you can sort of overload functions in JavaScript to a degree with default arguments.

    Heck you *could* actually overload them any way you want. Function arguments are just typeless variables after all. You could check the types of the arguments and reroute it accordingly.

    …not that I recommend doing that, just saying you could. :)
  • 0
    I really miss static type checking. Seriously how can you even use functions without it. How do you know what parameters it needs and what it returns?
  • 0
    @Double-A You trust in the force. 😄
  • 0
    @Double-A you just kinda roll with it.
Add Comment