Live data from Hacker News

A Million Lines of Bad Code

varianceexplained.org

101–110 of 123 posts

Re: A Million Lines of Bad Code

#101
post #96

Earlier quoted context omitted.

> You're right to not have qualms about laughing at something that's literally just black and white pixels (and some in-between grays) that are arranged in some configuration on your screen. ;-) Not sure what you're trying to say here? Its a cartoon about a stick figure who can't code. Funniest part was "it's like someone took a transcript of a couple arguing at ikea and made random edits until it compiled without er…

> Not sure what you're trying to say here? Its a cartoon about a stick figure who can't code. Funniest part was "it's like someone took a transcript of a couple arguing at ikea and made random edits until it compiled without errors" lol I'm just poking a little fun at your earlier reductionism. You're right, it's just a stick figure. A real human has not been hurt. My main issue with the comic is that it's not partic…

You're overthinking a cartoon in attempt to find malice where there is none. I'm sorry you didnt find it funny, but that doesn't mean it was written to be anything else but humorous.

There's nothing sinister in this cartoon, no matter what you feel. You might as well accuse all cartoonists of condoning their characters' outlandish behaviors. (e.g. "The writers of the Simpsons must condone child abuse because I didn't find the humor in Homer choking his son" ... Give me a break.)

Re: A Million Lines of Bad Code

#102

You have to have thick skin in the programming industry. Because you're surrounded by what might be the world's worst communicators, programmers. We can tell the machine exactly what to do, but our social IQs tend to suffer on the whole.

Not very smart if you can't communicate.

Re: A Million Lines of Bad Code

#103
post #96

Earlier quoted context omitted.

> Not sure what you're trying to say here? Its a cartoon about a stick figure who can't code. Funniest part was "it's like someone took a transcript of a couple arguing at ikea and made random edits until it compiled without errors" lol I'm just poking a little fun at your earlier reductionism. You're right, it's just a stick figure. A real human has not been hurt. My main issue with the comic is that it's not partic…

You're overthinking a cartoon in attempt to find malice where there is none. I'm sorry you didnt find it funny, but that doesn't mean it was written to be anything else but humorous. There's nothing sinister in this cartoon, no matter what you feel. You might as well accuse all cartoonists of condoning their characters' outlandish behaviors. (e.g. "The writers of the Simpsons must condone child abuse because I didn't…

The cartoon was clearly meant to be humorous. The humor fell flat. So the cartoon just comes off as mean. It's not the end of the world. I'm not going to attempt to reconcile it with Pig Pen and Homer Simpson in some effort to create Chasing's Grand Unified Theory of What Is and Is Not Mean-Spirited.

Re: A Million Lines of Bad Code

#104

Earlier quoted context omitted.

In the martial arts community we call this "praise, correct, praise."

Programmers tend to incline towards efficiency. I think that's why we often skip the bread and deliver only the filling. IMO there's a big difference between a criticism sandwich and tactful criticism.

Efficiency is one thing, being a douche is another. Programmers are still human beings and while they might tolerate some harsher comments, they still affect them. Efficiency yes, but not above all.

Re: A Million Lines of Bad Code

#105

Earlier quoted context omitted.

This is helpful for sure, but it's also very useful to work on having a thick enough skin to take insulting feedback in a positive fashion. After all, the only way someone can offend you is if you let them.

I'm a junior dev, I have a ton to learn and I don't for a moment think I know more than our senior dev. But working with this guy, and trying to learn from him, is a nightmare. When I ask "why should I do this rather than that?", I either get a muddy explanation, or none at all. Worse still is inconsistency. Just recently I was working on a project, went through several reviews without comment on the approach, was to…

The problem here, and you'll encounter it with clients and seniors throughout your career, is that your senior/boss doesn't have enough time, or thinks they don't have enough time, to supervise your work correctly and thus comes in at the last minute and drops hidden requirements/fundamental changes on you. It's very common.

If you want to avoid this, you're going to have to make it your job to point out potential flaws and hurdles in your work as you come across them, to ask only for essential and broad-strokes guidance up front, and to find/fix smaller issues yourself as you go along without bothering the higher ups. Your senior probably genuinely wasn't aware of the deeper issues with your work because they just didn't have time to do anything but scan your code and hope for the best, because their senior is hassling them about a,b,c, which are far more important.

Now that was flawed on their part, and they're doing their job wrong, but you can help them fix that process, if you want to, and it is a good skill to learn. You absolutely should not be avoiding code review, you should be guiding that process in a direction that is in everyone's interest. The world of work is not remotely fair, clear or right - it is very rarely even one of those, but you can make it better yourself by managing upwards and making your requirements and concerns clear at a very early stage.

