NYCPHP Meetup

NYPHP.org

[nycphp-talk] Quality Code [was "Injection..."]

Brian D. brian at realm3.com
Tue Nov 13 11:05:24 EST 2007


I'll grant you that using prepared statements rather than mysql_query
isn't *that* much of a time difference, but unit testing, for example,
does tend to take a little more time.

As Rusty pointed out, the biggest difference is "getting up-to-speed"
with something that you're not familiar with, but when you're writing
good code, in my experience at least, it's not as fast as throwing
things together.

As an illustration, if you find yourself copying and pasting code,
it's usually a better idea to create something reusable. But if you're
just banging out some code, copying and pasting may be a little
faster. The key is that it's only faster in the *short* run. In the
long wrong, good code is always faster.

On Nov 13, 2007 10:44 AM, Gary Mort <bz-gmort at beezifies.com> wrote:
> Brian D. wrote:
> >> Programmers who write quality code do not write code slower than
> >> programmers who don't. If anything they produce more lines of code per
> >> day, and their code does more.
> >>
> >
> > You can certainly write an application, placing your SQL calls, HTML
> > layout, and everything else all in the same files, ignoring security
> > problems, and skipping documentation, much, *much* faster than you can
> > create an application that considers security issues, best practices,
> > well-documented code, etc.
> >
> >
>
> Well, except for the documentation, I'd disagree with this.
>
> Maybe a little faster, but not a lot.  If you always do XYZ to sanitize
> your data and make your SQL calls, than it really won't be any different
> than always doing something else.
>
> The biggest problem with that approach is the many cooks syndrome.  One
> guy always uses one library to sanitize data, another guy uses a second
> library, than a third dev comes along and uses a third library.
>
> The code keeps bloating because each person has their preferred
> method(and this assumes they have sane libraries that don't conflict!)
>
>
> _______________________________________________
> New York PHP Community Talk Mailing List
> http://lists.nyphp.org/mailman/listinfo/talk
>
> NYPHPCon 2006 Presentations Online
> http://www.nyphpcon.com
>
> Show Your Participation in New York PHP
> http://www.nyphp.org/show_participation.php
>



-- 
realm3 web applications [realm3.com]
freelance consulting, application development
(423) 506-0349



More information about the talk mailing list