Understanding functions and methods as first-class citizens