At some level, anything that works is ok. But this is like a house of cards waiting for a tiny breeze to knock it down.
Here's an analogy. Suppose the screw came of the cold water knob in your shower so you couldn't turn on the cold water anymore. The "right" solution is to find a replacement screw of the correct size and a screwdriver and fix it. But you could put the nozzle on the garden hose, run the hose through the window and into the shower and duct-tape the nozzle beside the shower head. To take a shower, just adjust the nozzle for the cold water and the still functioning hot water valve to regulate the temperature and if the spray pattern of the nozzle and the shower head are sort of the same, you'd have a nice warm shower. As long as you didn't get towards the edge of the spray where the nozzle and shower head patterns don't match too well. Or somebody turned off the garden hose. Or the duct-tape gave way because it got wet, scalding some parts of your body and freezing others.
Probably best to fix the shower the right way, before you trip over the hose. And probably best to UNDERSTAND the program you're trying to write and the fundamentals of the language you're using.