Closed bcordis closed 11 years ago
Which line are you referring to?
No file in mind. Just would like to add to are coding standards.
If we find one without comment we should see why we are doing it.
Do you mean using @ before a function call?
like whether we should have
$result = @doSmething($param)
or
$result = doSomething($param)
Yes that is what I'm talking about.
Ahh, ok
According to the php docs, the "@" before functions just suppresses the errors if there are any. I'm not sure whether that it is a good or bad thing to have it. I'm guessing if we do a lot of error checking and we have an error mechanism it would be nice to keep that at the component level, but since we don't have it, maybe its a good idea to have php throw errors...
Yes.
Only time some errors we just ignore do to the file or function dos not have a great way to ignore if the file of system is not needed.
On Sat, Mar 23, 2013 at 2:54 PM, Eugen Istoc notifications@github.comwrote:
Ahh, ok
According to the php docs, the "@" before functions just suppresses the errors if there are any. I'm not sure whether that it is a good or bad thing to have it. I'm guessing if we do a lot of error checking and we have an error mechanism it would be nice to keep that at the component level, but since we don't have it, maybe its a good idea to have php throw errors...
— Reply to this email directly or view it on GitHubhttps://github.com/Joomla-Bible-Study/Joomla-Bible-Study/issues/114#issuecomment-15343603 .
Thanks, Brent Cordis 2406 Hermitage Park Dr. Hermitage, TN 37076 615.429.6426
I don't know exactly how joomla does it, but I think we can just ignore the @
in front of functions because either way, error reporting is handled by the error_reporting()
function or is set directly in the php.ini file.
if we hard-code error suppression in the code, it may be more difficult to debug, because we may want to see errors when we're developing.
I know of at least one place where I had to an @ before a function because of an error that is really a bug in Joomla. But I added comments near the code as to why.
I think we all agree that the @ should only be used if necessary to suppress errors that are cause by other systems other than the component.
If the @ is used, a comment should state why its necessary.
Need to make a coding standard for using @ in code. Make a comment of why you are having to use it in that line.