Re: Re: My thoughts on Xaraya

"Michel V." <michelv-YEE2qmtQORKfD/[email protected]>
Newsgroups gmane.comp.cms.xaraya.user
Organization Xarayhosting.nl
Message-ID <eevvs9$2ra$1__5405.64366751841$1158906624$gmane$org@newton.xaraya.com>
Hey Michael Quinn,

Thanks for the examples, now we can talk about something "real".

Maybe we should put this topic then in xaraya.devel, the developer list.

> 1. /themes/xarclass/xarcss.class.php
> 
> class MyXmlClass

Can I change the "should" to "is preferred to be". I know more subjects 
where you can have long discussions about that don't really change the 
functioning or speed of the code.

> 
> 2. /modules/articles/xaruser/display.php

> At least a comment should exist.

Yes, very much agree. Only thing I know is that in some areas a lot of 
comments exist, and in other are lacking. Most users don't care about 
the comments, as they see actual result on the screen as what Xaraya 
creates, but comment less code in general is a terrible thing for those 
that go dig in.
I know we are putting quite some effort at least in creating decent 
PHPDoc headers, thus auto creating the online documentation you have 
probably seen.


> 3. /modules/articles/xaruser/display.php
> 
> Usage of else conditinal would have sufficed here and reduced code.

No discussion here, except that probably at that time the writer of this 
module (not essentially the same as Xaraya, the core) thought is was 
easier to use a ! instead. You are taking examples from our oldest 
module. Maybe it has already been around for 6 years or more, and I can 
mention a lot of other places in the code it could use a change/clean-up.

Code wise... I think there are more important things, but in general, I 
agree.

> 
> 4. /modules/articles/xaruser/display.php
> $ptid and $pubetypeid defined as the same thing
> 
> I need not say anything on this one.

No need ;)

> 
> 5. /modules/articles/xaruser/display.php
> Mixed case convention e.g. $pagerinfo, $themeName.

In general, the agreement is to not use mixed cases, reducing the 
possible strtolower coding in core. In this case.. well, see 1.


> 6. /modules/articles/xaruser/display.php
> To many blocks of and nested if statements.  90% of the time heavy functions
> like this could be broken up into simpler more manageable chunks of code.

See 3.

> 
> 7. Many of the .php files in the system

Yes. See the example module for commenting conventions. Getting all the 
files up to that standard is, let's say, a challenge.

> 
> I don't claim to be an amazing programmer, as they are few and far between,
> but I do approach problems from a pragmatic perspective and solve them step
> by step with my fellow programmer in mind when doing so.  PHP is a good

Me to, and I think most of us. No excuses, but in some cases the need 
for code speed is higher than the need for clean well documented and 
readable code. A lot here make a living out of Xaraya code, and need to 
decide everytime on spending time in writing docs, comments, cleaning, 
or just finishing the code and move to the next deadline. The code gets 
shared, for others to profit.
As in all other projects, like said, some extra hands are welcome. I've 
personnally already spent many late hours on commenting other people's 
code and would rather not, but well... this is maybe when you get when 
it is all free software.

Taking you do like the code in general, please dig in more and comment. 
Bugs.xaraya.com is a good place for patches, IRC is a great place for 
discussion.

Now... back to another deadline ;)

Michel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.