How to Write HTML, CSS, and JavaScript to Make Back-End Developers’ Work Easier

csshtmljavascriptjquery

When I get a design from a designer, I get it as a PSD (Photoshop) file. I always expect proper layer and folder names, basically a clean and managed PSD. From this desigbn I develop HTML, CSS and JavaScript and deliver it to the back-end developers. To make it easy for them to understand, I

  • write semantic code,
  • keep JavaScript and CSS in external files,
  • add useful comments in HTML, CSS and JS files,
  • use CSS sprites (though developers don't like it),
  • use HTML5 boiler plate,
  • use jQuery for JavaScript,
  • try to use new HTML5 tags and CSS3 whenever possible and
  • sent a Zip file containing the HTML, CSS, JS and images.

I expect that if small changes will need to be made to the layout, the developers can handle that.

I would like to hear from back-end developers and other CSS ninjas what more one could do in terms of organization of files and mark-up to make the integration with back-end systems easier (i.e. back-end technologies, PHP, .NET, Ruby etc.) Different client uses different systems.

Best Answer

A lot of these answers are going to cover the broad swaths of ideas, but here's my personal ones:

  • Leave room in the form design for error messages.
  • Don't put labels in the input boxes!
  • Put your CSS and JavaScript in a separate file, unless you know what you're doing and feel properly bad about it.
  • Keep design elements the same between pages. It's infuriating when a design component (like a "recently viewed" box) has different markup on every page.
  • Don't do what's easy for you, do what's right. <button> tags suck. backround-image for things that really should be <img> tags suck.
  • Make sure that if you're creating a page component, it can scale. I know most good front-end developers do this, but I've had plenty of instances where someone used a single image in what should have been a top/bottom cap situation. Programmers don't like opening up Photoshop.
  • Proofread your templates. Programmers (good ones) are dedicated, detail oriented people. If they start seeing issues in your design (maybe the footer navigation has spelling errors or inconsistent spelling) it's going to make them ask questions and slow down their work.

Finally, and maybe most importantly:

  • Learn the basic conventions of the language that is being developed in the back-end. Being able to look at a PHP template and understand the basic syntax behind a foreach or an if statement and how to format an echo statement or move a <?php ?> tag around will greatly increase your value as a front-end developer - I love when a front-end developer needs to make a simple change and can do it in the template instead of handing me a new zip of all of their files.
  • As an addendum, learn to use version control software. You don't need to be an expert, but if I can look at a diff instead of having to try and figure out what changed between two zip files it makes my job a hundred times easier.

Those are just a few - I'm sure there are many more, but if you accomplish all of these you're sure to earn the respect and appreciation of whoever is turning your templates into a web site.

Related Topic