mIRC Home    About    Download    Register    News    Help

Print Thread
#223441 24/07/10 04:11 PM
Joined: Jun 2010
Posts: 7
M
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
M
Joined: Jun 2010
Posts: 7
$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))).

Joined: Nov 2009
Posts: 81
V
Babel fish
Offline
Babel fish
V
Joined: Nov 2009
Posts: 81
$nick(#,$r(1,$nick(#,0)))
long too? smile

Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Counting the bytes/characters, yours is up to 8 bytes longer than the suggestion. I know, not much, but some people are that picky.

Joined: Dec 2002
Posts: 2,962
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
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?


Spelling mistakes, grammatical errors, and stupid comments are intentional.
Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
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.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"

Link Copied to Clipboard