Error!
Success!

How to write unmaintanable code - anti patterns

0
kicks

How to write unmaintanable code - anti patterns  (Unpublished)

Let's get started : Be Abstract In naming functions and variables, make heavy use of abstract words like it, everything, data, handle, stuff, do, routine, perform and the digits e.g. routineX48, PerformDataFunction, DoIt, HandleStuff and do_args_method. Abstract notions : Programmers are lulled into complacency by conventions. By every once in a while, by subtly violating convention, you force him to read every line of your code with a magnifying glass. You might get the idea that every language feature makes code unmaintainable — not so, only if properly misused. Naming conventions seem to be a mantra : Bedazzling Names Choose variable names with irrelevant emotional connotation. e.g.: marypoppins = (superman + starship) / god; This confuses the reader because they have difficulty disassociating the emotional connotations of the words from the logic they’re trying to think about. Reuse of Global Names as Private Declare a global array in module A, and a private one of the same name in the header file for module B, so that it appears that it’s the global array you are using in module B, but it isn’t. Make no reference in the comments to this duplication. Something that I thought people should go to jail for : Overload new Overload the “new” operator - much more dangerous than overloading the +-/*. This can cause total havoc if overloaded to do something different from it’s original function (but vital to the object’s function so it’s very difficult to change). This should ensure users trying to create a dynamic instance get really stumped. You can combine this with the case sensitivity trickalso have a member function, and variable called “New”. ... If by now you are not convinced that this is an article worth reading I assure you the samples shown by me here don't cover more than 10% of the material there.


Kicked By:
Drop Kicked By: