hando Posted February 8, 2013 Share Posted February 8, 2013 Hey guys, I'm not working that long with this nice eCommerce software, but it's kinda cool and I hope it's getting better. For that purpos I want to suggest some things ... Note: all the things I'll say should be noticed in a positive way. I don't want to hurt someones feelings or something But here we go ... Style Guides Why not? Some rules can't be that bad. I'm currently developing another theme for a customer and everytime I'm looking at the CSS files, it's crazy when I see something like #availability_statut span#availability_label { ... } Why such CSS code? The specificity is unnecessary, IDs aren't a good practice (excepting for JS Hooks) and the use of the span isn't that good, too. There are other examples that are worse, but I think you'll get the point :-) What can we do? For example: defining a global style guide for coding CSS, or use a framework. Some examples in particular: stop styling elements, use classes: .foo h4 {font-style: italic} -> don't do that .myCursiveTopic {font-style: italic} -> better, you can use it everywhere [*]don't specify elements: div.foo -> don't do (span.foo isn't possible) .foo -> do, because higher reuse (element independency) [*]avoid IDs: #availability_label -> don't do (ne reuse possible) .label -> do for reuse Of course, there are many more, but you have a clue Best Practices / Standards If you've every used a blog software ... let's say ... ehm ... WordPress ... there are some Coding Standards everyone complies with the formalities. For example: JavaScript - there are several best practices all over the web, e.g. pattern for developing plugins and so on; SPOF in generell, e.g. blocking download of CSS download when using conditional comments for Internet Explorer ... The Impact What would be the impace? Hmm ... consistency and if we're doing it right: a higher performance (less code by benefiting from code reuse -> smaller files, less requests ...). And probably a higher learning curve. The documentation for PS 1.5 (and 1.4) is showing how to customize things, programming own modules and other stuff. Why not in a consistent way? I'm looking forward for your (hopefully positive) responses Link to comment Share on other sites More sharing options...
Recommended Posts