I used to live in Wheat Ridge, Colorado. As the name implies, before Wheat Ridge was a suburb of Denver, it was named after the abundance of farmers in the area. My dad and grandparents lived there when you could still see cattle or horses on in some places. The local high school's sports team is even named "the Farmers."
So there was something romantic about having the one of the last farms in Wheat Ridge right next to my neighborhood. The owner was too stubborn to sell until a couple of years ago, because the city had no means of forcing the sale of the land. Despite the nostalgia, everyone pretty much hated the farm because it dragged down land values and contributed little tax income to the city compared to the ~40 or so houses that are now replacing it.
In my view, agriculture seems to work against the interests of an expanding suburb or city, and shouldn't be encouraged if it has a negative impact on surrounding homeowners.