@elamberton said:
Looks like a case of programming by coincidence. The developer hacked on it every which way he thought it made sense,and when it finally worked, he left it alone. Code reviews can eliminate this kind of sloppy programming.
However, your boss:
- probably wrote this code.
- may think this is the way you're supposed to program.
- may think you're trying to undermine him if you bring this up.
Yeah, I worked for a guy like that.
He thought anyone with a copy of "Learn PHP in 24 hours" was a qualified programmer. He also gave up on hiring because he couldn't find any programmers in california willing to work for $30k a year (no benefits) -- this was after hiring 4 guys in the span of half a year who he terminated within a month after they displayed complete incompetence. He did manage to find one competent guy willing to work at that rate, but refused to give him a raise, so he left for a job that payed twice as well.
I stuck around because I needed to rack up some experience (it's easy to get a job if you have professional experience, or a degree. I had neither, going into it), and because he actually paid me an almost-decent salary.
I eventually got sick of working in that environment, so, in hopes of replacing me, he gave one of the customer service reps, who had no programming experience, a book on PHP, and told him to start reading.
Not sure how that worked out for him.