What I haven't seen mentioned in the answers above is the following.
Using the builder pattern makes for cleaner code.
Cleaner code
Say you've created a library which exposes a POJO that's essential to the function of your library. The constructor of that POJO has one or two parameters which are essential. Now for a new feature that POJO needs another field that is essential.
If you're not using the builder pattern you will need to add another parameter to the POJO's constructor.
Constructor nesting
To maintain backwards compatibility you will probably add a second constructor with three parameters and have the first constructor call the second constructor with some default value for the third parameter.
Something along the lines of:
constructor1(x,y){constructor2(x,y, "default")}
If you add a parameter a few times you will have a bunch of constructors you will need to maintain, have reduced the readability of your code and it makes for a confusing interface to someone who is new to your code-base.
Be gone constructor nesting!
If you use a builder, each time you want to add a parameter to the constructor, you simply add a method for said parameter and you're done. No clutter, easy to maintain and since it follows a specific pattern a new team-member will get the gist of it quite fast.
Don't use it for clean-code alone
Of course this doesn't apply when you don't expect the constructor to change. Which is quite the assumption but it's possible. So I would suggest that you look at the reasoning mentioned in the other answers first when you're considering the builder pattern.
Builder pattern as a sign of over-responsibility
Most likely if you're using the Builder pattern you've got a large amount of fields in your class. Meaning you may have added to much responsibility to that particular class. So you could also consider looking at the parameters you're passing. Whether you use a few of them in conjunction and if you do, create a new class that's responsible for handling any behaviour associated with those parameters. Then simply remove those parameters from the constructor and pass an instance of the new class to your original class [1] .
There are down-sides to this but at least you've cleaned up your code and avoided introducing the Builder pattern needlessly.
TL:DR;
- The builder-pattern cleans up your code by eliminating the need for constructor-nesting.
- See if you can't introduce a parameter object before you introduce the builder pattern [1]. As wanting to introduce the builder pattern may be a sign of to much responsibility in one class.
- Don't introduce it just because "it's cleaner". It is. However, a constructor can be just as effective.