As a contrib developer, I learned how to write both core patches and contrib modules by reading core code.
Drupal 7 is highly consistent internally and provided many good examples to follow.

Drupal 8, due to its long development cycle full of refactorings, has chosen to do conversions gradually, and the result of this has been the loss of internal consistency. Inside the same class you can find different naming conventions, docblock standards, array notations (array() vs [], sometimes even in the same method). Not to mention deprecated code and different patterns applied to the same problems.

So, since there are now multiple ways of doing the same thing in core, I can no longer rely on core as a teaching tool. As a part of writing Commerce 2.x and reviewing contributor's patches, I've had to practise ask-Berdir-driven-development way too much. The DX impact is significant because of the increased cognitive load and frustration over things as simple and insignificant as "how do I load an entity" and "how do I document my getters".

I've already been yelled at for raising a seemingly insignificant issue too close to a release, but I truly believe this is important.
Some of the issues are already documented, or almost done (removal of deprecated code), some will need additional consensus but require no breaking changes. Let's see what we can do to improve this situation.

Issues:
#2471485: Standardize getter docblocks - standardize on "Gets" vs "Returns" in getter docblocks.
#2225347: [META] Replace calls to ENTITY_TYPE_load() and ENTITY_TYPE_load_multiple() with static method calls - finish killing entity_load(), this still comes up in contrib too often.
#2474151: Mark procedural wrappers in entity.inc as deprecated - actually mark entity_load() and friends as deprecated.
#1832630: [policy, then patch] Decide on coding standard for configuration keys of ConfigEntities - most of our config entites break our own coding standards.
#2346857: Set default property bundle_entity_type in EntityType to NULL Assigned to: yched - bundles should be used consistently
#2316171: [meta] Improve DX of entity defining (if you want a UI) - self-descriptive

Feel free to add your own.

Comments

bojanz’s picture

Issue summary: View changes
bojanz’s picture

Issue summary: View changes
Issue tags: +consistency

Tim Plunkett suggested tracking the consistency related issues with its own tag.

andypost’s picture

andypost’s picture

bojanz’s picture

@andypost
I would argue that #3 and #4 are not relevant, they are examples of things core can do better, but not things that are done differently in different places.

JeroenT’s picture

Issue summary: View changes

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

bojanz’s picture

Status: Active » Closed (outdated)