In the UK, the government has taken the view that in some sense, yes, some contractors who were claiming to be self-employed were in fact employees and therefore have to pay more tax (the same tax as other employees), and can claim fewer expenses against tax (also the same as other employees). The underlying principle is equal treatment.
There is no advantage to the individuals from that decision, nor is there any intended.
So people spending 5 years working for the same company doing the same commute and same work as employees, subject to the same kind of control over their work etc., cannot maintain a claim to be self-employeed for the tax flexibility that goes with that.
However. You "writing code" as a contractor is not the same work as an employee if the manner in which you are doing it differs.
For example, if you have to purchase your own equipment, set your own hours, work on a "statement of work" basis instead of set hours, can substitute a subcontractor to do your work for you, and can and sometimes do work for multiple companies at the same time, and often switch the site at which you are working, those sorts of things signify that you are not operating as an employee would, and that it would be correct to classify you as running your own business and therefore subject to business taxation instead.
Of course every contractor wanted to claim that status for the tax benefits, which are basically less income tax and the ability to deduct more expenses. The government saw this and decided, although the law was what it was all along, people weren't applying it adequately. So they changed who does the assesment, and the tax liability if they get it wrong, from the contractor to the company hiring them. This is called the IR35 reform; IR35 is the name of the legislation that sets out what kind of working patterns must be treated as employment for tax purposes.
Although the reform will change who is liable for making the assessment, in principle it is still possible for a contractor to be retroactively assessed for their past as having been an employee all along, and have to pay back-tax. That's because you are supposed to have done the right assessment for yourself already, or perhaps your accountant should. This seems unlikely for most people now as long as the changes are followed through, but some people have been caught out by it.