
Code Writing Guide
Description
Book Introduction
How can we write code that is easy to read and understand?
A current LINE developer shares tips for writing readable code!
From naming to how to review code!
If you are a developer, you may have had the experience of blaming yourself and thinking, "Why did I write this code?"
It can be frustrating when you find that the code isn't complicated, but it's hard to understand and can easily break with just a small change, or when you think it's perfect when you write it, but then look at it again a few months later and you can't understand it at all.
The author has also had similar experiences several times.
So, I thought about what makes code easy to read and how to write readable code, and based on my own experiences, I included in this book the principles for writing code that is easy to read and understand.
The book begins by exploring why readable code is necessary and how code readability impacts development productivity through programming principles.
It also covers naming methods, commenting methods, the internal structure of classes (states and functions), the structure between classes (dependencies), and how to review code from the perspective of readability, so that it can be applied directly to practice.
If you gradually improve your naming, you'll become accustomed to writing readable code, and you'll be able to build that strength by thinking about how you can apply it in the future.
There's no right way to create readable code, but this book will guide you through figuring out the best approach for your situation.
A current LINE developer shares tips for writing readable code!
From naming to how to review code!
If you are a developer, you may have had the experience of blaming yourself and thinking, "Why did I write this code?"
It can be frustrating when you find that the code isn't complicated, but it's hard to understand and can easily break with just a small change, or when you think it's perfect when you write it, but then look at it again a few months later and you can't understand it at all.
The author has also had similar experiences several times.
So, I thought about what makes code easy to read and how to write readable code, and based on my own experiences, I included in this book the principles for writing code that is easy to read and understand.
The book begins by exploring why readable code is necessary and how code readability impacts development productivity through programming principles.
It also covers naming methods, commenting methods, the internal structure of classes (states and functions), the structure between classes (dependencies), and how to review code from the perspective of readability, so that it can be applied directly to practice.
If you gradually improve your naming, you'll become accustomed to writing readable code, and you'll be able to build that strength by thinking about how you can apply it in the future.
There's no right way to create readable code, but this book will guide you through figuring out the best approach for your situation.
- You can preview some of the book's contents.
Preview
index
Chapter 1: How to Write Readable Code
1.1 Productivity Improvement
__1.1.1 Relationship between development scale and productivity
__1.1.2 Environment and evaluation system for improving readability
1.2 Requirements for writing readable code
__1.2.1 Readability-related metrics
__1.2.2 Things to keep in mind to improve readability
1.3 Representative programming principles
__1.3.1 Boy Scout Principles
__1.3.2 YAGNI
__1.3.3 KISS
__1.3.4 Single Responsibility Principle
__1.3.5 Premature optimization is the root of all evil
1.4 Summary
Chapter 2 Naming
2.1 English grammar used in naming
__2.1.1 Noun or noun phrase
__2.1.2 Command
__2.1.3 Other English Grammar
__2.1.4 Why we ignore grammar and name things
2.2 What the name says
__2.2.1 Example: Argument Names
__2.2.2 Example: Function name
__2.2.3 Exception: Abstract Methods
2.3 Word selection
__2.3.1 Example: Choosing unambiguous words
__2.3.2 Avoiding Confusing Abbreviations
__2.3.3 Adding words that represent units or entities
__2.3.4 Using positive words
2.4 Language, Platform, and Coding Conventions
2.5 Summary
Chapter 3 Notes
3.1 Types and Purposes of Comments
3.2 Documentation Notes
__3.2.1 Anti-pattern
__3.2.2 Structure of documentation comments
__3.2.3 Summary of documentation comments
__3.2.4 Details of documentation comments
3.3 Informal Annotations
__3.3.1 Splitting large code
__3.3.2 Explaining Non-Intuitive Code
3.4 Summary
Chapter 4 Status
4.1 When variable values are more appropriate
4.2 Relationships between variables, orthogonal
__4.2.1 Definition of orthogonality
__4.2.2 Method: Replacing with a function
__4.2.3 Method: Replace with sum type
4.3 Design of state transitions
__4.3.1 Immutability
__4.3.2 Idempotency
__4.3.3 Acyclic
4.4 Summary
Chapter 5 Functions
5.1 Function Responsibilities
__5.1.1 Basic principles of function partitioning
__5.1.2 Separation of Commands and Queries
5.2 Function Flow
__5.2.1 Definition-Based Programming
__5.2.2 Early Return
__5.2.3 Splitting by manipulation target
5.3 Summary
Chapter 6 Dependency Relationships
6.1 Examples of Dependency Relationships
6.2 Strength of Dependency: Coupling
__6.2.1 Combining Contents
__6.2.2 Common joins and outer joins
__6.2.3 Control Combination
__6.2.4 Stamp Combination and Data Combination
__6.2.5 Message Combination
6.3 Direction of dependence
__6.3.1 Caller → Callee
__6.3.2 Concrete → Abstract
__6.3.3 Complex/Variable → Simple/Immutable
6.4 Duplication of Dependencies
__6.4.1 Linked Dependencies
__6.4.2 Duplication of the set of dependent objects
6.5 Explicitness of Dependencies
__6.5.1 Antipattern 1: Excessive Abstraction
__6.5.2 Antipattern 2: Implicit Value Ranges
6.6 Summary
Chapter 7 Code Review
7.1 Reviewer's Note 1: Creating Pull Requests That Are Easy to Review
__7.1.1 Specifying the purpose of the pull request
__7.1.2 Splitting pull requests
__7.1.3 Structuring Commit
7.2 Reviewer's Note 2: Applying Review Comments
__7.2.1 Finding the cause of incorrect opinions or questions
__7.2.2 Understanding the intent of the proposal
__7.2.3 Applying to other parts
7.3 Reviewer's Note 1: Reviewer's Principles
__7.3.1 Do not neglect requested reviews.
__7.3.2 Rejecting problematic pull requests
__7.3.3 Don't be overly conscious of deadlines
__7.3.4 Presenting 'opinions', not 'suggestions'
7.4 Reviewer's Note 2: Comment Content
__7.4.1 Case Analysis
7.5 Summary
Appendix Kotlin Grammar Required for Reading This Book
1.1 Productivity Improvement
__1.1.1 Relationship between development scale and productivity
__1.1.2 Environment and evaluation system for improving readability
1.2 Requirements for writing readable code
__1.2.1 Readability-related metrics
__1.2.2 Things to keep in mind to improve readability
1.3 Representative programming principles
__1.3.1 Boy Scout Principles
__1.3.2 YAGNI
__1.3.3 KISS
__1.3.4 Single Responsibility Principle
__1.3.5 Premature optimization is the root of all evil
1.4 Summary
Chapter 2 Naming
2.1 English grammar used in naming
__2.1.1 Noun or noun phrase
__2.1.2 Command
__2.1.3 Other English Grammar
__2.1.4 Why we ignore grammar and name things
2.2 What the name says
__2.2.1 Example: Argument Names
__2.2.2 Example: Function name
__2.2.3 Exception: Abstract Methods
2.3 Word selection
__2.3.1 Example: Choosing unambiguous words
__2.3.2 Avoiding Confusing Abbreviations
__2.3.3 Adding words that represent units or entities
__2.3.4 Using positive words
2.4 Language, Platform, and Coding Conventions
2.5 Summary
Chapter 3 Notes
3.1 Types and Purposes of Comments
3.2 Documentation Notes
__3.2.1 Anti-pattern
__3.2.2 Structure of documentation comments
__3.2.3 Summary of documentation comments
__3.2.4 Details of documentation comments
3.3 Informal Annotations
__3.3.1 Splitting large code
__3.3.2 Explaining Non-Intuitive Code
3.4 Summary
Chapter 4 Status
4.1 When variable values are more appropriate
4.2 Relationships between variables, orthogonal
__4.2.1 Definition of orthogonality
__4.2.2 Method: Replacing with a function
__4.2.3 Method: Replace with sum type
4.3 Design of state transitions
__4.3.1 Immutability
__4.3.2 Idempotency
__4.3.3 Acyclic
4.4 Summary
Chapter 5 Functions
5.1 Function Responsibilities
__5.1.1 Basic principles of function partitioning
__5.1.2 Separation of Commands and Queries
5.2 Function Flow
__5.2.1 Definition-Based Programming
__5.2.2 Early Return
__5.2.3 Splitting by manipulation target
5.3 Summary
Chapter 6 Dependency Relationships
6.1 Examples of Dependency Relationships
6.2 Strength of Dependency: Coupling
__6.2.1 Combining Contents
__6.2.2 Common joins and outer joins
__6.2.3 Control Combination
__6.2.4 Stamp Combination and Data Combination
__6.2.5 Message Combination
6.3 Direction of dependence
__6.3.1 Caller → Callee
__6.3.2 Concrete → Abstract
__6.3.3 Complex/Variable → Simple/Immutable
6.4 Duplication of Dependencies
__6.4.1 Linked Dependencies
__6.4.2 Duplication of the set of dependent objects
6.5 Explicitness of Dependencies
__6.5.1 Antipattern 1: Excessive Abstraction
__6.5.2 Antipattern 2: Implicit Value Ranges
6.6 Summary
Chapter 7 Code Review
7.1 Reviewer's Note 1: Creating Pull Requests That Are Easy to Review
__7.1.1 Specifying the purpose of the pull request
__7.1.2 Splitting pull requests
__7.1.3 Structuring Commit
7.2 Reviewer's Note 2: Applying Review Comments
__7.2.1 Finding the cause of incorrect opinions or questions
__7.2.2 Understanding the intent of the proposal
__7.2.3 Applying to other parts
7.3 Reviewer's Note 1: Reviewer's Principles
__7.3.1 Do not neglect requested reviews.
__7.3.2 Rejecting problematic pull requests
__7.3.3 Don't be overly conscious of deadlines
__7.3.4 Presenting 'opinions', not 'suggestions'
7.4 Reviewer's Note 2: Comment Content
__7.4.1 Case Analysis
7.5 Summary
Appendix Kotlin Grammar Required for Reading This Book
Detailed image
.jpg)
Into the book
Unless you're someone who codes only today, everyone cares about the quality of their code.
Software development is not simply about implementing a product; it's a process of identifying and improving the root causes of problems and creating optimal results that take sustainability into account.
This book will teach you the principles for writing high-quality code, while also helping you choose when and where to apply them.
Code reviews, especially those covered in the final chapter, are a perfect opportunity to leverage the material in this book.
As IT becomes the center of the world, we must also consider the responsibilities that software developers must shoulder.
Code, by its very existence, becomes a liability that someone must maintain, so you must ensure that your code is not misunderstood by others, causing defects in your product or hindering productivity.
Rather than writing code that is “just meant to run” or “easy to write,” we need to write “reader-friendly code” so that all developers who encounter it can easily improve and extend it.
Software development is not simply about implementing a product; it's a process of identifying and improving the root causes of problems and creating optimal results that take sustainability into account.
This book will teach you the principles for writing high-quality code, while also helping you choose when and where to apply them.
Code reviews, especially those covered in the final chapter, are a perfect opportunity to leverage the material in this book.
As IT becomes the center of the world, we must also consider the responsibilities that software developers must shoulder.
Code, by its very existence, becomes a liability that someone must maintain, so you must ensure that your code is not misunderstood by others, causing defects in your product or hindering productivity.
Rather than writing code that is “just meant to run” or “easy to write,” we need to write “reader-friendly code” so that all developers who encounter it can easily improve and extend it.
--- From the translator's note
Publisher's Review
Are you going to create spaghetti code?
Will you create code that is easy to read and modify?
From code naming to code reviews, how to write code that improves readability.
“I have no idea what this code is doing”, “I need to change the specifications, but where do I start?” If you are a developer, you have probably experienced these things.
Sometimes, you come across code that is difficult to understand, has pitfalls everywhere, and can easily break with even the slightest change, even though it is clearly not implementing complex functions. Or, you may think your code is perfect and beautiful at the time you wrote it, but when you look at it again a few months later, you find yourself berating yourself, saying, "Why did I write this code?"
So we must not lose sight of ‘code readability’.
This book explains code readability and code review based on the author's experience reviewing and refactoring code on large-scale development projects while working at LINE.
First, we'll talk about why readable code is necessary and programming principles, then we'll explain how to name code, how to write comments, the internal structure of classes (state and functions), and the dependencies between classes.
It also provides guidance and methods for conducting code reviews within a team.
Because the book provides real-world Kotlin code examples throughout, you can clearly understand what you've learned in theory.
Will you create code that is easy to read and modify?
From code naming to code reviews, how to write code that improves readability.
“I have no idea what this code is doing”, “I need to change the specifications, but where do I start?” If you are a developer, you have probably experienced these things.
Sometimes, you come across code that is difficult to understand, has pitfalls everywhere, and can easily break with even the slightest change, even though it is clearly not implementing complex functions. Or, you may think your code is perfect and beautiful at the time you wrote it, but when you look at it again a few months later, you find yourself berating yourself, saying, "Why did I write this code?"
So we must not lose sight of ‘code readability’.
This book explains code readability and code review based on the author's experience reviewing and refactoring code on large-scale development projects while working at LINE.
First, we'll talk about why readable code is necessary and programming principles, then we'll explain how to name code, how to write comments, the internal structure of classes (state and functions), and the dependencies between classes.
It also provides guidance and methods for conducting code reviews within a team.
Because the book provides real-world Kotlin code examples throughout, you can clearly understand what you've learned in theory.
GOODS SPECIFICS
- Date of issue: April 12, 2024
- Page count, weight, size: 296 pages | 152*225*15mm
- ISBN13: 9791140709090
You may also like
카테고리
korean
korean