Functions vs Classes: When to Use Which and Why?