The variable g.tabwidth can be changed from the default value of 2 (which is suitable for publication) to some other value (such as 8) with a command like @g.tabwidth = 8.
You can, and sometimes must, generate tabs in code files. For example, tabs are required in 'make' files. You can do this in many ways, for example by implementing a front end for a tangler that replaces leading spaces, or perhaps \t sequence, by tabs.