BLU Discuss list archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Discuss] php dev's code with warnings and notices
- Subject: [Discuss] php dev's code with warnings and notices
- From: tmetro+blu at gmail.com (Tom Metro)
- Date: Sun, 27 Jul 2014 22:41:42 -0400
- In-reply-to: <53D423F3.6060301@gmail.com>
- References: <53D423F3.6060301@gmail.com>
Eric Chadbourne wrote: > The code they have...has a bunch of warnings and notices in the logs. > I personally think this is sloppy coding. My question is, how strong > a stand should I take on this issue? Part of this is going to depend on how practical it is to achieve "no warnings" in PHP code. I don't know the answer to that. But if you are accustom to achieving no warnings in your own PHP code, then yes, I'd agree this is indicative of sloppy code. Compiler/interpreter warnings can be a great tool for spotting problems. One of the first things I do in web browsers used for development is enable strict mode in the JS engine. I do likewise with MySQL. 'use warnings' (or the equivalent achieved through other means) is stock boilerplate for all Perl code I develop. I'd never deliver Perl code that triggers warnings. But Perl also gives you tools where you have fine gained control to override warnings in situations where the best solution to a problem is to bend the rules a bit. With JavaScript, that's a different matter, as not all browsers agree on what constitutes a situation warranting a warning. And there are some warnings, like "function doesn't always return a value" that can seem superfluous. As the senior developer, I'd definitely recommend setting the example by delivering code free of warnings, and cleaning up the code you happen to be touching for other purposes to eliminate warnings, but what you are facing is a cultural problem, rather than a technical one, and that can take time to change. If you're the only one submitting clean code, and your coworkers aren't on board with the value in doing likewise, you may find it to be a futile effort. -Tom -- Tom Metro The Perl Shop, Newton, MA, USA "Predictable On-demand Perl Consulting." http://www.theperlshop.com/
- Follow-Ups:
- [Discuss] php dev's code with warnings and notices
- From: jabr at blu.org (John Abreau)
- [Discuss] php dev's code with warnings and notices
- References:
- [Discuss] php dev's code with warnings and notices
- From: eric.chadbourne at gmail.com (Eric Chadbourne)
- [Discuss] php dev's code with warnings and notices
- Prev by Date: [Discuss] php dev's code with warnings and notices
- Next by Date: [Discuss] Seeking information on binaries called "entities" and "fixup"
- Previous by thread: [Discuss] php dev's code with warnings and notices
- Next by thread: [Discuss] php dev's code with warnings and notices
- Index(es):