[Koha-devel] coding guidelines, SQL queries
Paul POULAIN
paul.poulain at free.fr
Thu Jun 1 11:35:34 CEST 2006
Pierrick LE GALL a écrit :
> Hello koha-devel,
>
> I've put online the first of the coding guidelines [1]. I've started
> with SQL queries.
>
> I want your feedback about what I've written. Concerning inserts and
> updates, I propose two new functions mass_inserts and mass_updates
> (that I have already written in PHP, easy to port in Perl).
I think you write very interesting things, very precise.
The problem being we already have 300 000 lines of code ! so, I think we
should split the rules in 2 parts :
- rules that have to be followed for new code, and fixed in old code
when someone spend time to do it. But it's not urgent
- rules that have to be followed for new code, and existing code MUST be
MODIFIED ASAP. Modifying it for Koha 3.0 is a priority.
I also think we should let some freedom to developpers.
Although I agree
Select borrowers.*,categories.category_type from borrowers left join
categories on borrowers.categorycode=categories.categorycode where
cardnumber=?
on the same line is poor,
I think too precise rules won't be followed by anyone strictly.
so we should have "mandatory rules" and "suggested rules".
for example : I would follow "UPCASE for reserved words" but "probably
not 2 spaces ..."[*])
[*] not because i'm against this rule. but because I would probably
forget it most of the time !
--
Paul POULAIN et Henri Damien LAURENT
Consultants indépendants
en logiciels libres et bibliothéconomie (http://www.koha-fr.org)
More information about the Koha-devel
mailing list