eZ coding standards - some questions

Author Message

Piotrek Karaƛ

Wednesday 28 May 2008 9:08:37 pm

Hello everyone,

I would like to ask you about your opinions and experiences regarding coding standards that are used in the context of eZ Publish, and also a few questions to give an idea of what I am wondering about. I mostly thinking of PHP, template language and MySQL, but if something is missed out - probably as well.

1) Do you follow the coding standards introduced in eZ Publish? If yes, to what extent and for which parts/layers?
2) Which standards exactly do you follow? eZ Network, old documentation, or maybe just what you see and learn from the sources?
3) Do you see any advantages/disadvantages of following the standards that have been set (provided that they have)?
4) What do you like/dislike about those, or refuse to use?
5) Do you think anything will have to change when eZ Components make it into eZ Publish? Will the standards alter/get adjusted as we have more and more components incorporated?
6) How much of your overall code is actually eZ Publish related? If eZ Publish is not your only/major platform, do you have different standards for different applications, or maybe a general company standard guide?

The reason I am asking those questions is that as we grow and new developers join us, this debate on eZ coding standards pops-up again and again. It would be great to know how you've dealt it and of what importance you see it within your teams.

Thanks a lot!

--
Company: mediaSELF Sp. z o.o., http://www.mediaself.pl
eZ references: http://ez.no/partners/worldwide_partners/mediaself
eZ certified developer: http://ez.no/certification/verify/272585
eZ blog: http://ez.ryba.eu

Bruce Morrison

Wednesday 28 May 2008 10:51:45 pm

Hi Piotrek

I've recently gone through the process of preparing an extension for eZ Network certification and one of the requirements is that the code matches the eZ coding standards.

It was difficult at first but you eventually get the hang of it (like most things). Most things are simple, but can be annoying if you used to something different. e.g. 4 spaces for indent, I usually use 2 and spaces around ( ) and after spaces after ',' in param lists.

I found that some of the examples and explanations, especially the template coding were not detailed enough and had to make a best guess in many situations.

I'm assuming that the eZ coding standards and the components ones are the same? Though I do note that the eZ ones want comments/inline docs in doxygen while I believe components use phpdoc.

if you are working with a framework that employs a particular coding standard then I think you have to use it even if it means you are using different coding standards with in your organisation.

I've advocated that the particular organisation I'm working for utilise the eZ coding standards for all new projects.

The guidelines I've been working to are found at
http://ez.no/services/eznetwork/development_guidelines

cheers
Bruce

My Blog: http://www.stuffandcontent.com/
Follow me on twitter: http://twitter.com/brucemorrison
Consolidated eZ Publish Feed : http://friendfeed.com/rooms/ez-publish

Thomas Koch

Wednesday 28 May 2008 11:37:24 pm

You find the implementation guidelines for eZComponents here:

http://www.ezcomponents.org/contributing/coding_standards

They do not only constitute cosmetic rules like indentation and parenthesis style, but also gives a very good reading about best practices of naming and code organization.

I have recommended these guidelines to any programmer who wanted to improve his coding style.

---
Thomas Koch | http://koch.ro
YMC - eZ Publish in Switzerland | http://ymc.ch

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.