On 04/08/2012 09:48 PM, Bill Ricker wrote:
* Tuesday, April 10,  E51-372 - Revisting the Dread CGI -- The Uri

  CGI refactored before and after

As many of you have known and seen, Uri Guttman will do code review on the
fly with anyone's code on display at pm meetings. This may seem frivolous
or whatever but it is can be useful in many cases. He has a client for his
Perl support/training services which entails lots of code and design review
and it has proven very valuable to this shop. He has obtained permission to
show one CGI script in its before any review state and after much review
and refactoring. The author of the script did almost all of the editing and
rewriting but for one sub rewrite that Uri did because it was more complex
than the author could handle. The script went through 14 revisions and it
still isn't where it should be (that means using a proper template module
like Template::Simple) but it is light years from where it was. This talk
is being called before/after. You will see some of the worst coding and
template practices ever unleashed at a boston.pm gathering. You will be in
shock at the use of globals, the lack of subs, and the redundant everything
everywhere. Then the tranquility of the after version will calm your
senses, sooth your jangled nerves and show you there really can be order in
this chaotic universe. Be prepared for coding hell and heaven! Fun is
guaranteed for all!
our esteemed fearless leader didn't listen to my title. it is just before/after. this has absolutely nothing to do with cgi even if the code runs under cgi. i won't be discussing any cgi issues or how the code is called. the refactoring is more about templating from hell, making lots of smaller subs, etc. these scripts could be standalone reports other than the fact that they take cgi params and generate html. regardless of the title, you do want to see this. the difference between the before code and the after is shocking, even to me. i did a before/after class for this client's team on this very script and they were knocked out (the poison gas grenade helped me there. :).

see you all there,

uri


_______________________________________________
Boston-pm mailing list
[email protected]
http://mail.pm.org/mailman/listinfo/boston-pm

Reply via email to