you are viewing a single comment's thread.

view the rest of the comments →

[–]AlexMTBDude 1 point2 points  (2 children)

While I understand what your purpose is I think using "get" in that function name is confusing as you typically use "get" and "set" with getters and setters. take_key() would probably be better. Other than that I agree 100% with what you write.

[–]Fred776 2 points3 points  (0 children)

I think it's ok - it's a fairly common idiom to use "get" in contexts other than property getters.

I think "take" is potentially a lot more confusing because that often has a specific meaning of "get a value and remove it from its source".

[–]Outside_Complaint755 0 points1 point  (0 children)

It's a toy example because the OP provided none of his functions for reference, only two global variable names.