I do a lot of programming and it definitely has its difficult aspects. Objective-C can feel like proprietary garbage, Eclipse is sometimes the ugliest, hacked together piece of software I’ve ever used, and 70% of the time CSS is a guessing game. We’ve all been there. But as a college student and a guy who gets hit with a lot of miscellaneous work, this is just the beginning. The hardest aspect of the job is digging through other developer’s code. Developers who don’t understand formatting, file structure, and naming conventions. Developers that don’t concern themselves with reusability. Whether I am working with code from former interns or a client’s website developed through someone else that we inherit, trying to figure out the previous programmer’s code can be a time consuming task that is fully preventable. Someday, somewhere, someone who isn’t you is going to have to play with your code. So the next time you find yourself opening tags, consider these tips for us miscellaneous task guys.
Meaningful names
Nothing is more frustrating than a
Comments
Your HTML and CSS don’t need this so badly, but if you’re a high-tier PHP and Javascript programmer, a few comments never hurt anyone. A nice little comment explaining your ternary operator can save precious time for the client’s bill.
File structure
Even if you’re using a static site, there are some industry commonalities you can utilize to make things pretty. Your Javascript? Put it in a folder called “js” and, even better, put it all in a file called “scripts.js.” You don’t need a new folder for every page on your site, and it can help the look of your site to stick to at least a standard header and footer that can go in separate to be included on each page. CSS goes in the root folder as “style.css.” The only exceptions to any of these rules are plugin files.
Images versus Text
Your code and your site should be prepped to adapt. If you want me to add an item to your navigation menu, I’d be happy to, but if all of those items are represented by an image instead of formatted text, it’s going to be a pain. Most people keep the Photoshop template sitting around so a new menu item can be generated pretty quickly, but not always. If it’s gone, we have to trouble a designer to replicate it (I know I sure can’t). Not only that, but any image of text you have on your site in general isn’t contributing to your SEO. An image is an image is an image as far as Google is concerned, and it does nothing for your site unless it is accompanied by an alt tag. Your logo and headers are going to rack up way more hits if there’s actual text for search crawlers to index.
Clean up after yourself
Finally, there’s the messy coder. Don’t get me wrong, when you’re making changes to websites, you have to have backups, but when everything is said and done, get rid of them. Getting rid of a photo? Delete it from the web – save it locally. Get rid of those botched themes and “index-new.php” files you were testing on. Leave no ambiguous hyphens or underscores. I’ll make my own if more testing is needed, don’t worry.
People prefer developing for iPhone over Android because it’s more uniform – one device, one coding standard, and Apple will deny you if you don’t get it right. Applying this to everything we do – keeping everything uniform and ready for any changes or alterations in the future – can help the web scene similarly friendly for developers – and not just you, but the intern behind you.