Live data from Hacker News

Who wrote this shit?

heltweg.org

161–170 of 300 posts

Re: Who wrote this shit?

#161
post #72

Earlier quoted context omitted.

I'm a strong believer in continuous refactoring. Improve existing code when you touch it. Defer architectural choices untill the moment you have enough info. And leave cleaning up to the moment that it starts becoming messy, not before. That implies, code never is perfect. Not even good. But clunky, cobbled together, expermental or just plain stupid. But always just about 'good enough' to solve the issue at hand.

I reached the same conclusion. I just would add, that the urge to refactor things whenever possible, definitely introduced bugs for me, because also refactoring has to be done with consideration and some things were weird for a reason, you do not see at first glance. And refactoring can also hurt you, or another person just used to that code in its old shape. And then missunderstanding things.

> definitely introduced bugs for me

I'm an avid TDD developer. Red-green*refactor*. The latter, often overlooked, is IMO by far the most important part of TDD. But the refactor is only possible because of the tests you wrote, asserted, and tested (testing the tests) in the red-green phase.

It gets hairy when a refactor needs to also refactor the tests - often a sign that the tests were lacking in the first place (and the more reason to refactor them). In which case I try to refactor them not in lock-step but decoupled: first refactor the tests without touching the SUT. Then refactor SUT (and then, most likely, another round of this)

There is no fool-proof way. There will be bugs. There will be regressions. But that is a artifact of "change", not of refactoring. I'm also a believer in "never fix something that ain't broken". Which, unfortunately, only works for software that is not ever upgraded, has no dependencies, runs on hard- and software stacks that never change and has no changing business-needs ever. I.e.: non-existing software.

Re: Who wrote this shit?

#162
post #142

Many people in this thread are saying they are surprised by their own shitty code, 6 month ago. I read this everywhere on the Web. It's like I should myself be finding my code from 6 months ago horrible. I don't know. I tend to remember what code I wrote, and recognize my own code when seeing it, even years later. My code from 6 months ago looks good to me. My code from 10 years ago looks "reasonable, if a bit messy"…

I suspect everyone was writing badly informed code at one point - just for some of us it was a long time ago, and we were young.

For example, I wrote a javascript image editor that stored images as hex strings internally, and saved them to file by screenshotting them. Completely mad design. But that was ~23 years ago, long forgotten by everyone except me, and I was age 14 at the time.

This is a young and growing industry; someone who coded like a 14-year-old ten years ago might simply be a 24 year old today.

Re: Who wrote this shit?

#163

Earlier quoted context omitted.

All I did, was saying comments shouldn't be default for documentation. To which you reply with this. "People like you are the reason why code becomes unmaintainable." So ... what do you think, I could say of people like you and something with the internet? In any case, I use comments in code btw. But way less often nowdays. Because comments have a tendency to be ignored and still remain there, despite the code for th…

I say 'people like you' because this isn't the first time I've heard arguments like, 'comments have a tendency to be ignored and still remain there' and 'No comment is way better, than a wrong, missleading comment'. Those two statements combined is your justification (excuse) for never writing comments and why the code you and people like you write is unmaintainable. Just write the damn comment. You're code isn't as…

See, this is why comments are often so bad. They get ignored (and then forgotten) most of the time anyway. Like you did with my comment, where I explicitely stated, that I do write comments. Just less, than I used to.

To which you just made a strawman argument of

"Those two statements combined is your justification (excuse) for never writing comments and why the code you and people like you write is unmaintainable."

You do not know me, nor my code - yet you judge about it, claiming it unmaintainable. Well, what more is there to comment on? Probably nothing.

Re: Who wrote this shit?

#164
post #161

Earlier quoted context omitted.

I reached the same conclusion. I just would add, that the urge to refactor things whenever possible, definitely introduced bugs for me, because also refactoring has to be done with consideration and some things were weird for a reason, you do not see at first glance. And refactoring can also hurt you, or another person just used to that code in its old shape. And then missunderstanding things.

> definitely introduced bugs for me I'm an avid TDD developer. Red-green*refactor*. The latter, often overlooked, is IMO by far the most important part of TDD. But the refactor is only possible because of the tests you wrote, asserted, and tested (testing the tests) in the red-green phase. It gets hairy when a refactor needs to also refactor the tests - often a sign that the tests were lacking in the first place (and…

One day I probably shift into TDD as well, as .. yes, I am not big on systematic testing. And that often hurt a lot.

Re: Who wrote this shit?

#165

