If someone has bad grades and limited programming experience, can they afford to rely on their first year of coursework to come up to speed with the field? Or is it a better idea to take some time off before starting your PhD and improve your skills?
This is phrased as a question about first-year coursework, but it's actually a question about admissions. Specifically, a department won't offer admission to someone they feel has inadequate preparation, so this situation should not arise (assuming the admissions process works well).
From this perspective, the reformulated question is: if you have bad grades and limited programming experience, is admission to a CS PhD program still possible, or do you need to take some time off to improve your skills?
At this level of detail, there's no way to say for sure. If your application shows nothing but bad grades and lack of programming experience, then admission is presumably out of the question. On the other hand, why would you even want to enter a PhD program without some other background that indicates it's a good idea? In which case the admissions decision comes down to what that background is and whether it outweighs the grades and programming experience. It would take something impressive, but it's possible in principle.
I came into my PhD in CS (JHU) with a solid background in mathematics (12+ graduate courses, 8 undergraduate courses) but little programming experience (I had data structures and theory of computation). I worked a few hours a day just on catching up. It was difficult my first year. If you feel confident about your ability to learn and are able to work extra hard (zero other responsibilities) then I would just begin.
Current CS PhD student here, I can at least speak to the content of coursework. It does depends a lot on what sort of programming experience you have, and what field you are planning to go into - e.g., if all you've done is some web dev and you want to work on compilers, you're going to have a lot of catching up to do. But if you wanted to do HCI and you can pick up new syntax relatively fast, you'd probably be fine.
Personally, while I had both decent grades and a fair amount of programming experience in undergrad, I was primarily a physics major and hadn't taken any courses on topics that everyone already seemed to know about, like parallel computing or crypto or even networking - starting out with grad courses on those topics was one of the hardest things for me, not learning a new language. Classes move a lot faster and assume a lot more background knowledge at the graduate level vs. undergrad. For example, in my programming language course, we spent two days on an introduction to OCaml, where the undergrad level course spent about two weeks. It's certainly possible - and schools do admit people with limited CS experience but demonstrate promise in other ways! - but it will mean you have to work a little harder to catch up. As an example, in my "advanced database manangement systems" course last semester, I was in a project group with two other CS PhD students, one of whom knew only MATLAB (he was going into theory), and the other had a some experience (an intro class or two) with Java. However, they were both either planning to or taking undergrad-level programming courses. So that is one option, although of course it'd be more work on top of your classes. I would say the most important factor in deciding to take time off to "get up to speed" would be whether or not you feel you know enough about your desired field. If it's just "wow [x] sounds so cool, I wanna work on that!", you might want to take time to get your feet wet and see if you really do like it before committing to a Ph.D. program. But if you are sure enough, apply away, and be confident in knowing that an admission offer means they think you're ready to go!