Live data from Hacker News

A Million Lines of Bad Code

varianceexplained.org

21–30 of 123 posts

Re: A Million Lines of Bad Code

#22
post #20

1000000 lines of bad code is a bit of an exaggeration. Many (most?) programmers never write that much code in their entire careers. I've heard 10000 LOC as a milestone for REALLY learning a language (once you're familiar with programming in general), I'd say it's on that order of magnitude for writing non-terrible code in general.

It's just a figure of speech, and catchier than 10K.

Re: A Million Lines of Bad Code

#23
More important than good code is shipped code.

I'd say about half my bad code is due to inexperience, what the post is referring to. As time goes on it DOES get better, especially since -- like most of you -- I'm constantly reading and trying to improve my skills.

The other half of my bad code is due to time constraint. This is either because a quick hack is needed, or the proper planning time is not allocated to do a proper job.

This leads me back to my initial statement. Sometimes you just need to get the job done. If you're not good enough to do it right, but you hack it and it works, that's good enough for now.

This is how systems get built poorly and bloat up, but there are deadlines and requirements that need to be met, and if you never ship, you'll never get the budget to rebuild that old system you allowed to get unwieldy. It's a constant struggle to balance quality, functionality, and deadlines.

Re: A Million Lines of Bad Code

#24

Earlier quoted context omitted.

"Hey pretty cool program! Its a great start. I bet we can make it run faster if we changed the way files are imported to something like this... nice work" I usually hear this referred to as a "criticism sandwich": Criticism surrounded on either side with compliments.

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

What's weird is that even though I know this is a "trick" I still want people to talk to me that way unless I specifically ask them for the hard truth.

Re: A Million Lines of Bad Code

#25
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…

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 comes off wrong. Or maybe I don't notice when they do it well.

Re: A Million Lines of Bad Code

#26

Earlier quoted context omitted.

"Hey pretty cool program! Its a great start. I bet we can make it run faster if we changed the way files are imported to something like this... nice work" I usually hear this referred to as a "criticism sandwich": Criticism surrounded on either side with compliments.

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.

Re: A Million Lines of Bad Code

#27
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…

Yes! this book changed my life. It is amazing how many are not aware of the amount of criticism that they output, willingly or unconsciously.

Re: A Million Lines of Bad Code

#28
post #8

Thought his was talking about win95 or win98...

Windows ME? In all seriousness I've witnessed people shame over bad code, yet later when other people looked at their code was just was bad. We all write bad code, hopefully we're able to make it less bad the more we write it.

:) think you're the only one that could find the irony out of it!

Re: A Million Lines of Bad Code

#29
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…

> "You're reading in files completely wrong, try googling for a better solution" which unfortunately among engineers seems to be the most common reply.

I can empathize with this because I feel like saying this all too often. I guess it's a mentality of "teach a man how to fish". I guess I could use a reading of "How to Win Friends & Influence People".

Re: A Million Lines of Bad Code

#30
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…

The main difference in your example is talking about the code instead of talking about the person.
Post reply on HN