Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Refactoring in Java
  • Table Of Contents Toc
  • Feedback & Rating feedback
Refactoring in Java

Refactoring in Java

By : Stefano Violetta
5 (1)
close
close
Refactoring in Java

Refactoring in Java

5 (1)
By: Stefano Violetta

Overview of this book

Refactoring in Java serves as an indispensable guide to enhancing your codebase’s quality and maintainability. The book begins by helping you get to grips with refactoring fundamentals, including cultivating good coding habits and identifying red flags. You’ll explore testing methodologies, essential refactoring techniques, and metaprogramming, as well as designing a good architecture. The chapters clearly explain how to refactor and improve your code using real-world examples and proven techniques. Part two equips you with the ability to recognize code smells, prioritize tasks, and employ automated refactoring tools, testing frameworks, and code analysis tools. You’ll discover best practices to ensure efficient code improvement so that you can navigate complexities with ease. In part three, the book focuses on continuous learning, daily practices enhancing coding proficiency, and a holistic view of the architecture. You’ll get practical tips to mitigate risks during refactoring, along with guidance on measuring impact to ensure that you become an efficient software craftsperson. By the end of this book, you’ll be able to avoid unproductive programming or architecturing, detect red flags, and propose changes to improve the maintainability of your codebase.
Table of Contents (15 chapters)
close
close
1
Part 1: Introduction to Refactoring
4
Part 2: Essence of Refactoring and Good Code
Free Chapter
10
Part 3: Further Learning

Writing better methods

Composing methods is a fundamental skill that should be a part of every developer’s refactoring toolkit. To put it simply, almost bluntly, it’s about breaking your code into smaller pieces, each of which does just one thing in a very readable way, in a very procedural manner; you could almost think of it as a recipe (please forgive me; I’m Italian, so I always bring everything back to food). The details are hidden in the methods beneath the composed method; this allows us to read our logic, our code, at a high level – I dare say, almost “in prose.”

When refactoring your code, the process typically involves extracting code from the original method. If you find it challenging to come up with meaningful names for the extracted methods, it’s a clear sign that the code chunk you were about to extract may be too extensive. Another case I’ve come across is when someone (sometimes myself) suggested naming a method...

Unlock full access

Continue reading for free

A Packt free trial gives you instant online access to our library of over 7000 practical eBooks and videos, constantly updated with the latest in tech
bookmark search playlist download font-size

Change the font size

margin-width

Change margin width

day-mode

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Delete Bookmark

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY