@houqez As someone who is currently in a very similar situation to you I will give you my 2c.
This first thing you need to do is clearly look at what you are considering.... Most things in life are romanticised from the outside but once inside it reveals a bunch of caveats that you did not consider or see at first and by then you have 2 choices, cut your losses and move on, with a lot of time and resources wasted, or you have to suck it up and continue doing what you dislike because you are already invested in it.
So programming might seem very attractive at first, I mean... We have a huge shortage of IT skills especially relating to programming in South Africa, this leads to software developers getting paid lucrative salaries while at the same time enjoying loads of company benefits. Just google and you will see to be a software developer in JHB will give you some of the highest living standards in the world (including an extremely high, if not the highest purchasing power, due to SA's relatively low living costs). Now there is another factor relating to purpose... Being a developer sounds super cool because you can literally type a few words on your keyboard and literally create anything right? Some if not most people are attracted to the culture as well. Also because IT is still rapidly growing and most countries have a lack of skills in that field it would almost certainly guarantee you of a job easier than if someone with an Economics degree were to apply for a job in a foreign country (with the added benefit of freelancing work opportunities and being able to work remotely).
But once you are there some caveats can reveal themselves... If you look at the stats very little new code or applications are actually written in South Africa (where are the Facebooks, Instas, Twitters, Hyrose, Salesforce CRM, Zoho, Zoom ect. of South Africa?). If you PM I will send you some articles on the reason for this, but in short SA has a very bad IT infrastructure when it comes to building new things (this includes the laws, tax incentives, lack of investor trust and lack of skills and some would argue a lack of market demand as whole). Drawing from experience, research and public opinion it is easy to see that most companies involved with software in South Africa, take existing software and edit it to fit the needs of their customers. I learnt this only when I started working and it was a real downer for me as I draw most of my motivation to work from purpose (which is drawn from building new things and solving hard problems), instead of a monthly salary being my primary objective.
This leads to you (if you aren't in a managerial position) spending 90% of your time as a Dev to find bugs and to try and fix other people's code which in my opinion is the most soul deadening thing you can do... (Imagine it as how fun it would be writing a book vs. spell checking a book).
So to get back to your previous question it all comes down to what you WANT to do. Asking "is it worth it" makes me believe that you have little experience in coding and that is where I would start. Watch some Youtube vids on people coding, read some Quora answers on how back end, front end, web applications and mobile applications work and how they all integrate with one another. Things have changed drastically since 14 years ago and how are you sure you can still like the way they are?
I would also like to comment on your intention to study further and to get your PhD. Please only do this if you love Business Management or the Bcom field as a whole, if you want to further the research in that field, or if you intent to apply for a job overseas. Having a PhD in South Africa can, counterintuitively, make you unemployable since you will be over qualified for our market. very few companies want to or can afford a PhD graduate and since you already have work experience more so. My Neighbour has a PhD in Economics and is pretty much restricted to doing affiliated consulting with the University of Pretoria, or becoming a Professor. Please also note that Gauteng is the Heart of our countries economy and that Cape Town is more of a lifestyle destination than anything. Work in the IT sector is extremely limited that side unless you work remotely for a company based in Gauteng or if you take on a consulting/support role.
In the end I believe programming in any form is still "worth it" and the closest thing we have to magic.
My advice would be to start learning Python. Developers are expensive and computing power (and severs and connectivity) costs are cheap.
This is why Python is quickly growing in popularity as it supports tons of libraries and plug ins, and it is also a much easier language to learn and debug, which cuts development times considerably, compared to your legacy languages like Java, PhP ect.
I would stay away from institutions to learn coding, since in my opinion it would be a waste to pay for something which you can literally find and learn for free online.
Good luck and all the best!