Murphy
So, I was going to write a bit more about the simplename gear, and I will, but I'm going to divert slightly for this post and talk about bugs.
Bugs happen. I don't write perfect code first time (and when I do, I get deeply suspicious of it), so I know that a certain percentage of my dev time is going to be spent correcting things.
There are a number of layers involved in this correction however. The first is simple stuff, typos, wrong function name etc that either get picked up by the validator or cause such a hideous mess that it's obvious there's a problem right there when you're doing the code. Increasing your efficiency here is basically only doable using smarter tools and being better with the language. I'm a vim fan so..well..my tools are pretty stupid, but I get by :)
The second layer is more subtle, logic problems etc hidden behind a decision tree that isn't easy to test. This is the area we try and cover off with test suites, trying to verify that things will actually work the way we want them to.
The problem with test-driven coding is that you actually have to write in a way that is testable, and it changes the way you code. I have found over time that by writing to be testable, you get more correct code for what it does, but you end up with an explosion of interfaces (in the programming sense, not the UI sense). An interface is what you call to test, so each segment of code is now bound to be an interface rather than a part of a whole.
This isn't bad per se, but the rule of leaky abstractions apply. As soon as you have to build an interface, you add a layer of concrete that is difficult to change, and through which communication becomes very constrained.
I tend to pick and choose my testing areas more carefully now. If it involves money or some other important thing, lots of automated testing up to the level of identification (ie, that an error has been identified and some kind of reasonable response can be made). If it's an odd-ball section or whatever, I don't worry about it.
The third layer though, these are the awful ones. I had one today. You get these bugs when the data you expect to receive from a seemingly trusted source does something completely unexpected when in a production environment, being accessed by someone from Guatemala.
There's nothing you can do about these, I lost a sale because of it. Only increasing maturity of your system will weed these out. Doesn't make it any less frustrating though.
For those people using Turbogears, the data you get from cherrypy.request.headerMap.get("X-Forwarded-For") and cherrypy.request.remoteHost is not what you expect under all circumstances. If you're relying on getting a single IP address as a result, vet the code rigorously as if the data were supplied by an idiot user :)
Bugs happen. I don't write perfect code first time (and when I do, I get deeply suspicious of it), so I know that a certain percentage of my dev time is going to be spent correcting things.
There are a number of layers involved in this correction however. The first is simple stuff, typos, wrong function name etc that either get picked up by the validator or cause such a hideous mess that it's obvious there's a problem right there when you're doing the code. Increasing your efficiency here is basically only doable using smarter tools and being better with the language. I'm a vim fan so..well..my tools are pretty stupid, but I get by :)
The second layer is more subtle, logic problems etc hidden behind a decision tree that isn't easy to test. This is the area we try and cover off with test suites, trying to verify that things will actually work the way we want them to.
The problem with test-driven coding is that you actually have to write in a way that is testable, and it changes the way you code. I have found over time that by writing to be testable, you get more correct code for what it does, but you end up with an explosion of interfaces (in the programming sense, not the UI sense). An interface is what you call to test, so each segment of code is now bound to be an interface rather than a part of a whole.
This isn't bad per se, but the rule of leaky abstractions apply. As soon as you have to build an interface, you add a layer of concrete that is difficult to change, and through which communication becomes very constrained.
I tend to pick and choose my testing areas more carefully now. If it involves money or some other important thing, lots of automated testing up to the level of identification (ie, that an error has been identified and some kind of reasonable response can be made). If it's an odd-ball section or whatever, I don't worry about it.
The third layer though, these are the awful ones. I had one today. You get these bugs when the data you expect to receive from a seemingly trusted source does something completely unexpected when in a production environment, being accessed by someone from Guatemala.
There's nothing you can do about these, I lost a sale because of it. Only increasing maturity of your system will weed these out. Doesn't make it any less frustrating though.
For those people using Turbogears, the data you get from cherrypy.request.headerMap.get("X-Forwarded-For") and cherrypy.request.remoteHost is not what you expect under all circumstances. If you're relying on getting a single IP address as a result, vet the code rigorously as if the data were supplied by an idiot user :)