There comes a time in every programmer’s life when they must face the hard truth. Your code sucks.
May be no one has told you this because they are just being nice so as not to hurt your delicate feelings. But are they really helping by not telling you? Do you think it’s time for some tough love?
A few weeks ago I was watching “Steve Jobs - The Lost Interview” He was interviewed by Cringely in 1995. Steve Jobs is on record telling people “Your work is shit”. What does he mean by that?“Uh, it usually means their work is shit. Sometimes it means, ‘I think your work is shit, and I’m wrong.’ But usually it means their work is not anywhere near good enough.”
– Steve Jobs
The key point here is not anywhere near good enough. How many of us (programmers) wish we could work for companies like Apple, Google, Microsoft etc.? Assuming Steve Jobs himself interviewed you, would he say “Your work is shit”?
1 Warning: Your code looks like it has been scribbled by cats
Your source code lacks white space. You do not use single lines to separate logically related units of code. More white space means improved readability.
2 Warning: Your code is over commented
But the lecturer said we should comment the code? Did he say you comment the method named connectToDB //this method connects to the database? I didn’t think so.
3 Warning: Your logic is over complicated
In an attempt to show off your complex problems solving skills. Mark, just because you can do that doesn’t mean you should do it. Find the simplest solution possible then do it.
4 Warning: Your files and folders organization resemble Spaghetti.
You fail to properly utilize packages / namespaces. You create a package for classes and dump your forms and other projects in it. You have all of the 156 files in the root of the project. You do it as if you have something against creating folders named appropriating and putting the files in them.
5 Warning: Your code lacks unit tests
The modern office requires you commit code to the repository. Remember, anything you commit to the repository can and will be used against you in a blamestorming meeting. Unit tests will help you figure out what is wrong quickly before you commit the code.
The bottom line
How can you know for sure that your code does not suck? 11 Tell-tale Signs Your Code is Readable and Maintainable