4 ms·
Here you go https://github.com/progwml6/Natura/blob/1.7.10/src/main/java/mods/natura/common/NContent.java https://github.com/progwml6/Natura/blob/1.7.10/src/mai
by AnaniasAnanas 7y ago
Here you go https://github.com/progwml6/Natura/blob/1.7.10/src/main/java/mods/natura/common/NContent.java https://github.com/progwml6/Natura/blob/1.7.10/src/main/java...
Tip: If you ever end up in a situation where you have to copy-paste code with minor changes then there is something that you are doing wrong. In this case using arrays and loops would be a much better solution.
- thrower123 7y agoGood god, my eyes, they burn.
- thih9 7y agoBut: avoid premature optimisation, it could lead to overly complex abstractions. Simple, clear structures with little repetition are ideal. Copy pasted data is painful to work with but still relatively easy to maintain and fix. Overly complex and unintuitive abstractions are the most difficult to maintain and improve.
- ilaksh 7y agoBut it's very repetitive code and uses identifiers like "var3" and "var4".
- allenskd 7y agoThe function addShapedRecipeFirst (List recipeList, ItemStack itemstack, Object... objArray) is really doing a number on me... gonna be fun not touching that code for a few months and when you come back you don't even know what the heck you are doing
- pjc50 7y agoThat looks nasty, but surprisingly hard to fix with loops because everything is of different types. If I were fixing it I'd look to some kind of code generation solution, even if just a hacky python script parsing a CSV. (addShapedRecipe is just begging to have ASCII art as its canonical form)
- AnaniasAnanas 7y agoMost of them are of the types button and item though.
- ksaj 7y agoI've never seen so many typographic rivers in source code before. Almost reminds me of a cross-eyed holograph.