What Have You Learned?

So you’ve read through the first set of comparisons and arrived at this page. First of all, thanks! We’re happy that you stuck with us this far. You’ve already learned a lot about a important topic: writing readable code. Maintaining existing code is what we spend most of our effort on these days, and you’ll seldom start a project from the green field. Most of the time, your boss will hurl a gigantic heap of code at you that you’re supposed to fix and extend.

When that happens, you’ll be grateful if the person who wrote the code cared about readability. So be nice to your fellow programmer and strive for code readability! Also, you never know; even if you think you’ve concluded a project, your boss might reassign you and then your code comes back to haunt you.

That’s why we’ve shown you how to avoid unnecessary code. You’ve learned how to simplify Boolean expressions and you’ll stay clear of a number of bugs that come from badly readable code, such as the switch fallthrough.

The best thing you can do now is to try out the things you’ve read about. Take a piece of code you wrote a while ago and take a look at it. Can you apply some of the recommendations you’ve read about here? How does your code look after these refactorings? Be sure to keep a copy of the original version to compare it against the improved one. After all, that’s the theme of this book!

When you’re ready, turn to the next chapter. We’ll dig deeper into the topic of code readability and understandability with some more advanced recommendations on code style and the use of the Java API. So be sure to read on!

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.226.98.208