Bad programmers. Are they common, and how do they survive?
category: code [glöplog]
@rac: good programmers can do bad code too: because there's a deadline (compo deadline, christmas in the game industry...), because only the result of the program is important and it has only to be run once (non runtime precalcs...), because they are not motivated by the job given to them but since they got paid for it they do it anyway...
There's probably a LOT of examples of bad code in demos, it's even sometimes said in the comments. So bad code does not imply bad programmer.
Maybe we can define a bad programmer as someone who claims to have enough experience for doing something when he does not?
There's probably a LOT of examples of bad code in demos, it's even sometimes said in the comments. So bad code does not imply bad programmer.
Maybe we can define a bad programmer as someone who claims to have enough experience for doing something when he does not?
Well thanks four your honest and serious answers; I was just trying to get an idea of my own situation. Among some (but by no means all) of my coworkers notions like recursively implemented traversal of trees, graphs, grammars, NP-completeness and design patterns are totally unheared of apparently. I code in various languages (Java, Javascript, C#) and consider myself "relatively competent" syntactically and in basic OO concepts; on the other hand, I'm a bit slow in grasping APIs which are new to me (depends on the complexity though).
So is this a typical situation? How much math and theoretical cs can be assumed for someone having a degree from a university / university of applied science?
On the other hand, I disagree with the concept of "guaranteed codified knowledge" in the style of "if you do not know how Fast Fourier Transform works, you are not a real programmer" of "if you do not know C++, you are not a real programmer".
@AMcBain: I also have a coworker of the second type you mention; he is very skilled in figuring out what _exactly_ he does not understand, asking very meaningful questions and being patient when explaining things himself; it's a pleasure to work with him.
So is this a typical situation? How much math and theoretical cs can be assumed for someone having a degree from a university / university of applied science?
On the other hand, I disagree with the concept of "guaranteed codified knowledge" in the style of "if you do not know how Fast Fourier Transform works, you are not a real programmer" of "if you do not know C++, you are not a real programmer".
@AMcBain: I also have a coworker of the second type you mention; he is very skilled in figuring out what _exactly_ he does not understand, asking very meaningful questions and being patient when explaining things himself; it's a pleasure to work with him.
i tend to believe that 'good' programmers appreciate the complexity of what they're doing and thus are less prone to fly into assumptions or think too lightly about the problem they're solving and the correct way to do it
if thats missing, shit is off
and about the bad on purpose shit.. yeah, but it should be made clear either by documentation or simply by what it is, e.g. some tab precalc thingie somewhere
and then you could argue that it's not necessarily bad since from economic point of view and the fact that that piece will unlikely be reused or extended beyond its original purpose (*)
* - i have over the years however seen quite a few tools that, once concieved as a simple piece of c went on to become badly written en hard to maintain monsters
if thats missing, shit is off
and about the bad on purpose shit.. yeah, but it should be made clear either by documentation or simply by what it is, e.g. some tab precalc thingie somewhere
and then you could argue that it's not necessarily bad since from economic point of view and the fact that that piece will unlikely be reused or extended beyond its original purpose (*)
* - i have over the years however seen quite a few tools that, once concieved as a simple piece of c went on to become badly written en hard to maintain monsters
minus whacky grammar
Plek has a good point here.
Baah: the code i write for demos is the worst crap (style-wise, not necessarily concerning performance) you can imagine. One shot, one purpose code. I neither would accept such code at work both from myself and my coworkers. So yeah, you definitely can write bad code on purpose :-)
Baah: the code i write for demos is the worst crap (style-wise, not necessarily concerning performance) you can imagine. One shot, one purpose code. I neither would accept such code at work both from myself and my coworkers. So yeah, you definitely can write bad code on purpose :-)
Quote:
@rac: good programmers can do bad code too: because there's a deadline (compo deadline, christmas in the game industry...), because only the result of the program is important and it has only to be run once (non runtime precalcs...), because they are not motivated by the job given to them but since they got paid for it they do it anyway...
That´s a pretty short-sighted thing in any situation where software needs to be maintained or reused - any hour saved by doing it the quick-and-dirty way will bite you back sooner or later, burning way more time than initially saved.
There are only two excuses for that (which thus should both be avoided in a reasonable environment):
-extreme crunch time which makes sensible decisions impossible anyway
-lack of responsibility for the final product and the process of creating it (which is why specifications should never be made up without the one implementing them)
Quote:
There's probably a LOT of examples of bad code in demos, it's even sometimes said in the comments. So bad code does not imply bad programmer.
Most demo code is fire-and-forget code, thus many "bad practices" are totally acceptable there.
How to define a bad programmer.. well, I've worked with a few in the past I'd consider pretty bad, but then compared with some of the examples i've seen on the internet? Tbh, they're just "could be better".
For actual bad programmers:
- Doesn't learn the language before starting. And I don't mean in depth, I mean the basics. The very basics.
- Doesn't understand own code. Just looking at it, you can tell it's 90% guessed.
- Doesn't just fail at the code level, but at the algorithm level too. The algorithm they're failing to implement is just as broken as the code.
- When you give them an actual answer to their dumb questions, they reply with another question which boils down to "what does that mean?" Or, they ask you for code they can copy + paste into their project.
The guy I was "helping" on irc the other day passed all of those tests with high marks :D Normally in a case like that I'd tell him to go learn to code first, but in this case it was just so damn funny I kept going. Stuff I witnessed along the way:
- Declaring variables. What he wanted: "SomeObject x;" What he did: Create an object, allocating the memory, then totally ignore than and overwrite the pointer. A leak on every other line of code.
- No concept of what int or float are it seems. He was trying to use "switch(somefloat)". So I suggested using "(int)somefloat". Later he pasted some code up, he'd put (int) *everywhere* he used the variable :D
- No idea of how to use > or >=. I gave him a basic conditional as a clue, sure enough he'd copy & pasted it. Into a huge if loop :D He wanted to check what range a number was in, and he had a conditional for each range, and gaps of 1 between then because he didn't know how to use >=.
- His whole (extremely simple) algorithm was broken. What he wanted: "if x is in this range, button is red, if not, black". What he did: "if x is in range, button is red". Couldn't understand why it didn't turn black again.
Oh, and no, I didn't give him a load of basic coding lessons. I treated him as if he was a coder with at least the basics down, and gave him answers any actual coder would understand. Which was why it was funny as hell watching the results :D
For actual bad programmers:
- Doesn't learn the language before starting. And I don't mean in depth, I mean the basics. The very basics.
- Doesn't understand own code. Just looking at it, you can tell it's 90% guessed.
- Doesn't just fail at the code level, but at the algorithm level too. The algorithm they're failing to implement is just as broken as the code.
- When you give them an actual answer to their dumb questions, they reply with another question which boils down to "what does that mean?" Or, they ask you for code they can copy + paste into their project.
The guy I was "helping" on irc the other day passed all of those tests with high marks :D Normally in a case like that I'd tell him to go learn to code first, but in this case it was just so damn funny I kept going. Stuff I witnessed along the way:
- Declaring variables. What he wanted: "SomeObject x;" What he did: Create an object, allocating the memory, then totally ignore than and overwrite the pointer. A leak on every other line of code.
- No concept of what int or float are it seems. He was trying to use "switch(somefloat)". So I suggested using "(int)somefloat". Later he pasted some code up, he'd put (int) *everywhere* he used the variable :D
- No idea of how to use > or >=. I gave him a basic conditional as a clue, sure enough he'd copy & pasted it. Into a huge if loop :D He wanted to check what range a number was in, and he had a conditional for each range, and gaps of 1 between then because he didn't know how to use >=.
- His whole (extremely simple) algorithm was broken. What he wanted: "if x is in this range, button is red, if not, black". What he did: "if x is in range, button is red". Couldn't understand why it didn't turn black again.
Oh, and no, I didn't give him a load of basic coding lessons. I treated him as if he was a coder with at least the basics down, and gave him answers any actual coder would understand. Which was why it was funny as hell watching the results :D
I mostly survive by continuing to breathe and ingesting food and liquids on a regular basis.
Quote:
by psonice:
- When you give them an actual answer to their dumb questions, they reply with another question which boils down to "what does that mean?" Or, they ask you for code they can copy + paste into their project.
There's a related/subclass of these people. They don't want to learn the language at all, and they state it up front. They just want answers to their questions so as to complete their homework and go away. Similarly some don't want to learn Language X they just want to make changes to or mods for their favorite app which happens to be written in X.
(An example of that is Minecraft. No offense toward Minecraft, but it caused a lot of people to join freenode's Java channel an ask questions nobody there could or cared to answer because the asker didn't know Java and didn't want to, but just hoped someone could point them at an exact answer to their question.)
well I guess I'm not a very good programmer, my demo code could (indeed) be deemed as cursed, :P but anyway, a bad programmer writes bad code without noticing imo
I'm pretty sure I'm a bad programmer.
The bad programmer is that one who skips the long way between the problem and the answer.
For the rest there is a hope.
For the rest there is a hope.
i think basically psonice and amcbain nailed it regarding the bad programmers that can not program at all. zorke nailed it when it comes to the ppl who somehow manage to get a compiling program, have some kind of basic knowledge about how to declare a function (or not) or how to do basic math and call some functions. ppl of the first category can write lines like vector.size() = 17; ppl of the second kind usually make use of at least half of these.
So as a newbie coder that just learning the basics of how stack pointer works, is a bad coder?
moredhel: yeah, with potential to develop and become a good coder. when i got no training in doing whatever i would consider myself bad in that discipline until i learned something and developed. also consider the opposite: is a newbie programmer who just learns about stack pointers a good coder?
moredhel: not necessarily. But if he's working on a platform where pointers are used very heavily, and he's not bothered to learn about them, and instead he's going around asking for bits of code to copy + paste without understanding what they do? Yes, that's a bad coder :D
What everyone else said, basically.
Moredhel: Not knowing something doesn't make you a bad coder (or performer of any other art or craftsmanship). Nobody can know everything, and although I consider myself pretty good at my job, I would be screwed without looking up documentation or Wikipedia or forums like StackOverflow etc. as soon as I run into something I'm not can-type-it-down-while-sleeping experienced at.
What makes you bad is being unwilling to learn, and willfully staying ignorant. That's basically the qunitessence of this thread, and it all to much reminds me of this :/
Moredhel: Not knowing something doesn't make you a bad coder (or performer of any other art or craftsmanship). Nobody can know everything, and although I consider myself pretty good at my job, I would be screwed without looking up documentation or Wikipedia or forums like StackOverflow etc. as soon as I run into something I'm not can-type-it-down-while-sleeping experienced at.
What makes you bad is being unwilling to learn, and willfully staying ignorant. That's basically the qunitessence of this thread, and it all to much reminds me of this :/
kb_: wow. That thread is just amazing.
Quote:
I would be screwed without looking up documentation or Wikipedia or forums like StackOverflow etc. as soon as I run into something I'm not can-type-it-down-while-sleeping experienced at.
Yeah, that.
Sometimes that fucks me over and makes me go "what the, why couldn't I just deduce that myself" or "why haven't I stored this information yet" and that's when I'll have to accept that I can't retain nor know everything.
And certainly not when you drink as much as I do ;)
I can easily stand "bad" code but lack of common sense, dishonesty, and backstabbing are much more annoying in teams. I said "bad" in quotes because everyone has its own definition of what is a good programmer that more or less put oneself at the very top :). For me the most important thing is being empathetic with peers and customers.
Quote:
that more or less put oneself at the very top
not really. i mean sure stylewise i feel most comfortable with my own stuff but that's just human nature.
and that's not really an objective measurement of quality.
I'm not sure how we disagree.
oh wait, yeah
i see. you so confusing.
i see. you so confusing.
Dunno, I think it's better to consider yourself a bad coder. This way you're always pushed to improve, and there's always more to learn anyway.
It's when you consider yourself bad and everyone else agrees, that's when you have to worry :D
It's when you consider yourself bad and everyone else agrees, that's when you have to worry :D
somehow, yeah... one of the most important thing that makes up a coder is to accept others' coding styles and start to read the code and understand what it does before rambling on the style. there are true gems to be found every now and then and it makes me feel warm inside when i finally get the idea of a complex algorithm a coder came up with and ofc never wrote any comments on it.