Everybody knows that they should refactor their code to make sure that it is as easy as possible to maintain and understand.
Refactoring by editing text introduces errors, and there can be long times when the code won't even compile, because a refactoring is part way through. Using automated refactoring tools means that your code will compile all the time, allowing tests to be run after every change.
IntelliJ IDEA provides a huge number of tools to make refactoring of even very large codebases pain-free.
This course starts at the beginning, showing how to refactor a small codebase using IntelliJ IDEA's automated tools, building up skills that can be applied to huge source trees without breaking a sweat.
It demonstrates that, often, code can be refactored without actually typing any code at all!
It also helps the student understand that refactoring is also about making design decisions.
Each lesson is easily digested in under 15 minutes, teaching techniques that are immediately useful in the real world.
This course requires a copy of IntelliJ IDEA, which is a free download.
The author and the course content is not affiliated with Jetbrains s.r.o - although is a long time user and fan of their products!
This is the beginning of the course - Refactoring Java with IntelliJ IDEA.
Here we talk about what the course is going to teach, and talk about the lecture format.
In this lesson, you'll learn how to get the code from github, so that you can work along with the course, with your own copy of IDEA.
Here we learn a great secret of effective and productive programming
We take a short your of our example codebase, and learn about the classes that we'll be refactoring.
As IntelliJ IDEA is so configurable, it can be difficult to align settings between different users. Here we learn how to configure the settings that were used on this course.
IntelliJ has some pretty cool in-built refactorings for specific situations. Here we learn how to use one of them.
A discussion about refactoring - why should anybody even bother?
Here we see that you don't really even need to type any code to effect some major changes to a codebase. We can find and fix bugs almost without trying.
Here we learn how to use IntelliJ IDEA's "Extract Variable" and "Extract Method" refactorings. There are some surprising quirks in how they work - It's not as obvious as it might seem!
Rename methods, variables and all manner of other symbols across a codebase in fractions of a second. Here we see how.
Functionality can be lying around all over the place. Here we use the "Extract Method" refactoring to clean it up and put it in the right place.
Continuing to tidy up, this time moving methods between classes.
We make extensive use of the "Intention Menu" as we continue to tidy up the code.
We add some tests, with some surprising and unexpected consequences.
In this lecture we up the ante with the refactoring, using "Extract Interface, and add just a small extra feature to the system.
The business owners have a far more complex feature to add to our system. Here we find out if our previous refactorings have made it easier or harder. We write some acceptance tests, and attempt to implement our feature before lunchtime.
James has designed and implemented large scale software systems at many well-known global organisations - ranging from high-speed financial systems, to consumer electronics in millions of people's front room.
He has over twenty years of professional software design experience, and is often invited into software projects to help them refactor both the large and small scale design of the software - to enable safe iterative and incremental software delivery.