Hacker News new | ask | show | jobs
by sdx23 3477 days ago
In what world is:

  def square(n):
    return n * n
... easier for a beginner to understand than:

  square n = n * n
1 comments

Is square a function or object/data structure result of operation?

Welcome to the Real World. Please make different entities look different.

Usually when one starts to learn to program already have learned some math. So knows only this notation for funcions: square(x) = x*x

"Return" seems meaningless.

So that is the "real world" function declaration (if this phrase makes any sense for a math notation convention) for a nonprogrammer.

Is that what you mean? Because then I agree...