You have to admire the Buffalo school principals who started much-needed after-school programs on their own, without waiting for funding to be finalized. Unfortunately, the district pulled the rug out from under five of those schools by canceling their programs.

The students themselves are again on the losing end of a deal that will save the district money in the short term. But what are the long-term costs?

After-school programs enhance education by reinforcing what students have learned during the day. At least that was the intention of Say Yes when it proposed after-school programs at 28 schools.

Buffalo School District leaders have long pointed to the importance of extended learning time for students. But that level of support isn’t cheap.

The original Say Yes plan envisioned after-school programs in the 28 schools five days a week for two hours a day starting last October. Then questions arose about how to pay for the programs, which would have cost the district $14 million.

Say Yes and district officials devised an arrangement to fund the Say Yes programs at eight schools, which would have served, at most, 5,665 students instead of the original 9,300.

Funding for the programs was not finalized until late January, but some schools launched their programs in the fall in an effort to give their students as much help as possible.

Now five of those programs – at schools deemed to be in good standing – have been shut down. That not only shortchanges the students, it forced some parents to scramble to find alternate care for their children.

District leaders and Say Yes chose to use the available money to fund the programs at schools with the highest needs.

This latest development is just another shot of discouraging news, especially for Say Yes. The organization had hoped to mirror its efforts in Syracuse, where Say Yes greatly expanded after-school programs in the last few years.

After-school programs being paid for with special grants will continue at 17 other schools. Figuring out how to help the rest won’t be easy. The district faces a big deficit this year, and a bigger one next year.

One contributing factor is the district’s expensive contract with the teachers union, which expired a decade ago. The union is in no hurry to negotiate a new one. That’s because under the terms of the Triborough Amendment, most teachers continue to receive 2 percent-a-year step pay increases and retain their generous benefits package. Teachers do not contribute to health insurance, nor do retirees, in any meaningful manner, and those costs continue to escalate.

After-school education is important. District officials should take one more stab at seeking funding from local, state and federal sources. Such grants could allow the targeted programs to reopen and give district officials and Say Yes a chance to regroup for next year.