There are certainly disadvantages. For a start, it keeps freezing my VS code :D
But Modders also have a hard time adding features if logic for all items is in a single function. This seemed exactly what OOP / interfaces were designed for.
Also I'd love to see Terraria's actual source code. The de-compiled versions hat a ton of stuff like
> else if ((int) Main.tile[i, j].type == 19) Type = 94;
20x in a row, with obviously different numbers. Hope the actual code was more readable and just lost a lot in translation. But many more readable styles should be visible in IL (enums, constants, etc). There might also have been some obfuscation (can't remember), but couldn't have a strong one since names were preserved.
But yes, there are also advantages to their style of code. And in the end they delivered a product and that's all that counts.
But Modders also have a hard time adding features if logic for all items is in a single function. This seemed exactly what OOP / interfaces were designed for.
Also I'd love to see Terraria's actual source code. The de-compiled versions hat a ton of stuff like
> if (num1 != 109 && num1 != 110 && (num1 != 113 && num1 != 115) && (num1 != 116 && num1 != 117 && num1 != 118)) return;
or
> else if ((int) Main.tile[i, j].type == 19) Type = 94;
20x in a row, with obviously different numbers. Hope the actual code was more readable and just lost a lot in translation. But many more readable styles should be visible in IL (enums, constants, etc). There might also have been some obfuscation (can't remember), but couldn't have a strong one since names were preserved.
But yes, there are also advantages to their style of code. And in the end they delivered a product and that's all that counts.