Good programmers explain why they're doing something in the comments (if it isn't obvious). Good programmers write (sparingly and when appropriate) humorous/sarcastic commit summaries so that I can smile while looking through years-old changelists in an attempt to track down the root cause of a bug.
Bad programmers add -- or even worse, mask existing -- undefined behavior in non-descriptive change summaries like "Fix feature X".
there are different levels of this so its hard to put it all together.
you have the experience factor. A programmer with 10 years experience is going to write better code than the guy just out of school, because you learn a lot over a career that is far beyond what is taught/picked up in school.
You have the motivation factor. A programmer who just does what he is told they way he was told to do it vs the guy that will put down the code to research how the best way to do things first. The figure it out for yourself by trying to do it and thinking about it and researching it. This also goes with the keep up to date factor -- using new features rather than deprecated ones.
You have the clean code factor. No comments, bad variable names, random design that was congealed on the fly rather than crafted beforehand, ... the code may work, it may work well and fast, but its still poor quality.
there are more like this, but just a starting point...
That is an interesting take on it.
I have moved into database (bleeding edge cloud crap, to be specific) and 90% of the people I work with could do none of the above things. A good 30% of them, however, are ' very good' at what we do (sql, javascript, python, java, etc). Readable, efficient well crafted code in a mix of languages. (Well, they could do trig and some math, but probably haven't touched much since college). None of them know C/C++ asm. Just never needed it. Almost all of them are better at sql than I am; that junk is random from system to system and what runs well on one is not the efficient way on another, its not fun to work with for many reasons.
Curious really... are you saying one can't be 'good' without being able to do things their jobs have not required? Or are you thinking "good at c++"? Or just that they could learn it if thrown into it from their niche?
Yes my perspective is based only around C/C++, it surely doesn't apply to data scientists, web developers, interpreted languages and similar, most of these areas don't deal a lot with C++ anyway.
This is my opinion ofc. based on what I have experienced and on what I was others coders are really good at, in projects we work on.
Also I'm hobby coder and don't consider my self "good", a lot of times I stuck with math and need to refresh my self of some topics (khanacademy.org is really good for this). then also I don't know assembly a lot, and often times feel behind others.
Also my interests/projects are based on graphics simulation and AI, which require some of these skills.
Maybe "good programmer" should be called "experienced programmer" instead here, some people work for one company for decades and are good at one thing but bad at other simply because they never worked on something else/specific.
A good programmer writes code that works. Bad programmers write code with bugs. That's sort of the golden rule. If your code doesn't work then nothing else matters.
It depends on the context, but most code must be maintainable, so a good program writes code that is clear, contains comments, is well structured and is easy to maintain or extend.
Most code has to deal with errors. Sometimes, like in a simple website, you can just throw up an error message and be done with it. Sometimes, like if you're controlling an airplane, you have to recover from the error. A good programmer understands the context and writes appropriate error handling code. In my line of work the error handling can be 25% - 50% of the code. It takes newbies a while to get used to checking every function/method call to see if it failed.
A good programmer spends most of their time designing the software rather than writing it. The writing part is just implementing the design.
A good programmer can extract the actual requirements from whoever is asking for the change. It's easy to say "well they didn't give good requirements" but it's more like when you want a custom house. You tell the architect that you want 3 bedrooms and a nice view out back and a roomy kitchen. It's up to the architect and engineer to elicit the details from you, explain what can and cannot actually be built etc. Programming is the same.
A good programmer is unlikely to go work for an employer who is so clueless about programming that the person recruiting them doesn't even have any idea what the difference is between a good programmer and a bad one ;)