#1: Clear lists
Clearing floating elements is part of the grind for most web developers. We can still get caught out though. For example, how do you clear floated list elements without setting a height? “The answer to this little dilemma is actually really simple,” says Rhys Little of Plug and Play, “Just add the following two CSS properties to any list container with floated list elements.”
display: block;overflow: hidden; If you check the list container now with any DOM inspector you’ll find that the height attribute has automatically been calculated - and that fixes the issue.
If you want to develop techniques, CSS effects or new kinds of transition, for example, do it as a sandbox project. “Keeping experimentation uncluttered by outside influences makes the code much easier to debug if something isn’t working as expected,” says Creative Director Shane S. Mielke.
#3: Web inspectors
Developers differ on which web inspector is best, but they all agree that we struggled before our favourite browsers had them. New Context’s Paul Wilson points out that you can preview CSS changes live in Chrome or Safari. Right click on an element, and choose ‘Inspect Element’, says Wilson, “All the applied CSS will be shown in the right inspection pane. You can edit or add new elements here, to see the effects of your changes.”
The web inspector isn’t accessible by default in Safari on the Mac. Enable it by going to Preferences >Advanced>Show Develop menu in menu bar.
#4: Firebug and beyond
Chrome and Safari have a web inspector built in, but Mike Ballan, Digital Designer at Jellyfish stands by the original Firefox Developers Toolbar. “It’s the perfect thing to detect those little CSS problems when testing your site in multiple screen sizes,” says Mike.
“Firebug has just added the ability to display multiple screen sizes in one browser tab too – which means you will never need to change your browser’s width to test your site again.”
#5: One thing at a time
Ben Howdle, developer of Didlr at wapple.net, says he cannot stress the importance of the Single Responsibility Principle enough. “Every object in your code should have one function. Even with CSS. Don’t put all styles onto a .button class. Split it into .button-structure and .button-face and so on…”
Why? Because if you don’t do that and something breaks, you’ll have a heck of time tracing back through your code, finding which object is the problem – and whether the bug is inherited from higher in the DOM.
#6: Can you code it?
#7: Get Git
If you’re working on big projects, you need a robust versioning system. Many devs swear by GitHub, but there’s a downside if your project is private. Your code is hosted on GitHub’s servers and publicly available. The folks at Plug and Play recommend GitLab.
“GitLab is very similar to GitHub but is completely open source and free to set up on your own servers,” says Rhys Little. “The best set-up for GitLab is to use NGINX with Unicorn to improve performance and speed – but Apache with Passenger will work as well.
“The biggest advantage of this arrangement is that all your code is backed up each time you commit, with a really useful diff viewer so you can see what has been changed on each commitment.”
#8: Commented code
Team workers in particular, remember that other people need to understand your code – use your resources and work through your files. “Don’t be Lazy,” says Shane S. Mielke. “Always comment your code, name your layers and organize your PSDs and FLAs. The more organised your files are the easier it is for you or others to jump in and understand where things are at and how they work.”
#9: Secure your site
Before you go live with a website, be sure to run it through ASafaWeb.com (pronounced A-Safer-Web). “This site, written by Microsoft MVP Troy Hunt, scans ASP.NET websites for a range of common security issues,” says .NET dev Macs Dickinson. “Should you fail any of the tests, it will advise you how to resolve the problem.”
“Don’t waste time deploying or manually running unit tests. Automate it,” says Macs, “Time spent getting to grips with NAnt or MSBuild is time well spent as it will decrease the number of hoops you need to jump through when that deadline is looming.”
#11: Team tracker
The team at Unboxed Consulting use Pivotal Tracker and Pivotal Booster for project management and feature/bug tracking. “There are other tools for this but Pivotal Tracker is a the simple, lightweight options,” the team told us. “We regularly use it to track progress through projects.”
#12: Perfect pictures
Pixel Perfect is a tool Unboxed use for comparison of initial designs with the actual front-end that the development process spits out. “This little Firefox plugin allows you overlay a jpeg version of your designs right on top of the page,” say the Unboxed team. “You can check down to the last pixel that everything lines up!”