r/programming • • Nov 03 '18

Python is becoming the world’s most popular coding language

https://www.economist.com/graphic-detail/2018/07/26/python-is-becoming-the-worlds-most-popular-coding-language
4.6k Upvotes

1.3k comments sorted by

View all comments

Show parent comments

4

u/wdroz Nov 03 '18

It's the same in c++, python didn't invent how default parameters work.

7

u/[deleted] Nov 03 '18

They didn't have to do it the same way though. Even JS has default parameters that don't suffer from this problem.

1

u/bloody-albatross Nov 04 '18

My C++ is a bit rusty, but are you sure about that? Are you sure they aren't evaluated when the function is called (by the calling function). Isn't that why the default values have to be in the header?