Spaghetti Code Principles
This might be relevant to a few projects I’ve dealt with
Highest priority in software is to get the damn thing to work. Fuck organizing code in modules, splitting responsibility, or designing classes beforehand. New features? Add them and shut up. Follow my guiding principles for job security and banging out code in lightning speed.
Multi-Responsibility Principle
Some of us can multi task in the real world and want our code to reflect that. Doesn’t matter whether it’s a class, module, or function, everything can perform multiple actions.
Remember to name things accordingly not to confuse users. I prefer using Boolean conditions in function names so a user can understand how it works.
For example if a function reverses a string then drops the first letter after reversal.
def reverseStrAndDropFirstLetter(inputStr)
Simple to understand.
Repeat Yourself Differently
Sometimes the first stab at a problem doesn’t work out. Try it again, but in a different way. Maybe a copy and paste job is needed because you’re not interested in making the code into a library. Who knows, maybe you need to make a slight change and it isn’t worth the hassle to figure out a single…