Comes down to why.
If you want to learn to code so you can build something, you don't need a degree at all. Start with freecodecamp.org or something similar and work your way up.
But if you want to be employed as a software engineer, a college degree might be useful. I say "might be" because what I consider great companies to work for care more about your attitude, skills, and accomplishments (personal projects are fine, too) over academics. Plus, you can invest those 4 years into learning at your own pace and become a terrific coder.
Hope this is useful. 🖖
Confession: I've tried and given up too many times, but I keep coming back. Did end up making a useful Chrome extension in the process, so it wasn't exactly a waste of time. I've got so much more to learn though.