I had a nearly identical experience a few months after starting my first job out of college. Huge software firm. I was looking through code with a senior colleague, and something looked really off to me. I literally said something like, "How could the person who wrote this be so stupid?" My colleague replied calmly,, "I wouldn't presume to know the mental capacity or state of the person who wrote this code at the mom…

Any time you start having negative sentiment, anywhere in life, directed at the creations of other humans or the humans themselves I have two phrases I use. Four words. Be humble. Be curious. It’s saved me a lot of angst. I think as a developer this is a great mindset, it has helped me a lot, at least.

Re: Who wrote this shit?

#166

Earlier quoted context omitted.

Unless you are a citizen of the same state the corporation is, you’ll need a lawyer when they file a removal petition to have the case moved to federal court on the basis of diversity jurisdiction. And if you don't consult a lawyer to prepare for small claims court, you stand a decent chance to be blindsided by that or something else.

Do it anyway. For them to hire a lawyer to determine this, then they have to pay quite a bit of money. It is quite possible they might be bluffed and pay up, or decide it is cheaper to pay up, and then actually pay up. If the initial action costs nothing, you have nothing to lose, but they will almost certainly lose something. If you do nothing it will cost you nothing also, but you have no chance of gaining anything…

> For them to hire a lawyer to determine this

They don't need to hire a lawyer to determine it, the junior paralegal in the in-house counsel’s office with a checklist will do just fine, since all the information needed to make the determination will be on the papers they are served with.

> If the initial action costs nothing, you have nothing to lose

Not at all true; one of the other standard techniques for getting things out of small claims court is for the defendant to find anything about the interaction in question that they could countersue for that would raise the amount in controversy above the small claims limit (since the requirement for linked counterclaims to be handled in the same case and the small claims limit interact to requiring moving the case when this happens), even if it is something that they wouldn't sue over otherwise.

Re: Who wrote this shit?

#167
post #142

Many people in this thread are saying they are surprised by their own shitty code, 6 month ago. I read this everywhere on the Web. It's like I should myself be finding my code from 6 months ago horrible. I don't know. I tend to remember what code I wrote, and recognize my own code when seeing it, even years later. My code from 6 months ago looks good to me. My code from 10 years ago looks "reasonable, if a bit messy"…

You're not alone. I feel the same except when I wrote something that I didn't care about much. Those, I forget.

Re: Who wrote this shit?

#168

I'm in a constant state of this in the codebase I inherited. The previous solo front-end developer was the manager of R&D so he couldn't be fired easily, he was the only person willing and sort of able to do front-end (PHP + JS/Dojo), he was super productive (most code was written in 2012/2013), but not a very competent or self-critical developer. Think a back-end that concatenates XML into a big global string over t…

When I joined I was given free rein to rewrite it in the technologies I thought would suit best. It's been two years, at a stretch I'm about 20% of the way there. This is the danger of rewrites (assuming this was not actually greenlit as a 10 year project)!

The trick is to declare it out of scope and bury the follow-up ticket.

Re: Who wrote this shit?

#169
post #149
post #73

Earlier quoted context omitted.

I talked to a lawyer, and it just wasn't worth going after them for this amount. I wrote it off as a valuable lesson and went to make more money elsewhere.

You don’t need a lawyer for small claims court as far as I know, just an FYI.

It's possible that the jurisdiction I live in works differently than yours.

Re: Who wrote this shit?

#170

Earlier quoted context omitted.

I say 'people like you' because this isn't the first time I've heard arguments like, 'comments have a tendency to be ignored and still remain there' and 'No comment is way better, than a wrong, missleading comment'. Those two statements combined is your justification (excuse) for never writing comments and why the code you and people like you write is unmaintainable. Just write the damn comment. You're code isn't as…

See, this is why comments are often so bad. They get ignored (and then forgotten) most of the time anyway. Like you did with my comment, where I explicitely stated, that I do write comments. Just less, than I used to. To which you just made a strawman argument of "Those two statements combined is your justification (excuse) for never writing comments and why the code you and people like you write is unmaintainable."…

You have some sort of defeatist attitude with comments saying they're ignored/forgotten. I wish I knew your life experience to see where this happened and how you formed this opinion. Is it because YOU ignored them and didn't update them with code changes? Or others did so and it got past a code review? You don't maintain your comments with your code, given your attitude it sounds like you don't.

Your attitude in infectious. It causes new developers to have the same now unfounded opinions and not write comments themselves. The cycle of unmaintainable code continues.

Post reply on HN