The Wise and Foolish Builders (again)
Matthew 7:24-27
func House BuildOnRock(floors, bedrooms, bathrooms)
{
Guard.NotNull(floors)
Guard.InRange(1, 4, floors)
Guard.NotNull(bedrooms)
Guard.InRange(1, 12, bedrooms)
Guard.NotNull(bathrooms)
Guard.InRange(1, 12, bathrooms)
return new House(floors, bedrooms, bathrooms, foundation: rock)
}
func House BuildOnSand(floors, bedrooms, bathrooms)
{
return new House(floors, bedrooms, bathrooms, foundation: sand)
}
> house = BuildOnSand(1, 0, 0)
> PROCESS TERMINATED - FATAL ERROR: ValueOutOfBoundsException(0)
Just like the Bible, this wasn't written to be kept to yourself.
Please consider sharing this with anyone you think would appreciate or benefit from it. twitter | facebook | LinkedIn | WhatsApp | reddit | email