in reply to Re: Perlshop-z Perl Shopping Cart
in thread Perlshop-z Perl Shopping Cart

While I agree with you on the issue of who should be using it (semi-skilled administrators would be better, unless mom or pop gets into Perl), I don't think the code should be thrown out. I'm with Joel Spokain (sp?) about code refactorisation. From my own quick skim through the code, there's nothing there that is wrong, just a few things that could be done more neatly.

Also, flexibility is desirable in code design, but it's not everything. There's nothing wrong with making a program that does one thing well, but is difficult to adapt. As long as it fills your purpose, it's OK. And since it's open source it should be easy to port the database to abother product, should the time ever come.

The really important point is that someone actually did the work, and released the code. After that, anyone who feels that the code lacks something can walk in and improve it. In fact, by open source community tradition, you just volunteered to implement the changes you suggested :)

Getting back to the point, I have in the past, had to go back through and refactor my own code to remove HTML. It's a big task, and boring, but I'm glad I did it that way, rather than throw out the code.

____________________
Jeremy
I didn't believe in evil until I dated it.

Replies are listed 'Best First'.
Re: Re: Re: Perlshop-z Perl Shopping Cart
by gav^ (Curate) on Apr 15, 2002 at 02:17 UTC
    With something like this, my thoughts are that starting from scratch with a set of requirements and building towards them would be a better use of time than refactoring.

    That would also allow you to break things up into a set of achievable subgoals rather than having to work on a complex 3000 line (and in my opinion badly written) script.

    Of course I'm not going to do either :) but if you wanted to learn perl well, I'd steer towards the former.

    gav^

      Thanks for all the comments. I used the Perlshop code as a vehicle to get me started. I really spent more time on my administrator ideas. I learned how to run the ptkdb debugger effectively tracing out the perlshop code. I learned what the problems are in setting up such a store from this script, which I never would have known if I started from scratch. When Perl6 gets released, I plan on rewriting the store to learn Perl6. The only part of the perlshop code which was difficult for me to grasp was the built-in html templating system. Thanks to all.

      Well thanks to everyone for the comments. I used the perlshop code as a vehicle to setup something so I could attempt an administrator. I never would have figured out a store from scratch. I needed one that worked like I expected a store to work. I learned how to effectively use the ptkdb debugger with this, which is probably it's biggest benefit for me. When Perl6 comes out, I will probably try to rewrite my own store, using the perlshop store as a general layout.