Your grandma probably told you, “Good fences make good neighbors.” It turns out, she was right. Here’s why: Fences keep uninvited guests out of your backyard.

North Waziristan sits astride Pakistan’s border with Afghanistan. The terrain is extremely rugged and difficult for the Pakistan Frontier Corps (the local equivalent of the U.S. Border Patrol) to monitor.

As a result, the region has long been the pipeline via which Afghan smugglers, bandits and terrorists unlawfully enter Pakistan. The lawless nature of the region has prompted U.S. military and diplomatic officials to classify North Waziristan as “the most dangerous place on Earth.”

Pakistan has finally had enough. It’s solution? It’s building 1,800 miles of border fence. You know, the type that American media pundits claim won’t work.

Of course, Pakistan just seems to be copying the highly effective solution employed by its next-door neighbor. India built a 340-mile double-layer fence to keep out bad guys trying to enter its territory from Pakistan.

You see, India has had problems along its borders with both Pakistan and Bangladesh. Those boundaries are marked by long stretches of tough topography that are difficult to police and popular with border-crossing miscreants.

The Indian solution, build a fence. It’s been so effective, India has decided to expand the 350 miles of fence along the Indo-Pakistani border and increase the number of fenced sections along its border with Bangladesh.

On the other side of the world, Hungary built a barrier along its borders with Serbia and Croatia. It was constructed in response to the 2015 migrant crisis. The number of illegal aliens entering Hungary declined precipitously.

So, what about the arguments that border barriers are an ineffective waste of cash or a an excuse for “racism”? Well, it’s fairly safe to say that Hungary spent a lot less on its fence than it did processing, feeding and housing illegal aliens until they were resettled in other European Union countries. And the Indian and Pakistani walls are clearly tactical responses to specific threats, rather than the implementation of supremacist policies.

Perhaps countries build walls for the obvious reason. They work. Good fences really do make good neighbors. Now it’s time for President Trump to fulfill his promise to American voters and build a wall along our Southern Border.