I have been working on various Raspberry Pi based projects at our local Model Town for over three years now and have always produced non-OOP code. This is partly because I'm an 'old-fashioned' programmer, partly because I was never really a programmer anyway (I was a Systems Engineer before I retired) and partly because all of the projects required embedded routines (if that's got anything to do with it).
Anyway, for the current project the team, until recently, has been larger and my role was confined to requirements capture, overall system design and some hardware design and construction. All of the code was done by another Volunteer. However, this guy has now moved on and is temporarily unavailable to respond to questions, so I thought that I'd ask this one here:
In a device which consists of a Raspberry Pi Zero, a motor Drive Board and an A/D converter is there still an advantage to be gained by writing the code as Object Oriented Python?
The device is a motorised Gate Valve in a water pipe and the code to control the motor and read back the valve position, will be running in a thread, but apart from that no other code will be running in that Pi (every Gate Valve will have it's own Pi). The author of all the code on this system to date has used OOP and I know I will have to write some OOP code going forward; to support new sensors and other devices where there will be lots of bits of code running on a single Pi. In this case however, any GateValve Class that I wrote would only ever be instantiated once, so it seems a bit pointless.
Or is it?