The last poll around here was:
How many people touch the CSS in your current main project?
Defined as:
- Actually author and edit it.
- Or, are an active consumer of it. You/they write HTML and use the CSS available thus have a vested interest in the actual CSS, not just the outcome.
My desire with this poll was to get a sense of how shared CSS is. Is CSS the kind of code that is generally in and out of a lot of different peoples hands and heads? Or is it more intimate than that?
The answer: the vast majority of CSS is handled by a small number of people. Here’s the breakdown:
See the Pen Chart for How many people touch the CSS in your current main project? by Chris Coyier (@chriscoyier) on CodePen.
Over half of the almost 32,000 of you (56%) say that only you touch the CSS on your main project. Another 19% say that just two people touch it. That’s just ahead of small 3-5 person teams with 17%. Medium 6-10 person teams make up only 3%, surprisingly a slightly smaller number than huge 25+ person teams at 4%. The smallest chunk was large 11-25 person teams at only 1%.
Breaking it down another way, just about three quarters of CSS is only touched by one or two people. Add in small teams, and 92% of CSS is touched by 5 or less people.
So what is to be learned here? Well, like all one-question anonymous non-scientific polls, probably not much. What motivated me to do the poll was to get a sense of exactly what I asked. How many of you CSS authors out there are collaborating on the very CSS files themselves, and to what degree. When someone asserts that CSS must be written such that anyone can jump in and work, how true is that? Are style guides and elaborate comments an overall best practice, or only appropriate sometimes? Are your weird CSS writing habits OK if you are a loner? Or will you suffer? Are team-oriented best practices too slow?
I don’t have the answers. But it’s interesting to see how generally-few people touch CSS overall.
It certainly would be interesting to compare that to other kinds of code. There are typically way more back end developers at companies, right? Does that mean the teams are larger and more people are in and out of their code? Does it vary by language?
New poll tomorrow.
To me this is in great measure due to the natural ability of CSS styles to bleed all over the website. CSS people (specially casual users) are not used to think in modules, and therefore touching styles means altering many things in the project, which is scary and chaotic.
Web Components (or any other technology which allows sandboxing styles) will help us overcome this mindset, and start thinking of CSS in terms of “components”, which will make it much more maintainable, and therefore more people will dare to go boldly towards it.
Of course, this is just my gut feeling.
One big comment to keep in mind is visitor bias. Freelancers/contractors/hobbyists are much more likely to be 1-2 people working in CSS. In my (obviously anecdotal) experience first at agencies and then startups in Silicon Valley, there’s always been a lot more people involved.
Agencies have teams who works in series or parallel on the same project; larger agencies often have separate teams who all work on the same project (team 1 does project 1, team 2 does project 2, etc).
Startups usually have a mix of engineers, and especially in the early days everyone wears multiple hats, so back-end guys are writing CSS and front-end guys are writing routing logic & DB queries.
The startup I’m currently at has around 25 people total working, with me being the predominant front end guy, another 4 engineers touching CSS semi-regularly (at least a few times a month), and a designer and Content/Marketing team adding another 6 who make use of the CSS classes for either the styleguide (in the designer’s case) or when creating CMS based pages.
Again, I know it’s very anecdotal and I’m in the minority, but the situation has been very similar in the last few places I’ve worked.
I think it’s important to keep in mind not just current collaborators on stylesheets but future members of a team, whether that means on-boarding new contributors or someone taking over for you after you’ve left the project.
Hi Chris,
Quite a nice poll to understand how important it is to manage our CSS files wisely and with proper knowledgeable people..
I certainly would love to learn how to make CSS more managable for teams, learn how to write good documentation… after all, it’s a good skill to have for whatever jobs you have in the future, right?
But I AM the only one who touches code my companies seven sites, and as long as I’m here, they have no intention of training anyone else how to do it. I dig BEM and SMACKS, and I’d evangelize them to anyone, but they are pretty team-oriented so I’ve scaled them down or significantly modified them for my own purposes. And there’s no way I’m letting anyone look at my SASS – it’s a mess, but it’s MY mess.
I’d like to learn ways to write more efficient and sustainable code for myself, but would also like to try to pick up things here and there so the transition to a larger team some day won’t be as challenging.
As the only developer in an agency, I’m the only one that touch code, but when I do crazy things (everybody does sometimes,right?) I always try to comment why I did it and what it does.
For the sanity of future people touching the code and my own.
As a freelancer I had seen others people mess and I really hate when you have to figure out what’s going on, I think that no matter the size of the project, if is only you or 20, comments and style guides are needed.
I would think comments are a necessity, right? Or perhaps that’s my programmer side talking. I don’t leave any code uncommented unless it’s simply and easy to figure out (say a few simple lines you can follow along in your head).
It seems my last comment was removed? Why? Was it not obvious enough how my comment about JSLint was relevant?
“When someone asserts that CSS must be written such that anyone can jump in and work, how true is that?”
Can you envision 2 years down the line and see that nobody else will join your currently One-Man-Army project and have to touch your code? Can you say that with certainty? Do you ever plan to open source the website and accept contributions?
“Are style guides and elaborate comments an overall best practice, or only appropriate sometimes?”
Do you write Javascript without using JSLint? If you wouldn’t write Javascript without a style guide or using JSLint why would you treat CSS any differently? Code is code. Regardless of the language. People run their Python through Pep 8 linters, Ruby writers push their code through RuboCop. CSS should be ran through a CSS linter. Take a step forward, not a step backward.
“Are your weird CSS writing habits OK if you are a loner?”
See first point.
“Or will you suffer?”
Inconsistencies tend to nip you in the butt eventually if you ever choose to refactor or need to make changes to older code.
“Are team-oriented best practices too slow?”
They are only slow if you need to think about them. If you use a consistent style and a linter to enforce it, over time you won’t need to think. You’ll start writing better code as you enforce writing good code instead of sloppy code.
Awesome comment! I’ll leave this one, but I’m going to bury it, because I don’t do anonymous comments here. It’s my community policy.
Seems to me that the majority of us are fine without github since we alone touch css or any other files. As long as you have a backup system like Time machine, you can usually reverse big mistakes.
Also, I wonder who creates the majority of web sites? Solo coders, contractors, big agencies? I would bet that the majority of sites are created by solo acts rather than by big agencies. Also would bet that the majority of web sites are for small businesses or individuals rather than for big corps that would require an agency.
I’d say it’s just me. I’m not saying my PM can’t, he does CSS just fine. However since I wrote the custom theme myself…I’d rather stick with one person’s edits rather than having his grubby hands all over my well-formatted stylesheet.