TLDR.Chat

Mastering the Art of Naming in Programming

Naming is Hard: Let's Do Better - Kate Gregory - NDC TechTown 2024 🔗

00:00 Introduction

Kate Gregory opens her talk by acknowledging the difficulty of naming in programming. She emphasizes that while everyone agrees naming is hard, few know how to do it well. Naming is crucial as it affects understanding and communication within code.

05:00 Importance of Naming

Gregory discusses how names in code—variables, functions, and classes—are vital for conveying the meaning and purpose of the code. She illustrates this with examples of poor naming practices in C++ and stresses that naming is a skill that can be learned.

15:00 Naming Conventions

The speaker advises against getting bogged down in naming conventions like camel case or snake case, focusing instead on the meaning behind names. She points out that names should reflect the concepts they represent rather than their formatting.

25:00 Clarity in Naming

Gregory highlights the importance of choosing names that clearly communicate the purpose of code elements. She shares anecdotes about misleading names and the need to avoid using metaphors that may confuse users.

35:00 Consistency and Collaboration

The talk stresses the importance of consistent naming across various contexts, ensuring that the same terms are used in code, documentation, and communication. She encourages developers to engage with end-users to understand the appropriate terminology.

45:00 Learning to Name

Gregory concludes with tips for improving naming practices, including being thoughtful about names, using adjectives for clarity, and avoiding unnecessary abbreviations. She encourages the audience to continuously refine and advocate for better naming in their work.

What is the main challenge with naming in programming?

Naming in programming is challenging because it requires clear communication of concepts and intentions within the code, which can often be subjective and complex.

How can developers improve their naming skills?

Developers can improve their naming skills by practicing thoughtful naming, using descriptive terms, and learning from feedback on their naming choices.

Why is consistency in naming important?

Consistency in naming is important to avoid confusion and miscommunication, as it helps ensure that everyone understands the terms used across different contexts, such as code, documentation, and discussions.

Related