Re: Re: My thoughts on Xaraya

Dave Taylor <[email protected]>
Newsgroups gmane.comp.cms.xaraya.user
Organization Phatcom.net, LLC
Message-ID <[email protected]>
Michael Quinn wrote:
>  and thus illustrate better what I was talking about in my initial post.
>
> 1. /themes/xarclass/xarcss.class.php
> Class names should begin with first letter uppercase and subsequent words
> should follow suit.  note: abbreviations such as HTML or XML should be named
> as follows Html, Xml.  Example class name below.
>
> class MyXmlClass
>
> 2. /modules/articles/xaruser/display.php
>   39      // Defaults
>   40      if (!isset($page)) {
>   41          $page = 1;
>   42      }
>
> What is 1?  This does not make sense to a developer, numeric hard coding is
> bad.  A constant could be defined which could accurately describe what 1 is.
> At least a comment should exist.
>
>   
I may not be the sharpest knife in the drawer, but it seems to me that 
block of code checks if we are on any page other than the 1st page.  
Without looking at the code for display.php to check if it is used, 
Xaraya has a method of validating GET/POST variables and it could set it 
to a default if it wasn't set.  Perhaps a bug can be opened to simplify 
the code?

> 3. /modules/articles/xaruser/display.php
> if ($preview)
> This is fine, however, directly below another conditional is opened except
> now it is if(!$preview)
>
> Usage of else conditinal would have sufficed here and reduced code.
>
>   
Good point.

> What I have listed above is just the tip of the iceberg in relation to some
> of the things I have taken issue with regarding Xaraya, it's architecture
> and development.  Hope this helps.
>
>   
Michael,

I am not a programmer, per se.  I learned how to fulfill a need using 
the tools at hand, namely C, ASP, PHP, SQL, etc to make a useful module. 
I am sure there are those who think my code is utter crap, and looking 
back at the junk I've created I would have to agree.  However, the 
wondrous beauty of free software, as opposed to a commercial offering, 
is that you can contribute and make that ugly code much more 
presentable.  I am sure the Xaraya QA team would love to have your help 
to make Xaraya of thing of beauty.  I know I would like someone to clean 
up my code for me ;)  I hope you don't take that statement as indolence 
or laziness.  I like to learn by example.  I am learning the guitar on 
my own at the moment (and trying to avoid bad habits mind you) and enjoy 
watching other people play so I can imitate them later.  Often times I 
learn something new or simply learn how to play like my example.

Alas,  I have had no formal programming training and I am sure I have 
broken a few programming rules along the way.   Often times, once I have 
'finished' a module I have little time to revisit it to clean it up a 
little as it fulfilled my need at the time.  Instead of letting it die 
on my harddrive, I offer it to the world, with no guarantee of usability 
mind you.  Xaraya is designed to be modular, so my crap code won't bring 
the whole system down, thankfully (hopefully), and you can pretty it up 
if you so desire.

Since Xaraya is a team effort perhaps you can help bring Xaraya up to 
snuff?  Even if you fixed up _just_ display.php and submitted it in a 
bug report that would be great!  A better suggestion would be to make an 
example of the example module, because I refer to that module very often 
for programming tips (and not to mention that is what the module is 
for).  If you don't have the time nor inclination, I will certainly 
understand and I am sure others will too.   Any help that makes Xaraya 
better is appreciated by all.

Thanks for your time!

Regards,

Dave T
Phatcom.net
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.