When I was in middle school I had really hard times to hold it. Some food just makes me farting so badly. I dried to do it noiselessly when passing some crowd, so that others won't know whom to blame. But sometime it was really hard in class. Especially when It happened to be a really noisy one.
I think it depends of situation, if it's possible don't do it and if it's possible don't do it in not well ventilated tiny room.
I did it once so loud in class, that I shade my heart almost to stop. It was like gun shoots.. First everyone Laugh as loud like wet own pants, but when the "gas" reached to them... well if class didn't had huge windows, it would be very likely that I could not be with you here now.