Kryptronic Software Support Forum

You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.

#26 12-12-2003 10:22:26

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19514
Website

Re: CCP6 Codebase (Perl Vs. PHP)

Well, this past week I raided the bookstore and Amazon and bought every well-respected book on PHP and cooking up scripts.  I've prototyped more functions and have to say PHP isn't looking as viable as I thought earlier.

The thing is that the language is childish and doesn't do much.  Support for common sense things like passing globals between modules and in and out of elements is doable, but a pain.  There's no inherent way in PHP to easilly do much of what needs to be done.

The end result: Very hard to read code that will work on at least one server and might not work on a different configuration.

Regardless of the language used to do the programming for CCP6 - the architecture and functionality will not be compromised.  I will not code in PHP if it means we can't do something.  And right now a lot of what we need to do can't be done (or at least I think it can't at this point).

Writing the program in PHP will require months of work just to get modules ready (the same Perl CPAN modules in use in tiki) to be able to do very simple stuff. 

Writing the program in PHP will cause installation and portability headaches that may not be seen until release and production use.

The fact is that the PHP language is not a programming language as defined by languages like Perl, Python, C and LISP.  It's a macro-based scripting language designed to make easy things easy and hard things impossible.  It's perfect for a simple form mailer and possibly a forum script - but e-commerce is a different story.

E-commerce is mission critical and money is at stake with every web-based request.  Losing an order costs money - losing a post on a forum sucks but won't kill you.

If the program is written in Perl, it will be written using the strict pragma and will run under mod_perl - so it will be fast - as fast as PHP.  I've also documented so optimizations that will speed things up such as calling a .pl file to read in settings rather than doing an SQL call to a CSV file.  Other optimizations include only calling CPAN modules when used rather than having them available all the time (as in the case of Mail::Sendmail and the Cryt::HCE_MD5 module).

I can make a Perl version run about 25% faster out of the box as a separate process - and mod_perl if used can make it at least 50% faster.  That matches if not beats the speed of PHP.  We can also do things to optimize CPU and memory usage like never calling CSV files at all when MySQL is in full use.

If speed is the main driving force behind PHP votes - the Perl version will be as fast if not faster.  The code footprint alone will be smaller and the code itself will be easier to read in Perl.

I'm at the point where I'd really like to try a PHP version, but it's more of an experimental thing rather than a viable solution.  I'm sad to say that I think PHP is not capable of doing what we need it to do.  I could be wrong and will continue proto-typing, but it looks bad right now.

Also, on another note: Larry Wall, the author of Perl just had his state of the onion address in November and addressed Perl5 portability to Perl6.  My fears were averted.  Perl5 will run over top of Perl6 just fine as the interpereter (Parrot) will recompile all code down to bytecode before processing.  Perl6 code will look a bit different, but Perl5 code will run on Parrot just fine.  There will also be a translator to change Perl5 code to Perl6 for all us developers (thank goodness).  The cool thing about Parrot is that you'll be able to run all languages through it as it acts like a virtual machine.  This means that you can run Java, PHP, C, whatever using the same interpereter.

One last thing:  I apologize for the flip-flopping of my opinion here.  A PHP solution sounds great and I'd really like to do it - the thing is that the more I learn the more I don't think it's possible.

Comments?


Nick Hendler

Offline

 

#27 12-12-2003 11:50:39

TerryA
Member
From: Sanford, Fl
Registered: 07-14-2003
Posts: 1322
Website

Re: CCP6 Codebase (Perl Vs. PHP)

I knew that there would be differences in PHP and Perl coding but didn't really have a feel for how PHP would handle some of the functions that are built into CCP.  I think that either language would be acceptable to most of the purchasers of Click Cart Pro.  I was initially for PHP due to speed and load issues.  Having multiple instances of CCP running on the same server at the same time definately causes CPU load problems that can eventually cause a server to give up.  Not a good situation for the site owners and definately not a good situation for the host!

If the cart can be developed in Perl and be made to run faster and use less resources through the use of multi-threading or mod-perl, I am all for it!  The ultimate goal is for a secure, dependable shopping cart that isn't bloated beyond reason by a bunch of unneeded features or faulty code.

I feel that Nick is putting a lot of research into this and, with his experience, will come up with the best solution to the PHP Vs. Perl question!

Offline

 

#28 12-12-2003 12:50:38

kingdavidK
Member
From: Modesto, Ca
Registered: 08-31-2003
Posts: 109
Website

Re: CCP6 Codebase (Perl Vs. PHP)

Nick,


I think when it comes right down to it, Terry says it all!
We will all eventually defer to your best judgement.

Not many of use (including myself) ever intended to do
a lot of coding, which is why we have unanimously
decided to use CCP in the first place.


We look forward to your final decision and do so with
anticipation because we know you care about your product
your clients and all those who may decide in the future
that this product is still the best value on the market.

Having said that, we wish to express our heartfelt wishes
for each and evey one to enjoy this very special holiday season.


Merry Christmas and Season's Greetings


Mark and Audrey Downing


Mark Downing
King David Enterprises

Mastering the art of customer satisfaction

Offline

 

#29 12-12-2003 23:51:51

thekiko
Member
Registered: 07-11-2002
Posts: 126

Re: CCP6 Codebase (Perl Vs. PHP)

TerryA,12/12/2003 11:50:39 AM wrote:

If the cart can be developed in Perl and be made to run faster and use less resources through the use of multi-threading or mod-perl, I am all for it!  The ultimate goal is for a secure, dependable shopping cart that isn't bloated beyond reason by a bunch of unneeded features or faulty code.

I feel that Nick is putting a lot of research into this and, with his experience, will come up with the best solution to the PHP Vs. Perl question!

Amen Terry!

We all believe that whether the cart is coded for either PHP or Perl, Nick would put together an extraordinary piece of software.  And I am sure we all trust that whatever choice is made, it will be the best one.

Kiko


TheKiko

Offline

 

#30 12-13-2003 20:03:52

Guest_Scoutch
Guest

Re: CCP6 Codebase (Perl Vs. PHP)

This is a recall from last summer :

Nick,

I was still wondering if in the 6.0, we would be able to print our confirmation bill automaticly once our orders will be processed ? Last time, you said that it was a very good idea. smile

 

#31 12-14-2003 03:01:31

morvak
Member
Registered: 11-02-2003
Posts: 96
Website

Re: CCP6 Codebase (Perl Vs. PHP)

my php response, to quote Monty Python - "Run away! Run away!"

Stick with perl. PHP is grade school stuff. Ecommerce and Perl are for the big dogs :-)

