uuid: - value: 84a6f9be-759c-42ea-815b-6b29a90b7742 langcode: - value: en type: - target_id: daily_email target_type: node_type target_uuid: 8bde1f2f-eef9-4f2d-ae9c-96921f8193d7 revision_timestamp: - value: '2025-05-11T09:00:26+00:00' revision_uid: - target_type: user target_uuid: b8966985-d4b2-42a7-a319-2e94ccfbb849 revision_log: { } status: - value: true uid: - target_type: user target_uuid: b8966985-d4b2-42a7-a319-2e94ccfbb849 title: - value: | Suffixing names created: - value: '2023-12-10T00:00:00+00:00' changed: - value: '2025-05-11T09:00:26+00:00' promote: - value: false sticky: - value: false default_langcode: - value: true revision_translation_affected: - value: true path: - alias: /daily/2023/12/10/suffixing-names langcode: en body: - value: |

When writing code, it's common to suffix the class name with the type of class it is.

I do this often for most types of classes, such as Controllers, EventListeners, Factories, Repositories and Builders.

However, I don't always for value objects and data transfer objects (DTOs).

Also, I don't always suffix interfaces with Interface.

I've been re-reading the documentation for the Symfony Serializer component, which references both NameConverterInterface and MyDto::class.

Whilst it does make the names more verbose, it does clarify what the class is used for.

Symfony's coding standards and Drupal's PHP coding standards have conventions for this, but what do you think?

Do you add suffixes to your class or interface names, or do you prefer the simplified versions?

format: full_html processed: |

When writing code, it's common to suffix the class name with the type of class it is.

I do this often for most types of classes, such as Controllers, EventListeners, Factories, Repositories and Builders.

However, I don't always for value objects and data transfer objects (DTOs).

Also, I don't always suffix interfaces with Interface.

I've been re-reading the documentation for the Symfony Serializer component, which references both NameConverterInterface and MyDto::class.

Whilst it does make the names more verbose, it does clarify what the class is used for.

Symfony's coding standards and Drupal's PHP coding standards have conventions for this, but what do you think?

Do you add suffixes to your class or interface names, or do you prefer the simplified versions?

summary: null field_daily_email_cta: { }