You will get your best results by doing both. Coursework will give you a better theoretical underpinning and ensure that you have the right breadth, while self-learning will give you more practical experience and allow you to build some depth. Plus, coursework appears on your transcript, and when they ask “can you code?”, being able to point at some A’s in non-required coursework gives you a lot more credibility than saying “yep, taught myself.”
I don’t know. I feel like am minor might not be worth staying an extra semester/year. I might as well just do a master instead.
A minor is NOT worth staying an extra semester or year… that is what we have been saying!! Take a couple of courses when you can fit them in - there are usually one or more light semesters even in engineering, not to mention summers. It will help you to get a job and help you get into a grad program.
But yes, a masters is a thousand times better than a minor, just be aware that grad degrees tend to lock you into a certain field until you replace them with another degree or significant experience.