May-28-2024, 09:01 PM
(This post was last modified: May-28-2024, 09:14 PM by Gribouillis.)
I currently have this syntax
Here, mediator is an instance of a Mediator class, which you can view as a smart pointer referencing a resource stored somewhere. The read() method accesses the resource and gets two things: a 'preamble' (instance of a Preamble class) and a 'content' which is a unicode string.
Problem: the method name
English is not my mother tongue, so what better word would you choose to name this method? The idea is to dereference the 'smart pointer' to get the pointed data.
1 |
preamble, content = mediator.read() |
Problem: the method name
read()
doesn't seem very good to me because one usually expects that a read()
method returns a string, but here it returns a tuple with two elements.English is not my mother tongue, so what better word would you choose to name this method? The idea is to dereference the 'smart pointer' to get the pointed data.
« We can solve any problem by introducing an extra level of indirection »