4 ms·
If I write shit code (and I do, because at some point we all do) and for whatever reason I can't fix it (usually time crunch) I call it out even if it's just a
by orclev 13y ago
If I write shit code (and I do, because at some point we all do) and for whatever reason I can't fix it (usually time crunch) I call it out even if it's just a comment in the code to say "this is a terrible hack, don't do this". It's important to recognize when code is less than ideal or when you write something that you know you could do better if you had more time to research and think about the solution. Part of becoming a good developer is learning to accept criticism of code not as an attack on the developer but as recognition that there's always room to improve on things and that no one is perfect. It's also about recognizing that sometimes you just have to accept "good enough" and move on even if you'd really like to go for "perfect". At the same time you don't want to throw away your standards and just settle for anything that gets the job done if you don't absolutely need to, which is why calling out kludges and shit code when you (or someone else) writes it is important. Now don't get me wrong, I'm more than happy to call my shit code shit, but I'd at least try to be more tactful of someone else's code.
- eric_the_read 13y agoOh, I am certain to write code that could be described as "shit" from time to time as well. But for myself, in that situation I try to say, "this is pretty suboptimal, we have better solutions, but not enough time for them right now." as opposed to "yeah, this is kinda shit." Definitely we don't want developers who are so precious about their code that they can't handle a little criticism, but there are, IMO, better ways and worse ways to deliver that criticism. Think of it like a judge on Iron Chef-- the worst kind of criticism you can give a dish is, "this is terrible". Only slightly less worse is, "this is wonderful!" Ideally, you need reviews like, "This has a bit too much cinnamon, and I think you way overdid the cumin, but overall this is the best shrimp I've had this week."