Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First import of the "Official Best Practices" book #4327

Merged
merged 8 commits into from
Oct 20, 2014
Merged

First import of the "Official Best Practices" book #4327

merged 8 commits into from
Oct 20, 2014

Conversation

javiereguiluz
Copy link
Member

As promised, this Pull Request adds the source files of the new "Official Best Practices" book recently published at symfony.com/best-practices.

Similarly to any other Symfony documentation, the community is allowed, and even encouraged, to propose improvements and fixes to this document. However, given the special nature of this document, we'd like to clarify what proposals will be accepted and what proposals will not.

The following will be happily accepted:

  • Typos and grammar fixes.
  • Objective errors (errors in code, technical arguments that are irrelevant or wrong, etc.)
  • Rewordings and simplifications of confusing explanations.
  • Proposals to add new best practices not covered so far.

The following will not make it:

  • Complete rewriting of the existing best practices (for instance, a proposal to change "use annotations ..." to "don't use annotations ..." won't be accepted)

Before some of you get mad at us, please let us explain the purpose of this book. The "Official Symfony Best Practices" explains the recommendations that the original creator of Symfony thinks you should follow to develop web applications.

When we talk about opinions instead of facts, it's really hard to tell when someone is wrong. For instance, who of the following developers you think is wrong?

  • Developer A: you should not use annotations. They may be convenient for this and that, but they have these other problems.
  • Developer B: you should use annotations. They may have these problems, but it's worth it because of this and that convenience.

For us, both opinions are valid, in the sense that they are not promoting universal truths. It's perfectly fine to think that annotations are good and/or bad.

This is the reason why this book is not about the creator of Symfony thinking that he is smarter than all of us. And this is definitely not the list of perfect practices or mandatory practices. This is just an opinionated list of recommendations by the original creator of Symfony. If you happen to follow them (all or some) that's fine. If you don't want to follow them or even if you think that they are wrong, that's perfectly fine too.

Let us make it clear again: this is not a list of universal truths or mandatory practices. This is just a list of opinions about how to do things. Follow them or not at your will.

If the Symfony community wants to create their own set of "community best practices", that's great! That way, people will have more best practices to choose from and more information to make better decisions.

We really hope things are more clear now. If not, please comment us your concerns and we'll better explain things for you.


Speaking from a strictly technical point of view, I'd like to warn documentation maintainers (@weaverryan, @wouterj and @xabbuh) that I have no idea about the process to follow when adding a new book to the Symfony documentation.

The things that for sure are not going to work right now are the following:

  • On symfony.com we don't have the CSS style to display the best practices. We'll add it really soon to match the style of the existing PDF file.
  • On symfony.com the URL http://symfony.com/doc/current/best_practices/index.html now displays a regular web page. Once this book is added to the documentaton pipeline, we'll remove that page to show instead the index of this book.
  • The PDF generation for this book isn't prepared yet, so we'll have to wait a few days to set everything up.

===============================

.. toctree::
:hidden:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we don't hide them on the index pages


This guide is **specially suited** for:

* Websites and web applications developed with the full-stack Symfony framework.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would add "Non decoupled websites and web applications developed with the full-stack Symfony framework" here, since that's where it's about.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@wouterj
Copy link
Member

wouterj commented Oct 15, 2014

best_practises/index.rst needs to be included in a toctree in index.rst.

@javiereguiluz
Copy link
Member Author

@wouterj the Travis build is failing because the best-practice directive is missing. I've tried to add it here fabpot/sphinx-php#21 but I don't know either if it's needed nor if it's correctly done.

@stof
Copy link
Member

stof commented Oct 15, 2014

@javiereguiluz you need to update the submodule to point to a commit with the new directive included

@javiereguiluz
Copy link
Member Author

@stof thanks for pointing me about how to solve this problem. Let's see if Travis is happy now.

@javiereguiluz
Copy link
Member Author

This is the latest message error reported by Travis. Any help is really appreciated:

Exception occurred:
  File "/home/travis/virtualenv/python2.7.8/lib/python2.7/site-packages/sphinx/writers/html.py",
  line 204, in visit_admonition
    node.insert(0, nodes.title(name, admonitionlabels[name]))
KeyError: 'best-practice'
The full traceback has been saved in /tmp/sphinx-err-Tpl_1y.log, if you want to report the
issue to the developers.

@stof
Copy link
Member

stof commented Oct 15, 2014

@javiereguiluz try running the build locally to see the full stack trace

@javiereguiluz
Copy link
Member Author

@stof thanks again for the advice. I've finally been able to track the error and I've successfully solved it locally. A new PR has been created (fabpot/sphinx-php#22) and once it's merged, I'll try to update the submodule of this repo to see if it works.

@henrikbjorn
Copy link

IMO "Official" should be changed to "SensioLabs". And then i would not have any objections to the content or recommendations in the book.

"Official: relating to an authority or public body and its activities and responsibilities." and i like to think the public body and authority is the community (even though Fabien have the absolute last say), and the community as a whole have not created these.

@ghost
Copy link

ghost commented Oct 16, 2014

👍

``::layout.html.twig`` ``layout.html.twig``
``AcmeDemoBundle::index.html.twig`` ``index.html.twig``
``AcmeDemoBundle:Default:subdir/index.html.twig`` ``default/subdir/index.html.twig``
``AcmeDemoBundle:Default/subdir:index.html.twig`` ``default/subdir/index.html.twig``

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These should use the new notation @AcmeDemo/Default/index.html.twig etc.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't think we should use the new notation because all the Symfony documentation, blog posts, talks, etc. use the traditional notation. Therefore, all Symfony developers know the traditional notation and only a small set of developers know the new notation.

@javiereguiluz
Copy link
Member Author

@henrikbjorn @krunoknego we think that your proposal is right. We have reworded a paragraph in the introduction. Now these are the "Symfony best practices" instead of the "Official Symfony best practices". We haven't updated the symfony.com/best-practices page because once this book is published, that page will be gone forever.

If the community creates their own set of recommendations, we'll call them "Community Best Practices" or "Symfony Community Best Practices" or something like that.

@xabbuh
Copy link
Member

xabbuh commented Oct 20, 2014

@javiereguiluz You can update the submodule reference to point to e58edd22d16cb247267025d557410dcbfa5fa959.

@webdevilopers
Copy link

👍

@javiereguiluz
Copy link
Member Author

thanks @xabbuh! It looks like everything works now as expected.

@weaverryan
Copy link
Member

Thanks for everyone's feedback! We'll keep moving forward from here :).

@weaverryan weaverryan merged commit 7eb9367 into symfony:2.3 Oct 20, 2014
weaverryan added a commit that referenced this pull request Oct 20, 2014
…iereguiluz)

