On Jan 24, 2008, at 4:14 AM, Frank Barknecht wrote:
Hallo, IOhannes m zmoelnig hat gesagt: // IOhannes m zmoelnig wrote:
Hans-Christoph Steiner wrote:
On Jan 23, 2008, at 4:50 PM, Frank Barknecht wrote:
Hallo, Hans-Christoph Steiner hat gesagt: // Hans-Christoph Steiner wrote:
I think they were only added to Max/Pd as typing shortcuts, which is very weak argument in favor of them. I am not saying we should remove them, but I think they should be avoided as a matter of convention.
What other programming language has aliases?
It's not that uncommon if you think of operator overloading in C+
- and
many other languages, or things like "from math import radians as rad" in Python.
no language with a native support for fixed aliases comes to my mind (apart from max/msp) - but i am sure there are people with more insight into different languages than me.
I actually do think, that alias names bare some resemblance to operator overloading, but of course Pd doesn't support operator overloading like the other languages, so aliases are the workaround we use. But the use is similar: Operator overloading includes adding an additional name and syntax for a function/method:
A = Matrix.new(m,n) B = Matrix.new(n,m) C = Matrix.multipy(A,B)
now with an overloaded operator* you can also say: C = A*B.
In my eyes that's very similar to the mtx_mul and mtx_* aliases in iemmatrix. True operator overloading of course would mean, that you could user the regular "+" object for matrices in Pd as well.
Shortcuts can be a very strong argument, and especially in a graphical language, [t a a a a a a] often is better than [trigger anything anything anything anything anything anything]
I find that it is rarely better to use [t a a a a] and I rarely use any aliases.
the latter is true. otoh, i never use [trigger anything anything anything anything] and often use aliases.
To each his own, especially with style questions, but I don't know anybody else besides Hans who prefers the long version of triggers.
That's what I teach in workshops now, I think it makes for much more readable code for said reasons, so watch out, we are multiplying! :D
.hc
------------------------------------------------------------------------ ----
Computer science is no more related to the computer than astronomy is related to the telescope. -Edsger Dykstra