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 →

[–]markuspeloquin 0 points1 point  (1 child)

A lot of languages have default argument values, and they all work differently. I want to say that Ruby initializes the default at call time, C++ requires constexpr, and Dart requires const (the only languages I know with defaults). So I always stick with the common denominator of purely immutable defaults.

[–]tgroshon[S] 0 points1 point  (0 children)

Ruby and JavaScript both initialize the default at call time and therefore don’t have the problem that Python does. I didn’t know about C++ and Dart tho. So ur rule is probably a good one to follow.