If I have to write a simple program (25-35 lines), should I divide it even further, in functions which have a few lines and get executed max. 2 times, or to put it all im one?
e.g. if I need to add and substract 2 angles, should I do everything in one function or write one which converts everything back (and forth) and one which does the actual adding/substracting, leaving main with only I/O (extra: should an angle be defined as a structure or to stick to ints, assuming it isn't used anywhere else)?
My reasoning is that the code is clearer and that I find it easier to write as well, but apparently some people find it unnecessarily long and too complicated. I'm looking for "the right way", preferably examples or experiences from job interviews. Obviously large real-world applications need to be modular, but what about script-like or programs that focus solely on one algorithm?