Hacker News new | ask | show | jobs
by rcfox 262 days ago
In Python, every variable is either defined or imported in the file in which it's used, so you always know where to find it. (Assuming you don't do `from foo import *`, which is frowned upon.)

In C++, a variable might be defined in a header or in a parent class somewhere else, and there's no indication of where it came from.

2 comments

How does this help when trying to determine the parameters a function takes? You have to either hope that the name is descriptive enough or that the function is well-documented. Failing that, you need to read the code to find out.
CMD-click shows you.