I'm new to coding , learning it since last year actually.
One of my worst habits is the following:
Often I'm trying to create a solution that is too big , too complex and doesn't achieve what needs to be achieved, when a hacky kludge can make the fit.
One last example was the following (see paste bin link below) http://pastebin.com/WzR3zsLn
After explaining my issue, one nice person at stackoverflow came with this solution instead http://stackoverflow.com/questions/25304170/update-a-field-by-removing-quarter-or-removing-month
When should I keep my code simple and when should I create a 'big', general solution? I feel stupid sometimes for building something so big, so awkward, just to solve a simple problem. It did not occur to me that there would be an easier solution.
Any tips are welcomed.
© Programmers or respective owner