Five Lines of Code

How and when to refactor

Cover of Five Lines of Code

EPUB · English

Price and availability

EPUB eBookUS store

$67.99

Sign in to buy

You’ll review your order and final price before payment.

Download from your library after delivery. Protected eBooks need a compatible reading app.

For personal use under the eBook licence.

Territorial availability

Available in: Andorra, Austria, Australia, Belgium, Bulgaria, Canada, Switzerland, Cyprus, Czechia, Germany, Denmark, Estonia, Spain, Finland, France, United Kingdom, Guernsey, Greece, Croatia, Hungary, Ireland, Isle of Man, Iceland, Italy, Jersey, Japan, Liechtenstein, Lithuania, Luxembourg, Latvia, Monaco, Malta, Netherlands, Norway, Poland, Portugal, Romania, Sweden, Slovenia, Slovakia, San Marino, United States, Vatican City, South Africa

Publisher rights cover these stores: US, UK, Canada, EU, Australia. Checkout availability is shown above.

Format
EPUB
DRM
Not stated by the publisher
Language
English
Publisher
Manning
Published
9 November 2021
ISBN
9781638356370
Subjects
Information technology: general issues, Computer programming / software development, Object-oriented programming (OOP), Digital and Information technology: general topics, Computer programming / software engineering, Object-oriented programming (OOP)

About this book

Five Lines of Code teaches refactoring that's focused on concrete rules and getting any method down to five lines or less! Theres 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 codeImproving code safely, even when you dont understand itBalancing optimization and code generalityProper compiler practicesThe Extract method, Introducing Strategy pattern, and many other refactoring patternsWriting stable code that enables change-by-additionWriting code that needs no commentsReal-world practices for great refactoringImproving existing coderefactoringis one of the most common tasks youll 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 authors expert perspectivethat refactoring and code smells can be learned by following a concrete set of principlesyoull learn when to refactor your code, what patterns to apply to what problem, and the code characteristics that indicate its time for a rework.Foreword by Robert C. Martin.About the technologyEvery 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, youll learn a unique approach to refactoring that implements any method in five lines or fewer. Youll also discover a secret most senior devs know: sometimes its quicker to hammer out code and fix it later!About the bookFive Lines of Code is a fresh look at refactoring for developers of all skill levels. In it, youll master author Christian Clausens innovative approach, learning concrete rules to get any method down to five linesor less! Youll learn when to refactor, specific refactoring patterns that apply to most common problems, and characteristics of code that should be deleted altogether.What's insideThe signs of bad codeImproving code safely, even when you dont understand itBalancing optimization and code generalityProper compiler practicesAbout the readerFor developers of all skill levels. Examples use easy-to-read Typescript, in the same style as Java and C#.About the authorChristian Clausen works as a Technical Agile Coach, teaching teams how to refactor code.Table of Contents1 Refactoring refactoring2 Looking under the hood of refactoringPART 1 LEARN BY REFACTORING A COMPUTER GAME3 Shatter long function4 Make type codes work5 Fuse similar code together6 Defend the dataPART 2 TAKING WHAT YOU HAVE LEARNED INTO THE REAL WORLD7 Collaborate with the compiler8 Stay away from comments9 Love deleting code10 Never be afraid to add code11 Follow the structure in the code12 Avoid optimizations and generality13 Make bad code look bad14 Wrapping up

Bibliographic data © Gardners Books Ltd.