Although it was an underlying subject during years, last [pkp tech cmte] conversations raised an urgent need of “coding standards”
(aka. coding conventions) for HTML and CSS.
Now that the box is open I will suggest define the style for PHP, JS and also for PKP tools and UX/UI.
It’s obvious we can not decide and apply standards for everything and modify the existing code overnight, but we need to start the process if we want it finished.
The task we are proposing here is huge and could take years to be accomplished, so this is why I suggest going step by step: prioritize what coding that need conventions first, and then open a discussion about the standard to assume in this specific area and finally, when we arrive to an agreement, apply it to new code and start it all again with a new language.
In all the cases I suggest go with an existing (and widely extended) documentation project and over it, add our peculiarities (a
preliminary list of projects working on HTML/CSS is added to the end of this post).
Indeed, this is what “Jerico.dev” did with the PKP’s Javascript coding standards we have in PKP wiki. (BTW, I think this is a
perfect example about how to document coding. Great work)
About the priorities, this is my subjective list (please, modify as you wish… adding and removing if it’s required):
- HTML/CSS
- LESS
- PHP
- PKP
- JS (it is mostly done and only need to be reviewed to unify with the rest).
- UX/UI (Patterns?)
BTW, I added UX/UI ot the list, because I think components it also need to be documented.
I know Kevin is working hard on it… In an ideal world, I love to see PKP style guide for UX/UI explained as BBC or bootstrap.
Conventions will help new developers write and understand the code easily but will also more comfortable for our expert ones.
Finally, we are far from this, but with this process we can start a convergence process.
Opinions?
Cheers,
m.
FURTHER READING…
Existing documentation (by Alec)
-
The most comprehensive document is the OJS technical reference: Tellingly, it has conventions for PHP code, database structures, etc., but all it has to say about UI is that layout should use CSS and markup should validate as XHTML. URL: http://pkp.sfu.ca/ojs/OJSTechnicalReference.pdf
-
In the wiki, we have good conventions for Javascript: This could provide a basic template. URL: http://pkp.sfu.ca/wiki/index.php?title=JavaScript_coding_conventions
Long story short: we essentially don’t have any written conventions yet for HTML/CSS. I thought I remembered some but I can’t find them. We’d be starting from a blank slate here.
HTML/CSS coding standards (by Marc):
- Code Guide by @mdo
- Google HTML/CSS Style Guide: Exhaustive list of references to build CSS. May be, too much detailed.
- Scalable and Modular Architecture for CSS
- Object-Oriented CSS
- Reasonable Standard* for CSS Stylesheet Structure: Short list with clear and reasonable suggestions to build SCSS.
- GitHub’s CSS Styleguide
- Principles of writing consistent, idiomatic CSS
- CKAN coding guides
- MediaRain coding guides
- A list of CSS Style Guides
About UI/UX (ideas to define the “visual style guide” of PKP products):
- http://getbootstrap.com/2.3.2/base-css.html
- http://www.bbc.co.uk/gel
- http://ui-patterns.com/
- https://www.google.com/design/spec/what-is-material/environment.html#
COLLATERAL DAMAGES
Although is not the focus of this conversation, those are subjects that are more or less related with the work proposed.
Documentation to be updated
Hook list description.
Bonus pack
Visual representation of our git model:Pe: http://nvie.com/posts/a-successful-git-branching-model/