4 ms·
I spent some time working for one of the biggest names in trading technology and one of the things I learned is that if your code doesn't work on more or less t
by cheez 10y ago
I spent some time working for one of the biggest names in trading technology and one of the things I learned is that if your code doesn't work on more or less the first try, your design is probably wrong. The implications of that lesson are profound.
When something doesn't work as expected, I now check my design and not the code.
- pc86 10y ago> if your code doesn't work on more or less the first try, your design is probably wrong Or you're tired. Or you're just not as focused as you could be. Or you have a deadline. Or you're trying something new. Or you're not fluent in the language yet. Or you're fluent in the language but not the framework. Or you're fluent in the language and framework but not the design pattern (if you use those). Or a whole host of other things. I'm not saying spot-checking the design isn't a good idea, but saying that it's the design more often than the code just doesn't match up with my experience.
- cheez 10y agoThe entire idea is to increase the probability that you are correct. So if you're coding tired, you're decreasing that probability. If you're using a framework you're not familiar with, you're decreasing that probability. This is why I mentioned that it was in trading technology: they only get paid to be right.
- lordnacho 10y agoHow do you define "the first try"? Surely you're bound to have various trivial issues?
- cheez 10y agoSomething along the lines of after fixing obvious stupid things like those trivial issues.
- d_theorist 10y agoI remember once my code worked on the first try. I found it difficult to believe.
- cheez 10y agoOne time in uni, I had no access to a computer and wrote an entire b-tree implementation on paper for a course, typed it in and it worked. Based on a true story
- eveningcoffee 10y agoIn principle TDD is the opposite of this. Out of curiosity, did you use any debugging on paper for your code?
- cheez 10y agoI can't recall, honestly
- jimmaswell 10y agoI've found it to happen very often the past few years
- throwayawnotime 10y agoDid this comment really deserve a downvote? Upvoting accordingly!
- pc86 10y agoMaybe not, but this one certainly does.