Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Clean Code in JavaScript

You're reading from  Clean Code in JavaScript

Product type Book
Published in Jan 2020
Publisher Packt
ISBN-13 9781789957648
Pages 548 pages
Edition 1st Edition
Languages
Concepts
Author (1):
James Padolsey James Padolsey
Profile icon James Padolsey

Table of Contents (26) Chapters

Preface 1. Section 1: What is Clean Code Anyway?
2. Setting the Scene 3. The Tenets of Clean Code 4. The Enemies of Clean Code 5. SOLID and Other Principles 6. Naming Things Is Hard 7. Section 2: JavaScript and Its Bits
8. Primitive and Built-In Types 9. Dynamic Typing 10. Operators 11. Parts of Syntax and Scope 12. Control Flow 13. Section 3: Crafting Abstractions
14. Design Patterns 15. Real-World Challenges 16. Section 4: Testing and Tooling
17. The Landscape of Testing 18. Writing Clean Tests 19. Tools for Cleaner Code 20. Section 5: Collaboration and Making Changes
21. Documenting Your Code 22. Other Peoples' Code 23. Communication and Advocacy 24. Case Study 25. Other Books You May Enjoy

Communication and Advocacy

We do not write code in isolation. We are embedded in a highly chaotic social world in which we must communicate with other people constantly. Our software itself will, via its interfaces, be part of this communication. Furthermore, if we operate within a team, a workplace, or a community, we are liable to the challenges of effective communication.

The most significant way in which communication has an effect on our code bases is in the setting of requirements and the raising of issues and feedback. Software development is essentially one very elongated feedback process, where every change is precipitated by a communication:

In this chapter, we'll learn how to effectively collaborate and communicate with others, how to plan and set requirements, some common collaboration pitfalls, and their solutions. We'll also learn how to identify and raise...

Planning and setting requirements

One of the most common communication struggles resides in the process of deciding what to actually build. Programmers will typically spend a lot of time meeting with managers, designers, and other stakeholders to transform a genuine user need into a workable solution. Ideally, this process would be simple: User has [problem]; We create [solution]. End of story! Unfortunately, however, it can be far more complicated.

There are numerous technical constraints and biases of communication that can make even seemingly simple projects turn into punishingly long struggles. This is as relevant to the JavaScript programmer as any other programmer, for we now operate at a level of systemic complexity that was previously only the domain of enterprise programmers wielding Java, C#, or C++. The landscape has changed, and so the humble JavaScript programmer...

Communication strategies

We intuitively know that communication is vital to an effective project and a clean code base, yet it is annoyingly common to find ourselves in situations such as the following:

  • We don't feel listened to
  • We don't feel we've got our point across
  • We feel confused as to a topic or plan
  • We feel out of the loop or ignored

These difficulties come about because of cultures and practices of poor communication. This is not only an issue for morale and general fulfillment in our work but can also become a huge issue for the cleanliness of our code bases and the reliability of the technology we build. To foster a clean code base, we must focus on the underlying communication practices that we employ. A good set of communication strategies and practices are incredibly useful in ensuring a clean code base, specifically helping us with the following...

Identifying issues and driving change

A large part of being a programmer is identifying issues and fixing them. As part of our work, we employ many different moving parts, many of which will be maintained by other teams or individuals, and as such, we'll need to be effective in identifying and raising issues with code and systems that we don't have a full understanding of. Much like anything we do as programmers, the way in which we articulate these issues must take into consideration the target audience (user) of the issue or bug report that we're expressing. When we begin to see these pieces of communication as user experiences in their own right, we'll start to be genuinely effective communicators.

Raising bugs

...

Summary

In this chapter, we have tried to explore the challenge of effective communication in a technical context, and have broadly discussed the communicative process involved in taking a problem from the ideation stage to the prototype stage. We have also covered the task of communicating and advocating for technological change, whether in the form of bug reports or raising broader issues concerning systemic problems. Programmers are not just the authors of code; they operate as part of the systems they are building, as crucial agents in the iterative feedback cycles that result in clean software. Understanding the considerable roles we play in these systems and feedback cycles is hugely empowering and begins to get to the crux of what it means to be a clean JavaScript programmer.

In the next and final chapter, we will be bringing together everything we have learned in the book...

lock icon The rest of the chapter is locked
You have been reading a chapter from
Clean Code in JavaScript
Published in: Jan 2020 Publisher: Packt ISBN-13: 9781789957648
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}