Quote:
Originally Posted by ownedbycats
Is there any functional difference between $$#timesread>#0 or $$#timesread>=#1?
Code:
program:
status = readstatus();
times = $$#timesread;
switch_if(
status=='currentlyreading' && times>#0, 'Currently Rereading',
status=='currentlyreading', 'Currently Reading',
status=='toberead' && times>#0, 'To Be Reread',
status=='toberead', 'To Be Read',
status=='read', 'Read',
status=='unread', 'Unread',
status=='didnotfinish', 'Did Not Finish',
''
)
|
No difference in meaning or performance. There are usually multiple ways to express a relational conditional. Often one of them makes more sense to a reader. In your case, to me ">#0" better expresses the logic.
You could even do