How to name factory like methods?

后端 未结 11 2090
别跟我提以往
别跟我提以往 2021-01-29 19:41

I guess that most factory-like methods start with create. But why are they called \"create\"? Why not \"make\", \"produce\", \"build\", \"generate\" or something el

11条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-29 20:35

    I'd point out that I've seen all of the verbs but produce in use in some library or other, so I wouldn't call create being an universal convention.

    Now, create does sound better to me, evokes the precise meaning of the action.

    So yes, it is a matter of (literary) taste.

提交回复
热议问题