Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Why not allow for different constructor names? Why only new?

constructor different names
0
Posted

Why not allow for different constructor names? Why only new?

0

Because we really don’t need dozens of different constructor names. Using new is a best practiced followed not only by most of the Perl community but other languages as well. § See Give every constructor the same standard name in Perl Best Practices. § • Why not a fields tag instead of attrs? Believe it or not a lot of thought went into those tag names. Some are based on terms defined in The Unified Modeling Language Reference Manual, Encyclopedia of Terms (Rumbaugh, Jacobson, and Booch): § • attribute (aka field, member variable, column) “An attribute is the description of a named slot of a specified type in a class;” § • method (aka operation, member function, subroutine) “An operation is a specification of a transformation or query that an object [or class] may be called to execute. It has a name and a list of parameters.” § “A method is the implementation of an operation. It specifies the algorithm or procedure that produces the results of an operation.” § An operation is the name

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123