In 2018, it's been 10 years since I graduated Czestochowa University of Technology, becoming M.S. Computer Science. I don't regret it. There is endless debate among programmers about whether it is worth studying at some university or is it better to start professional career as early as possible and become fully self-taught specialist. Below is my personal opinion about this. (A little disclaimer: my views may be biased because my father is a professor of electrical engineering, so I had lots of contact with the scientific world since my childhood.)
One concern that arises often is the significance of having a university diploma for potential employers. From my experience, I would say that while formal education is not necessary for getting a job as a programmer, it may matter for some companies. It's important especially at the beginning of the career, when there is not much in your CV, because after many years of professional work the education takes second place after work experience. Smaller companies may favor skills and experience in specific technologies and don't require a degree too often, because they want to find an employee who can just start doing his tasks right away. Big corporations may prefer candidates with a degree because they look for talented people who can learn required skills after they are hired, plus they often have extensive HR department with people who are nontechnical and filter incoming CVs just based on keywords and simple criteria, like being a university graduate.
Another frequent question is whether the knowledge taught at the university is practical. Surely there are many courses teaching specific topics that you may never find useful in your career. Surely there is also much you will need to learn in each workplace that was not covered during the studies. It's true that software technologies evolve fast, so what you learn now may become irrelevant in few years (although not always - e.g. C has more than 40 years and it's still the 2nd most important programming language). But I think that studying gives more than just practical knowledge useful for future job, or a diploma.
1. It gives you theoretical basis. While you can learn a new programming language or a framework from a book or some materials you find on the Internet, it's not that easy with more theoretical subjects like algebra, calculus, physics, algorithms and data structures, electronics, digital signal processing etc. Would you spend long time learning these on your own, rather than focusing on something more practical? I bet most people wouldn't, while having some theoretical foundation is essential when you need to understand some practical subjects, e.g. how velocity is a derivative and acceleration is second derivative of displacement with respect to time, when programming a car simulation game.
2. It teaches you a bit of everything. For example, if your professional interests involve systems programming and C, or data science and Python, you probably prefer to deepen your knowledge in this area rather than learning about something that is less interesting to you. At the university you have to get at least some basics of various subjects, whether it's web development, databases, computer networks and security, computer hardware, operating systems and shell scripts etc. Each of these subjects may turn out to be unexpectedly useful someday, and the basic knowledge will be a good starting point for learning more about it when necessary.
3. It teaches you, and proves to others, that you are able to carry out and finish a large project. That's an important skill on its own. There are many visionary-type people with their heads full of new, high-level ideas, who start something new every day, but never finish anything, because they find it boring or too difficult to do the actual work. There are also those over-thinkers who theorize and plan everything in smallest details, but never even start doing. These are not effective employees. At university, every course is like a project. Passing exams of every semester is like a project with strict deadline. Finally, writing thesis and graduating is also like one, large project. It may be your first such big and successful accomplishment and a good start for challenges that await in your professional work.