mIRC Homepage
Posted By: Muffinator $nick - .random property - 24/07/10 04:11 PM
$nick currently has the parameters, #,N/nick,qaohvr,qaohvr, and the properties, color, pnick, idle. I think it would be great to have a random property, like such: $nick($chan,*).random, to avoid the far longer code for choosing a random nick, $nick($chan,$rand(1,$nick($chan,0))).
Posted By: Voglea Re: $nick - .random property - 24/07/10 04:53 PM
$nick(#,$r(1,$nick(#,0)))
long too? smile
Posted By: RusselB Re: $nick - .random property - 24/07/10 06:54 PM
Counting the bytes/characters, yours is up to 8 bytes longer than the suggestion. I know, not much, but some people are that picky.
Posted By: starbucks_mafia Re: $nick - .random property - 24/07/10 09:18 PM
It seems like an arbitrary feature to add. Why not $chan().random, $ial().random, etc.? Basically the same reasoning (shorter code) could be used for any identifier you wanted to use $rand() with, and ultimately, what is the real benefit of saving a dozen or so bytes of code?
Posted By: argv0 Re: $nick - .random property - 24/07/10 09:31 PM
Clearly it's longer, but I don't think that was his point. As sbm pointed out, it's completely arbitrary to decide what identifiers deserve to be "shortened by 8 bytes". Functionality, expressiveness, readability and convenience are not calculated solely on an inverse relationship of # bytes.

Practically speaking, I can't imagine $nick(#,*).random would really be used enough to justify that. I know people write random nick popups, but they usually just write a handful-- picking a random nick is not really a core function that everyone needs to perform on a daily basis-- and for the few that actually do, it's scriptable.

From an organizational/cohesion standpoint, a ".random" property has no place in an identifier that's meant to access a nick list. That just makes things really messy. How data in a list based identifier is accessed should not be the concern of the identifier.
© mIRC Discussion Forums