My company (small, about 40 people across 3 offices) occasionally does "developer workshops" online where one of the devs hosts a presentation about some tech topic. It's not necessarily about our work, but just to help everyone improve their skills and understanding.
I've been asked to host the next one, and the topic (chosen from a list I provided) is code style and design patterns. I know those things aren't that closely related but bear with me. I have seen many places in our code base that could be improved, some which may even qualify for DailyWTF, so I want this presentation to be as effective as possible. The problem is that I just don't know exactly what to cover in one hour.
My first idea is to use our own code as an example, to drive home the point of "please actually apply this to your work." But the topic is so broad.
Some things wrong with our code (PHP) include:
- Minimal OO. It's been improving lately, but there are still tons of global functions. It takes me a while to find things.
- Global config (opinion I guess). You can find $GLOBALS['blah'] scattered in just about every file.
- Inconsistent brace style. Sounds minimal, but this actually caused a syntax error to be pushed to origin five days ago, which still wasn't corrected as of yesterday.
- Inefficient constructs. I was able to do some basic improvements that cut running time in some areas by 70%.
I want this thing to be as useful as possible, without sounding condescending to my coworkers. So what aspects of "style" should I focus on, and which design patterns might be most useful to explain?