Skip to main content
added 1028 characters in body
Source Link
cjs
  • 783
  • 4
  • 8

This question is founded on a misunderstanding of code quality, or what "good" code is.

"Good" vs "bad" code is very much dependent on context. Code that does the job that it needs to and never needs to be modified is not bad code for your purposes, even if it's virtually unreadable. It becomes bad code only when you need to read it (whether to figure out what it does, or because you've been asked to change what it does).

This is entirely disconnected with things like how much abstraction you're using; I've as much (or perhaps even more) code that ended up being bad through the use of too much abstraction as too little.

The "dirty trick" used to code up features or changes faster is not a programming trick but one that's in fact used more often by managers: declare the code to be done without examining whether it really does what you want, perhaps even skipping a reasonably precise definition of what you want.

Edit: From the downvotes and comment, I suppose it wasn't clear from the above that there is only sometimes a "tradeoff between the speed of development and the quality of code." Sometimes the tradeoff goes the other direction, in fact: it's frequently the case that in the long run develop most quickly by writing high quality code. (We don't focus on code quality because it's an inherent good; we focus on code quality because it generally saves us time and money if one of our requirements is that things work properly.)

If you're looking for short run productivity, that depends on how you define "done." (As mentioned above, this may or may not include the feature being shown to fully work, the code being left in a state where it's best suited for further development demands, and so on.) Especially if you actually need the feature to work properly, writing bad code and then figuring out what's broken without making the code better may actually take longer than just writing good code in the first place.

As one final note: if you can fairly easily write what you need with less code and fewer abstractions (which will often be faster), and the code is not causing you problems in the long run, yet you consider this "not clean" code you have a definition of "clean" code that make it sometimes less good than "less clean" code.

This question is founded on a misunderstanding of code quality, or what "good" code is.

"Good" vs "bad" code is very much dependent on context. Code that does the job that it needs to and never needs to be modified is not bad code for your purposes, even if it's virtually unreadable. It becomes bad code only when you need to read it (whether to figure out what it does, or because you've been asked to change what it does).

This is entirely disconnected with things like how much abstraction you're using; I've as much (or perhaps even more) code that ended up being bad through the use of too much abstraction as too little.

The "dirty trick" used to code up features or changes faster is not a programming trick but one that's in fact used more often by managers: declare the code to be done without examining whether it really does what you want, perhaps even skipping a reasonably precise definition of what you want.

Edit: From the downvotes and comment, I suppose it wasn't clear from the above that there is only sometimes a "tradeoff between the speed of development and the quality of code." Sometimes the tradeoff goes the other direction, in fact: it's frequently the case that in the long run develop most quickly by writing high quality code. (We don't focus on code quality because it's an inherent good; we focus on code quality because it generally saves us time and money if one of our requirements is that things work properly.)

If you're looking for short run productivity, that depends on how you define "done." (As mentioned above, this may or may not include the feature being shown to fully work, the code being left in a state where it's best suited for further development demands, and so on.) Especially if you actually need the feature to work properly, writing bad code and then figuring out what's broken without making the code better may actually take longer than just writing good code in the first place.

This question is founded on a misunderstanding of code quality, or what "good" code is.

"Good" vs "bad" code is very much dependent on context. Code that does the job that it needs to and never needs to be modified is not bad code for your purposes, even if it's virtually unreadable. It becomes bad code only when you need to read it (whether to figure out what it does, or because you've been asked to change what it does).

This is entirely disconnected with things like how much abstraction you're using; I've as much (or perhaps even more) code that ended up being bad through the use of too much abstraction as too little.

The "dirty trick" used to code up features or changes faster is not a programming trick but one that's in fact used more often by managers: declare the code to be done without examining whether it really does what you want, perhaps even skipping a reasonably precise definition of what you want.

Edit: From the downvotes and comment, I suppose it wasn't clear from the above that there is only sometimes a "tradeoff between the speed of development and the quality of code." Sometimes the tradeoff goes the other direction, in fact: it's frequently the case that in the long run develop most quickly by writing high quality code. (We don't focus on code quality because it's an inherent good; we focus on code quality because it generally saves us time and money if one of our requirements is that things work properly.)

If you're looking for short run productivity, that depends on how you define "done." (As mentioned above, this may or may not include the feature being shown to fully work, the code being left in a state where it's best suited for further development demands, and so on.) Especially if you actually need the feature to work properly, writing bad code and then figuring out what's broken without making the code better may actually take longer than just writing good code in the first place.

