官术网_书友最值得收藏!

The API site and coding standards

A lot of background knowledge is required for writing good Drupal code. Of course, the aim of a book such as this is to try to provide as much of that background knowledge as possible. However, self-documentation and research still remain key, and there are a number of resources that a Drupal developer should have on-hand.

The first is the official online API documentation. Just about every function in Drupal is documented using inline code documentation. The Doxygen program is then used to extract that documentation and format it. You can access the full API documentation online at http://api.drupal.org.

Along with using the Drupal APIs, we strive to comply with Drupal's coding conventions. Best practices in software development include keeping code clean, consistent, and readable. One aspect of this is removing nuances in code formatting by following a fixed standard.

This is particularly important on a platform such as Drupal, where thousands of developers all contribute to the code. Without coding standards, the code would become a cluttered mishmash of styles, and valuable development time will be spent merely deciphering code instead of working on it.

The Drupal site has a manual on coding standards that each Drupal developer needs to become familiar with (https://www.drupal.org/docs/develop/standards/coding-standards). It won't happen overnight; you will get better with experience, but you can also configure your IDE to, for instance, flag any issues with your code formatting.

A third resource for developers new to Drupal 8, but who have experience with Drupal 7, is the change records database (https://www.drupal.org/list-changes/drupal). On this page, you'll find an inventory of the most important API and usage changes with some handy explanations that will be extremely helpful for Drupal 7 developers looking up how certain functions have been changed.

主站蜘蛛池模板: 巴彦淖尔市| 贵港市| 丹江口市| 什邡市| 定南县| 连江县| 城市| 织金县| 永新县| 武定县| 磐石市| 临澧县| 平遥县| 凤阳县| 梓潼县| 申扎县| 屏边| 寻甸| 额尔古纳市| 桃江县| 平昌县| 抚宁县| 虎林市| 闸北区| 舞阳县| 毕节市| 遵义县| 碌曲县| 台东县| 西宁市| 眉山市| 四会市| 土默特右旗| 图们市| 固安县| 广宗县| 南澳县| 永修县| 绥化市| 乐都县| 神农架林区|