This PR was merged into the 2.3 branch.

Discussion
----------

First import of the "Official Best Practices" book

As promised, this Pull Request adds the source files of the new "Official Best Practices" book recently published at symfony.com/best-practices.

Similarly to any other Symfony documentation, the community is allowed, and even encouraged, to propose improvements and fixes to this document. However, given the special nature of this document, we'd like to clarify what proposals will be accepted and what proposals will not.

**The following will be happily accepted:**

  * Typos and grammar fixes.
  * Objective errors (errors in code, technical arguments that are irrelevant or wrong, etc.)
  * Rewordings and simplifications of confusing explanations.
  * Proposals to add new best practices not covered so far.

**The following will not make it:**

  * Complete rewriting of the existing best practices (for instance, a proposal to change *"use annotations ..."* to *"don't use annotations ..."* won't be accepted)

Before some of you get mad at us, please let us explain the purpose of this book. The "Official Symfony Best Practices" explains the recommendations that the original creator of Symfony thinks you should follow to develop web applications.

When we talk about opinions instead of facts, it's really hard to tell when someone is wrong. For instance, who of the following developers you think is wrong?

  * *Developer A*: you should not use annotations. They may be convenient for this and that, but they have these other problems.
  * *Developer B*: you should use annotations. They may have these problems, but it's worth it because of this and that convenience.

For us, both opinions are valid, in the sense that they are not promoting universal truths. It's perfectly fine to think that annotations are good and/or bad.

This is the reason why this book is not about the creator of Symfony thinking that he is smarter than all of us. And this is definitely not the list of perfect practices or mandatory practices. This is just an opinionated list of recommendations by the original creator of Symfony. If you happen to follow them (all or some) that's fine. If you don't want to follow them or even if you think that they are wrong, that's perfectly fine too.

Let us make it clear again: this is not a list of universal truths or mandatory practices. This is just a list of opinions about how to do things. Follow them or not at your will.

If the Symfony community wants to create their own set of "community best practices", that's great! That way, people will have more best practices to choose from and more information to make better decisions.

We really hope things are more clear now. If not, please comment us your concerns and we'll better explain things for you.

------

Speaking from a strictly technical point of view, I'd like to warn documentation maintainers (@weaverryan, @wouterj and @xabbuh) that I have no idea about the process to follow when adding a new book to the Symfony documentation.

The things that for sure are not going to work right now are the following:

  * On `symfony.com` we don't have the CSS style to display the best practices. We'll add it really soon to match the style of the existing PDF file.
  * On `symfony.com` the URL `http://symfony.com/doc/current/best_practices/index.html` now displays a regular web page. Once this book is added to the documentaton pipeline, we'll remove that page to show instead the index of this book.
  * The PDF generation for this book isn't prepared yet, so we'll have to wait a few days to set everything up.

Commits
-------

7eb9367 Updated the sphinx submodule to ad support for best-practice directive
d001da8 Fixed some typos reported by @henrikbjorn
d12cfe5 Renamed "official best practices" to "best practices"
af6b70b added the missing "best-practice" directive import in Sphinx configuration
30b9c45 updated fabpot/sphinx-php module reference
f100fc0 Added an index directive to the first chapter
d317925 Fixed some technical problems as suggested by Wouter
2c2000a first import of the "Official Best Practices" book
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants