4 ms·
Here's what happened to me(A) and a friend(B) from a former workplace of mine(open-source project): B: Take a look at this shit code that I found. A: Whoah, i
by Tade0 7y ago
Here's what happened to me(A) and a friend(B) from a former workplace of mine(open-source project):
B: Take a look at this shit code that I found.
A: Whoah, it really is shit. Blame it so that we can see what kind of genious is behind this.
B: ...
A: Well?
B: Apparently you wrote and I reviewed/approved it.
- carapace 7y ago*genius
- harrisreynolds 7y agoThis is really funny. So good. I ask all the time, "Who wrote this shit??" knowing it was probably me.
- yxhuvud 7y agoThat is the only time I dare ask it. When else do I dare? Someone might take it the wrong way otherwise.
- heelix 7y agoHonestly, this is usually a good sign. I'll code at the edge of my current skill. Six months from now, I hope I can look at that code and consider it primitive from where I hope to be then.
- koala_man 7y agoI've had that happen several times, but once I actually did the inverse. I was working on an extraordinarily bad codebase, and stumbled upon some modular, reusable code that made my life way easier. I wondered who wrote this rare gem in that pile of shit, and checked `svn praise` for a change. It was me. It would have been the highlight of my then short career, if not for the fact that it meant there were no other semi-competent people on that project.
- kbp 7y agoThe "who wrote this?" mentality is a trap that's good to avoid. Get comfortable with different ways of writing something that, while they might have different tradeoffs, accomplish the same thing, and try to see past that. Understand that most code wasn't written by anybody--lines 1 and 3 were written by Alice a year ago, line 2 was written by Bob 2 years ago, and line 4 was written by Alice yesterday. `git blame` is very useful for seeing the change in context, which can give a lot of insight into why it's written that way, but usually the author isn't very useful to know, unless you're planning to ask them about it. Sometimes it's useful if you happen to know that the author isn't very familiar with something when you're wondering why they didn't use it, but try to keep in mind what the actual benefits of your way are, whether they're especially pressing, and that the other person might have written it differently because they were thinking about other concerns that you forgot.
- AmericanChopper 7y agoI’ve always found the svn alias ‘svn praise’ pretty entertaining for this reason.
- collinmanderson 7y agogit has "git annotate"
- sirmarksalot 7y agoWhile lots of legacy code emerges organically the way you describe, there are in fact many people in the industry who I'd call "legacy coders." People who saw Dijkstra's "Goto considered harmful" and scoffed, "all these 'for' loops are much less readable than my 'goto loop1' solution." People who use global variables because parameter-based implementations are "needlessly complex." Basically, not everyone works for Google.
- sk0g 7y agoYou say that, but Golang has gotos, while being a very minimal language. Not everyone at Google is an amazing developer that's fully up to date with best practices and patterns. Not that that needs to be said, no matter the company (if it's of any decent size.)