As one final note: if you can fairly easily write what you need with less code and fewer abstractions (which will often be faster), and the code is not causing you problems in the long run, yet you consider this "not clean" code you have a definition of "clean" code that make it sometimes less good than "less clean" code.

added 1028 characters in body
Source Link
cjs
  • 783
  • 4
  • 8

This question is founded on a misunderstanding of code quality, or what "good" code is.

"Good" vs "bad" code is very much dependent on context. Code that does the job that it needs to and never needs to be modified is not bad code for your purposes, even if it's virtually unreadable. It becomes bad code only when you need to read it (whether to figure out what it does, or because you've been asked to change what it does).

This is entirely disconnected with things like how much abstraction you're using; I've as much (or perhaps even more) code that ended up being bad through the use of too much abstraction as too little.

The "dirty trick" used to code up features or changes faster is not a programming trick but one that's in fact used more often by managers: declare the code to be done without examining whether it really does what you want, perhaps even skipping a reasonably precise definition of what you want.

Edit: From the downvotes and comment, I suppose it wasn't clear from the above that there is only sometimes a "tradeoff between the speed of development and the quality of code." Sometimes the tradeoff goes the other direction, in fact: it's frequently the case that in the long run develop most quickly by writing high quality code. (We don't focus on code quality because it's an inherent good; we focus on code quality because it generally saves us time and money if one of our requirements is that things work properly.)

If you're looking for short run productivity, that depends on how you define "done." (As mentioned above, this may or may not include the feature being shown to fully work, the code being left in a state where it's best suited for further development demands, and so on.) Especially if you actually need the feature to work properly, writing bad code and then figuring out what's broken without making the code better may actually take longer than just writing good code in the first place.

This question is founded on a misunderstanding of code quality, or what "good" code is.

"Good" vs "bad" code is very much dependent on context. Code that does the job that it needs to and never needs to be modified is not bad code for your purposes, even if it's virtually unreadable. It becomes bad code only when you need to read it (whether to figure out what it does, or because you've been asked to change what it does).

This is entirely disconnected with things like how much abstraction you're using; I've as much (or perhaps even more) code that ended up being bad through the use of too much abstraction as too little.

The "dirty trick" used to code up features or changes faster is not a programming trick but one that's in fact used more often by managers: declare the code to be done without examining whether it really does what you want, perhaps even skipping a reasonably precise definition of what you want.

This question is founded on a misunderstanding of code quality, or what "good" code is.

"Good" vs "bad" code is very much dependent on context. Code that does the job that it needs to and never needs to be modified is not bad code for your purposes, even if it's virtually unreadable. It becomes bad code only when you need to read it (whether to figure out what it does, or because you've been asked to change what it does).

This is entirely disconnected with things like how much abstraction you're using; I've as much (or perhaps even more) code that ended up being bad through the use of too much abstraction as too little.

The "dirty trick" used to code up features or changes faster is not a programming trick but one that's in fact used more often by managers: declare the code to be done without examining whether it really does what you want, perhaps even skipping a reasonably precise definition of what you want.

Edit: From the downvotes and comment, I suppose it wasn't clear from the above that there is only sometimes a "tradeoff between the speed of development and the quality of code." Sometimes the tradeoff goes the other direction, in fact: it's frequently the case that in the long run develop most quickly by writing high quality code. (We don't focus on code quality because it's an inherent good; we focus on code quality because it generally saves us time and money if one of our requirements is that things work properly.)

If you're looking for short run productivity, that depends on how you define "done." (As mentioned above, this may or may not include the feature being shown to fully work, the code being left in a state where it's best suited for further development demands, and so on.) Especially if you actually need the feature to work properly, writing bad code and then figuring out what's broken without making the code better may actually take longer than just writing good code in the first place.

Source Link
cjs
  • 783
  • 4
  • 8

This question is founded on a misunderstanding of code quality, or what "good" code is.

"Good" vs "bad" code is very much dependent on context. Code that does the job that it needs to and never needs to be modified is not bad code for your purposes, even if it's virtually unreadable. It becomes bad code only when you need to read it (whether to figure out what it does, or because you've been asked to change what it does).

This is entirely disconnected with things like how much abstraction you're using; I've as much (or perhaps even more) code that ended up being bad through the use of too much abstraction as too little.

The "dirty trick" used to code up features or changes faster is not a programming trick but one that's in fact used more often by managers: declare the code to be done without examining whether it really does what you want, perhaps even skipping a reasonably precise definition of what you want.