help-smalltalk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Wheter to return `super init' or allow the implicit self to be retur


From: Samuel Colque Flores
Subject: Re: Wheter to return `super init' or allow the implicit self to be returned instead
Date: Sun, 26 Jun 2022 16:41:06 -0400

Welcome Luis

Maybe, you were reading the GNU Smalltalk User's Guide. If so, at section
6.4.4 (Defining an intance method) you may find the following text:
  ``For clarity of programming, you might consider explicitly returning
self in cases where you intend the return value to be used.''

In my opinion, the statements:
  ^self
  ^super init
are fine when one wants to stress his intention to return `self'.

To answer your question: There are no preferences among programmers. Wheter
to return or not is up to you and your intentions.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]