MyBB Community Forums

Full Version: Suggestions for shorter code
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Here's a patch that makes the code a bit shorter.

Roland
[Wiki: Coding_Standards] (Broken link, head over to docs.mybb.com instead)

Although this makes the files a bit smaller it's more readable like we have it now. We don't really need to make the php files and smaller as it's server side accessed, not sent to the user.
CraKteR Wrote:[Wiki: Coding_Standards] (Broken link, head over to docs.mybb.com instead)

Although this makes the files a bit smaller it's more readable like we have it now. We don't really need to make the php files and smaller as it's server side accessed, not sent to the user.

Thanks for pointing me to the Coding_Standards page. I had not read it before. For all but one of the proposed changes, I can understand the argument of readability. The remaining one is the function validate_email_format, for which I don't think the readability gets worse.

Roland
Which has been changed for MyBB 1.4 Smile
I think there are at least a thousand placed where you can use the ternary operator, but we've chosen not to use it (except for a few locations) to be consistent with all the other if/elses.

I'm not saying it's bad though. Personally I use it in my own coding Smile