In my opinion the dichotomy of tough but fair/nice but inaccurate feedback is a false one. Most feedback is rushed, muddled, partly correct, partly irrelevant, partly insightful and still useful if you know how to mine it.

Re: A Million Lines of Bad Code

#106
post #68

Earlier quoted context omitted.

Don't you feel patronized when people do that though? Be as rude as you want to me, as long as you're correct. As for myself, I tend to not call out the positive parts of something, because that's sort of implicit. I would not bother to point out that the file reading code is wrong if the whole thing was broken. I admit I'm probably incorrect here, but I notice people try this "say something positive" and it really c…

I gotta wonder, do you actually have such confidence yourself that you assume that everything other people _does not_ comment was good? If so congratulations! A suggestion though, on how you could improve the confidence in people like me - who aren't sure everything not mentioned is good - would be to actually point out the positive parts even if you don't feel that it is necessary. I have to admit though, it took ma…

tangential comment:

> I gotta wonder, do you actually have such confidence yourself that you assume that everything other people _does not_ comment was good? If so congratulations! A suggestion though, on how you could improve the confidence in people like me - who aren't sure everything not mentioned is good - would be to actually point out the positive parts even if you don't feel that it is necessary.

If you learn another language (a human language), and try to practice it with native speakers, you'll quickly notice that they never comment on your correct grammar. (It's not exactly common for people to comment on incorrect grammar either, but it can happen.) The only way to learn that your phrasing was correct is to ask outright, or observe someone producing an exact analogue of your sentence. This is a source of great aggravation to me, but things couldn't reasonably be any other way -- most of the correct stuff people say is stuff that they already knew was correct.

Re: A Million Lines of Bad Code

#107
post #6

I recently read the book "How to Win Friends & Influence People", bad title great book. My main take away from this is I've been talking to people really badly for the last 27 years. I wish I had read this book in middle school. But this blog reminded me of some of the concepts from the book, its far more productive to give positive encouragement than to give negative feedback, and just adding a complement isn't enou…

I like teaching. I don't think I'm amazing at it, but I like sharing knowledge and experience with my friends and co-workers and see them improve, or just sometimes for the abstract sense of helping. Of course, sometimes I fall flat and come across as arrogant or condescending, but I hope that's rare. I read "How to make friends" a long time ago, and I apply those rules diligently to my interactions with people. Rece…

I had the same problem with a past coworker, a "how is this person being paid to work with technology in any capacity" person doing development and having never learned how to read graphs ("the CPU is at the top of the graph, so that is the cause of the performance problem" was common). Or knowing that Excel could do visualizations of data. And I found myself doing the "Blatantly type their question into google right in front of them and click on the first link" thing and being super short and RTFM-y which made me feel bad afterward. But so resentful.

Re: A Million Lines of Bad Code

#108
post #6

I recently read the book "How to Win Friends & Influence People", bad title great book. My main take away from this is I've been talking to people really badly for the last 27 years. I wish I had read this book in middle school. But this blog reminded me of some of the concepts from the book, its far more productive to give positive encouragement than to give negative feedback, and just adding a complement isn't enou…

I like teaching. I don't think I'm amazing at it, but I like sharing knowledge and experience with my friends and co-workers and see them improve, or just sometimes for the abstract sense of helping. Of course, sometimes I fall flat and come across as arrogant or condescending, but I hope that's rare. I read "How to make friends" a long time ago, and I apply those rules diligently to my interactions with people. Rece…

How was the gentleman 'assigned' to help you?

Did the assigner spend enough time with the remote worker to understand the skill level?

In your organisation, is it OK to report a skill mismatch like this up the chain?

Summary: this is a management issue I think

Re: A Million Lines of Bad Code

#109
post #58

> Building a string with a series of concatenations like this is extremely inefficient No. Not in Java since 1999 or so.

In special cases multiple string concatenations can be optimized into using a StringBuilder calls. Not in the general case.

I'd say in the general case multiple string concatenations can be optimized. Not in special cases.

Re: A Million Lines of Bad Code

#110

> So I wrote a Perl script that read in the file, combined it, and printed it out as a single line. Then I had my Java program call the Perl script through the command line, capture the printed output, and save that as the string. When I first started (in Python), I didn't understand what a function was, but I wanted my program to react differently depending on user input, and had some conception that I should be bre…

The result was still great though, wasn't it? You made the computer do what you wanted and it was probably better than doing it by hand.
Post reply on HN