Offline

 

#32 12-17-2003 13:15:19

Uncletim
Member
From: Boulder, CO
Registered: 08-03-2003
Posts: 375
Website

Re: CCP6 Codebase (Perl Vs. PHP)

My comments are a little different than what I have read. I want to inject a marketing comment in an architecture discussion.

I like the idea of getting to know PHP and investing inthe future. But I really want the architecture to reflect whatever gives us the greatest freedom and all the tools we need.

I am more concerned about what I can do with the product than what language or architecture it uses. I love the idea of being able to customize to a greater degree, particularly my ideas about the exit and checkout seguence.

If PHP can't handle the gamut of what we need, then Perl looks good to me.

So whatever you can use to give me more control over the entire process (from a marketing person's perspective) as fast as possible, gets my vote. I will learn whatever I need to do this (within reason). I think these types of needs and improvements will be changing for quite some time to come. And they drive the reason we all come together in the first place.

Tim G.

Offline

 

#33 12-17-2003 15:11:40

jasonw22
Member
Registered: 11-26-2003
Posts: 8

Re: CCP6 Codebase (Perl Vs. PHP)

Thanks Nick for your latest comments.  It seems you've come to the same conclusion I came to after working with both PHP and Perl for several years.  Personally, I'm extremely excited about the potential of Perl 6.  Perl has the advantage of being both relatively easy to learn while being a "real" programming language, unlike PHP.  I'm really excited to hear that you are considering a mod_perl version of ccp, and providing the option of doing away with csv files altogether.  I'd also love to see some thought put into allowing the use of other databases such as PostgreSQL or SQLite, and Perl's DBI should make that a snap, no? 

One caveat with regard to mod_perl: Will there also be a non-mod_perl version of ccp 6?  Sadly, many webhosts do not support mod_perl apps, although the number of those that do is constantly increasing.   

Thanks for thinking so hard about this for all of us, and especially thanks for including us in your thought process.  I'm new to this community, but I'm really pleased to see that you are so accessible and not making these important decisions in an "ivory tower".  I'm confident that I'm now going to be a ccp user for a long time to come. 

Offline

 

#34 12-17-2003 15:23:36

scoutch
Banned
Registered: 07-03-2003
Posts: 3167

Re: CCP6 Codebase (Perl Vs. PHP)

Nick,

Since many gaming companies asks for Listing boards, I was wondering if you could build a Listing board, which could allow us to fill and delete from the admin section, and if you could put it as an independent board page (an independant dynamic form) . . . like this for example :

- .

If you need a board example from another location, don't worry, here it is :



So, when users clicks on each members of the board, for example, it could lead into an extra page that could be similar to : (CGIVAR)product_desclong(/CGIVAR) except for board games (which means something like : (CGIVAR)board_desclong(/CGIVAR). smile

Also, I was wondering, after filling all the checkout form, if it were possible to put a box option, from the global settings, that contains a license agreement, below the checkout page, and then the user would have to click (as an obligation  the option has been activated of course).

I have more ideas, but I think I will let other users to share theirs first. smile


______________________________________________

THIS USER HAS BEEN BANNED FROM THIS FORUM.

If this post contains any language related to
code samples, advice, etc., please read this
entire thread before making a decision to use
this post as a basis for any change to your
software installation.
______________________________________________

Offline

 

#35 12-17-2003 15:24:48

EagleWolf
Member
From: Daytona Beach, FL
Registered: 07-27-2003
Posts: 979

Re: CCP6 Codebase (Perl Vs. PHP)

Nick,

Since you are the main developer of CCP, I trust your thoughts and insight into which direction to go with CCP. If PHP will not get all us where we all want to be, then stick with perl and make it even better.

You have my full support for whichever direction you choose to go in.


Chris
<a href='mailto:webmaster@equivity.com'>webmaster@equivity.com</a>
-

Offline

 

#36 12-17-2003 15:25:27

m j
Member
From: Carthage, MO
Registered: 12-12-2003
Posts: 71
Website

Re: CCP6 Codebase (Perl Vs. PHP)

One caveat with regard to mod_perl: Will there also be a non-mod_perl version of ccp 6? Sadly, many webhosts do not support mod_perl apps, although the number of those that do is constantly increasing.

Since Nick is planning on using the "use strict" pragma it shouldn't be an issue to make it work with both. The biggest issue is that mod_perl is more picky and a much stricter environment then what CGI allows, so slopy coding isn't as easy to get away with in a mod_perl environment. Althought there are some things that might work better in mod_perl then CGI, those things can probably be adapted so that you can switch between what environment you want to run Perl under.

I would recommend Nick looking into using Apache::Registry because it offers some of the best speed while still being able to write code that would be interoperable with a CGI environment. O'Reilly has a very nicely publsihed book called "Practical mod_perl" which is a must read if you are going to be programming in a mod_perl environment.

One of the reasons why a lot of hosts don't run mod_perl is because of a problem that Apache 1.x has when mod_perl and mod_php are compiled as a DSO. It appears that Apache 2.x doesn't have these problems. Most hosts I guess prefer to run mod_php so mod_perl isn't included. For FreeBSD I found a site which makes it easy to compile mod_perl and mod_php directly into Apache 1.x so that everything works together, I think that most ISPs just don't want to mess with compiling it all together. 


Perl, MySQL, XHTML, CSS, Web Usability, XML
Matt Johnson

Offline

 

#37 12-18-2003 10:38:23

Robert
Guest

Re: CCP6 Codebase (Perl Vs. PHP)

I'm not sure I understand all of the advantages of PHP, but I think that more of the hosting services I have seen support perl than PHP.  That being said more and more are adding PHP support everyday.

I think from versatility of appearance standpoint that it is easier to have a client modify a simply html page to be used with a pearl script than to have them customize their appearance is a page that includes a lot fo active code.

 

#38 12-19-2003 11:36:19

JewelCG
Member
Registered: 12-19-2003
Posts: 6

Re: CCP6 Codebase (Perl Vs. PHP)

Greetings,

I'm new to this forum and ClickCart in general, in fact, it's being installed on my site at this very minute, so I haven't had a chance to get into it except for the demos. However, I do have some experience in perl/cgi and would have to cast my vote for staying with a perl base. I don't know much about php, but perl is stable, flexible and, if written right doesn't create as much of a server load as people think.

I currently run a chat site that is completely built on a cgi/perl base and it runs smoothly and, for the most part, quite fast. Also on my server is another chat site written with the same software that is not quite as slimmed down as the version I run and yet it still runs quickly.  The only time we ever had any problems was very early on with a virtual host that didn't have a clue what they were doing, let alone what we were doing.

I don't have much experience in either language as opposed to what the rest of you might have, but my vote, from a novice, would be to stick to perl.

As a side note, I also agree with what's been said about better instructions. Most of us, even novices, can follow step by step instructions. Gear towards those that barely know how to use ftp and you can't go wrong.

Jewel

Offline

 

#39 12-20-2003 21:19:00

Will
Member
Registered: 02-26-2003
Posts: 493
Website

Re: CCP6 Codebase (Perl Vs. PHP)

Nick, you need to nix this poll and start a new one based on your new views and insights in to php vs perl.  I for one voted for PHP, but would now want to change my vote to Perl.   


Will

Offline

 

Board footer