The Code, Sec. 3802, confers on every town and city the power “to pass laws for abolishing or preventing nuisances and for preserving the health of the citizens.” Under such authority the Board of Town Commissioners could forbid the keeping of hog pens in the town to such an extent as they might deem necessary to prevent nuisances to the public, and, indeed, they could have done so without this express authority. 2 Kent. Com. 340; 1 Dillon Mun. Corp. (4th Ed.) Sec. 369. In a thickly settled town, the town ordinances usually forbid the keeping of hog pens altogether, not because they may be injurious to the owner of the hogs but because they are nuisances to the public. In a less thickly settled town, as King’s Mountain, a prohibition of hog pens within one hundred yards of another’s dwelling may be a sufficient protection against a nuisance to the public; of that the Commissioners, the local legislature, are the sole judges (Hill v. Charlotte, 72 N. C., 55) unless their ordinance is unreasonable. In the more thickly settled parts of the -town the prohibition of a hog pen within 100 yards of the residence of another will be a prohibition of keeping hog pens altogether. The object of the ordinance is not to prevent a man from injuring himself by keeping his hog pen too near his own house, for that is a matter he can remedy at will, but to protect the public against a nuisance which they have no power to prevent except through the authority of a town ordinance acting on the offender.
A nuisance is to the public, or to others, and not an injury or annoyance which a person causes to himself and family. It is an anomaly that the defendant, who has disobeyed the ordinance forbidding him to commit a nuisance upon the public, should be complaining that the town did not go further and forbid him being a nui-*1095sanee to himself. He could refrain from that without official help.
There is uo discrimination in this ordinance, for it forbids all citizens alike from keeping hog pens within 100 yards of the residence of another. The learned counsel of the defendant, however, frankly admitted that it is not every discrimination which would make a town ordinance invalid and that this would be the case only when the discrimination is an unreasonable one. State v. Call, 121 N. C., 643 (at page 648); Slaughter House Cases, 83 U. S., 36.
No error.