If we want a method that draws a star, a good name would be star . While it may be fun to pick names like bonkers to represent a method like isAtSchool , our code will be hard to read since it's hard to remember what the name stood for. That's why we should always give names that are meaningful. Other people should be able to read our names and understand almost instantly what they stand for. Use methods to give names to meaningful sequences of events We're writing a lot of code involving conditionals in this problem set.
Programming is an art.
We don't want to overdo creating methods, but we need to be willing to use them when it will greatly help our understanding of what is going on. Let's say we have a picture which involves a buggle drawing lines in all sorts of directions. However, it is better to capture the pattern involved in drawing a line into a method and to use that method in our run method. So, our new code will create a method line which we will use. By capturing the pattern in a method, it allows us to easily create the pattern over and over again without having to write lines of code.