Ebook702 pages7 hours
Five Lines of Code: How and when to refactor
Rating: 0 out of 5 stars
()
About this ebook
Five Lines of Code teaches refactoring that's focused on concrete rules and getting any method down to five lines or less! There’s no jargon or tricky automated-testing skills required, just easy guidelines and patterns illustrated by detailed code samples.
In Five Lines of Code you will learn:
The signs of bad code
Improving code safely, even when you don’t understand it
Balancing optimization and code generality
Proper compiler practices
The Extract method, Introducing Strategy pattern, and many other refactoring patterns
Writing stable code that enables change-by-addition
Writing code that needs no comments
Real-world practices for great refactoring
Improving existing code—refactoring—is one of the most common tasks you’ll face as a programmer. Five Lines of Code teaches you clear and actionable refactoring rules that you can apply without relying on intuitive judgements such as “code smells.” Following the author’s expert perspective—that refactoring and code smells can be learned by following a concrete set of principles—you’ll learn when to refactor your code, what patterns to apply to what problem, and the code characteristics that indicate it’s time for a rework.
Foreword by Robert C. Martin.
Purchase of the print book includes a free eBook in PDF, Kindle, and ePub formats from Manning Publications.
About the technology
Every codebase includes mistakes and inefficiencies that you need to find and fix. Refactor the right way, and your code becomes elegant, easy to read, and easy to maintain. In this book, you’ll learn a unique approach to refactoring that implements any method in five lines or fewer. You’ll also discover a secret most senior devs know: sometimes it’s quicker to hammer out code and fix it later!
About the book
Five Lines of Code is a fresh look at refactoring for developers of all skill levels. In it, you’ll master author Christian Clausen’s innovative approach, learning concrete rules to get any method down to five lines—or less! You’ll learn when to refactor, specific refactoring patterns that apply to most common problems, and characteristics of code that should be deleted altogether.
What's inside
The signs of bad code
Improving code safely, even when you don’t understand it
Balancing optimization and code generality
Proper compiler practices
About the reader
For developers of all skill levels. Examples use easy-to-read Typescript, in the same style as Java and C#.
About the author
Christian Clausen works as a Technical Agile Coach, teaching teams how to refactor code.
Table of Contents
1 Refactoring refactoring
2 Looking under the hood of refactoring
PART 1 LEARN BY REFACTORING A COMPUTER GAME
3 Shatter long function
4 Make type codes work
5 Fuse similar code together
6 Defend the data
PART 2 TAKING WHAT YOU HAVE LEARNED INTO THE REAL WORLD
7 Collaborate with the compiler
8 Stay away from comments
9 Love deleting code
10 Never be afraid to add code
11 Follow the structure in the code
12 Avoid optimizations and generality
13 Make bad code look bad
14 Wrapping up
In Five Lines of Code you will learn:
The signs of bad code
Improving code safely, even when you don’t understand it
Balancing optimization and code generality
Proper compiler practices
The Extract method, Introducing Strategy pattern, and many other refactoring patterns
Writing stable code that enables change-by-addition
Writing code that needs no comments
Real-world practices for great refactoring
Improving existing code—refactoring—is one of the most common tasks you’ll face as a programmer. Five Lines of Code teaches you clear and actionable refactoring rules that you can apply without relying on intuitive judgements such as “code smells.” Following the author’s expert perspective—that refactoring and code smells can be learned by following a concrete set of principles—you’ll learn when to refactor your code, what patterns to apply to what problem, and the code characteristics that indicate it’s time for a rework.
Foreword by Robert C. Martin.
Purchase of the print book includes a free eBook in PDF, Kindle, and ePub formats from Manning Publications.
About the technology
Every codebase includes mistakes and inefficiencies that you need to find and fix. Refactor the right way, and your code becomes elegant, easy to read, and easy to maintain. In this book, you’ll learn a unique approach to refactoring that implements any method in five lines or fewer. You’ll also discover a secret most senior devs know: sometimes it’s quicker to hammer out code and fix it later!
About the book
Five Lines of Code is a fresh look at refactoring for developers of all skill levels. In it, you’ll master author Christian Clausen’s innovative approach, learning concrete rules to get any method down to five lines—or less! You’ll learn when to refactor, specific refactoring patterns that apply to most common problems, and characteristics of code that should be deleted altogether.
What's inside
The signs of bad code
Improving code safely, even when you don’t understand it
Balancing optimization and code generality
Proper compiler practices
About the reader
For developers of all skill levels. Examples use easy-to-read Typescript, in the same style as Java and C#.
About the author
Christian Clausen works as a Technical Agile Coach, teaching teams how to refactor code.
Table of Contents
1 Refactoring refactoring
2 Looking under the hood of refactoring
PART 1 LEARN BY REFACTORING A COMPUTER GAME
3 Shatter long function
4 Make type codes work
5 Fuse similar code together
6 Defend the data
PART 2 TAKING WHAT YOU HAVE LEARNED INTO THE REAL WORLD
7 Collaborate with the compiler
8 Stay away from comments
9 Love deleting code
10 Never be afraid to add code
11 Follow the structure in the code
12 Avoid optimizations and generality
13 Make bad code look bad
14 Wrapping up
Related to Five Lines of Code
Related ebooks
Good Code, Bad Code: Think like a software engineer Rating: 5 out of 5 stars5/5Seriously Good Software: Code that works, survives, and wins Rating: 5 out of 5 stars5/5Grokking Simplicity: Taming complex software with functional thinking Rating: 3 out of 5 stars3/5API Design Patterns Rating: 5 out of 5 stars5/5Unit Testing Principles, Practices, and Patterns Rating: 4 out of 5 stars4/5Functional Reactive Programming Rating: 0 out of 5 stars0 ratingsObject Design Style Guide Rating: 0 out of 5 stars0 ratingsElixir in Action Rating: 0 out of 5 stars0 ratingsFunctional Programming in C#, Second Edition Rating: 0 out of 5 stars0 ratingsModern Java in Action: Lambdas, streams, functional and reactive programming Rating: 0 out of 5 stars0 ratingsGo in Practice Rating: 5 out of 5 stars5/5React in Action Rating: 0 out of 5 stars0 ratingsFunctional Programming in JavaScript: How to improve your JavaScript programs using functional techniques Rating: 0 out of 5 stars0 ratingsWeb Components in Action Rating: 0 out of 5 stars0 ratingsSoftware Mistakes and Tradeoffs: How to make good programming decisions Rating: 0 out of 5 stars0 ratingsReal-World Functional Programming: With examples in F# and C# Rating: 0 out of 5 stars0 ratingsProgramming with Types: Examples in TypeScript Rating: 0 out of 5 stars0 ratingsBDD in Action: Behavior-Driven Development for the whole software lifecycle Rating: 0 out of 5 stars0 ratingsIsomorphic Web Applications: Universal Development with React Rating: 0 out of 5 stars0 ratingsPractices of the Python Pro Rating: 0 out of 5 stars0 ratingsSpring Start Here: Learn what you need and learn it well Rating: 0 out of 5 stars0 ratings100 Go Mistakes and How to Avoid Them Rating: 4 out of 5 stars4/5Beginning Rust: From Novice to Professional Rating: 0 out of 5 stars0 ratingsTesting Java Microservices: Using Arquillian, Hoverfly, AssertJ, JUnit, Selenium, and Mockito Rating: 0 out of 5 stars0 ratingsJavaScript Application Design: A Build First Approach Rating: 0 out of 5 stars0 ratingsDependency Injection: Design patterns using Spring and Guice Rating: 0 out of 5 stars0 ratingsCode like a Pro in C# Rating: 0 out of 5 stars0 ratingsGrokking Continuous Delivery Rating: 0 out of 5 stars0 ratingsThe Mikado Method Rating: 0 out of 5 stars0 ratingsGet Programming with Scala Rating: 0 out of 5 stars0 ratings
Programming For You
Learn to Code. Get a Job. The Ultimate Guide to Learning and Getting Hired as a Developer. Rating: 5 out of 5 stars5/5Grokking Algorithms: An illustrated guide for programmers and other curious people Rating: 4 out of 5 stars4/5HTML & CSS: Learn the Fundaments in 7 Days Rating: 4 out of 5 stars4/5PYTHON: Practical Python Programming For Beginners & Experts With Hands-on Project Rating: 5 out of 5 stars5/5SQL QuickStart Guide: The Simplified Beginner's Guide to Managing, Analyzing, and Manipulating Data With SQL Rating: 4 out of 5 stars4/5Python Programming : How to Code Python Fast In Just 24 Hours With 7 Simple Steps Rating: 4 out of 5 stars4/5Coding All-in-One For Dummies Rating: 4 out of 5 stars4/5Excel : The Ultimate Comprehensive Step-By-Step Guide to the Basics of Excel Programming: 1 Rating: 5 out of 5 stars5/5Learn PowerShell in a Month of Lunches, Fourth Edition: Covers Windows, Linux, and macOS Rating: 0 out of 5 stars0 ratingsC# 7.0 All-in-One For Dummies Rating: 0 out of 5 stars0 ratingsC++ Learn in 24 Hours Rating: 0 out of 5 stars0 ratingsSQL: For Beginners: Your Guide To Easily Learn SQL Programming in 7 Days Rating: 5 out of 5 stars5/5Java for Beginners: A Crash Course to Learn Java Programming in 1 Week Rating: 5 out of 5 stars5/5Learn SQL in 24 Hours Rating: 5 out of 5 stars5/5Hacking: Ultimate Beginner's Guide for Computer Hacking in 2018 and Beyond: Hacking in 2018, #1 Rating: 4 out of 5 stars4/5Python: For Beginners A Crash Course Guide To Learn Python in 1 Week Rating: 4 out of 5 stars4/5C# Programming from Zero to Proficiency (Introduction): C# from Zero to Proficiency, #0 Rating: 0 out of 5 stars0 ratingsSQL All-in-One For Dummies Rating: 3 out of 5 stars3/5Linux: Learn in 24 Hours Rating: 5 out of 5 stars5/5Game Development with Unreal Engine 5: Learn the Basics of Game Development in Unreal Engine 5 (English Edition) Rating: 0 out of 5 stars0 ratingsC++ Programming Language Rating: 0 out of 5 stars0 ratingsData Structures and Algorithm Analysis in Java, Third Edition Rating: 4 out of 5 stars4/5
Reviews for Five Lines of Code
Rating: 0 out of 5 stars
0 ratings
0 ratings0 reviews
Book preview
Five Lines of Code - Christian Clausen
2a book_preview_excerpt.html }Isƶ_"J(EIEOڽ
iR~wsot_;d"BiS d晧nwM[W{W6.ɂ~hu7w;seNERۅI۪v2Yul
QُśãIxݽ;{764^bʶy%i&qmʶ6Iu];{ CqrqrqEr<]6eUC3&V2kkZ10mnyLLsV+ilsq.8?)MզC*[WvuUm#yVtM#µY.O^:9|yߧ缳w'+Kڦ1OFvEە&K[ZVHmxǯh7ON^/856K4nhr2eY]s\MӺ&MZ8o_<99?9=yyf@ mfhiKk::B:Κ4O*&@ dFմݡxpwdu¥MKJoӮuWPre؆p|^en.~xË7(.xLLZeN"}-!T=" <={499={y|zpdvmKZd3