From the course: Java Refactoring Best Practices

Unlock this course with a free trial

Join today to access over 25,300 courses taught by industry experts.

Using spacing, brackets, and comments effectively

Using spacing, brackets, and comments effectively - Java Tutorial

From the course: Java Refactoring Best Practices

Using spacing, brackets, and comments effectively

- [Instructor] In this video, we'll be dealing with spacing, brackets, and comments. First important thing about spacing is formatting conventions, and there's a thing or two I need to tell you about them. First of all, indent. I sometimes come across people that will tell me it's not important, it's not Python. I know it's not Python, but even though it works with poor use of indents, I simply cannot read it as easily, let alone debug it. Do we have all the closing brackets here? Well, I don't know and my brain doesn't want to process it either. We probably do because I don't see any red squigglies. But if I were asked do we have all the closing brackets here? Yes, it turns out we do. And I can see it with just one short look. And then the issue with where to put spaces. The general opinion is to put spaces around the equal sign but not between parentheses and the content that goes in between parentheses. So the top…

Contents