TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Good programmers aren’t lazy

48 点作者 r11t超过 16 年前

10 条评论

tome超过 16 年前
Again, confusion is the result of describing two different things with the same word:<p>1. Desiring efficiency, so one can achieve more with less effort.<p>2. Not wanting to think very hard, and putting off difficult decisions.<p>This article argues that programmers aren't number 2. I'd agree. Others argue that programmers <i>are</i> number 1. I'd agree. There's no conflict here, just confusion!
评论 #473442 未加载
评论 #473502 未加载
评论 #473412 未加载
swombat超过 16 年前
I was going to disagree with this article until I actually took the time to read it.<p>Sapir-Whorf says that the words we have available to us (and choose to use) influence the way we think. Perhaps "Good programmers are lazy" is, in that respect, using the wrong word. Perhaps it encourages the wrong habits of thought, and a better choice of words would have a beneficial effect.<p>Then again, perhaps the problem is due to the incompleteness of the quote. It's not laziness in isolation that works, but "laziness, impatience, and hubris", quoting Larry Wall.<p>An arrogant programmer would not copy and paste the same function 40 times - it would hurt his sense of self-worth. Perhaps what works is the three "qualities" together, rather than in isolation.
评论 #473432 未加载
jimbokun超过 16 年前
I'm probably pointing out something obvious here, but I don't see any other comments mentioning it yet.<p>Larry Wall was trying to employ humor to get a point across. By coming up with three negative character traits and finding a way to plausibly make them sound like positive character traits, he got attention because his choice of labels was so surprising. If that causes someone to be curious enough to read more and think about what he is saying, edification can result. If he had just laid out the same principles without the surprising labels, he would have gotten much less attention.<p>The danger, as with any joke, is people not "getting" it. I think that is what this article warns against. People not in on the original joke, might think that you want to be lazy in the conventional sense. Or, worse still, someone might use Wall's quote to defend their own, (conventionally) lazy behavior. Kind of like someone watching All in the Family and not getting that Archie Bunker is not meant as a positive role model.
kaens超过 16 年前
People who say <i>Good programmers are lazy</i> are obviously using the word in a different context than what the author of this article is talking about. She even mentions this.<p>She then proceeds to say that it's a "cry for attention", like a skinny girl calling herself fat. It is not, it is an honest statement, and frankly the meaning of it isn't far from the classical definition of laziness.<p>You know why I write shell scripts? It's not because I'm concerned about clarity, or modularity, it's because I don't want to type "dhcpcd -k wlan0 &#38;&#38; iwconfig wlan0 essid $ESSID &#38;&#38; dhcpcd wlan0" more than once. This is why people have made things like paste, or abbrevs.<p>When I'm writing application code, sure I'll be more concerned with clarity, modularity, efficiency, and the rest of it than I am when I'm basically pasting some command commands into a script - but a good bit of the abstraction that I do in application code also stems out of laziness. I just don't want to type that shit in again, if only a little bit of it would change. Laziness is one tool I use to discover abstractions worth having.<p>Sure, copy-and-paste works too - but that's only laziness in the short-term, and often generates an assload of work in the long-term. Most people who have been writing code for any length of time know this.<p>I'm lazy for the long-haul.<p>She's correct that simplicity and elegance are hard, and that striving for them is not lazy. I can tell you that some of the repetition-saving abstractions I have made before are neither simple nor elegant, and didn't take much striving.<p>I don't think that anyone ever claimed that good programmers are <i>just</i> lazy. Laziness without that strive for simplicity/elegance/clarity leads to hard to maintain code. However, I have yet to meet a coder that I had any respect for that didn't twitch and the prospect of having to perform the same task on a computer more than twice though - and that's because that means it could be <i>automated</i>, and they "didn't want to have to do that shit over and over", not because there was necessarily a beautiful abstraction to be found there.<p>But uh, yeah. That probably sounded a lot harsher than I intended it to. I think I should get some sleep now.
andr超过 16 年前
Laziness is different for different folks. It's like using VIM - just a question of intelligence. If you are relatively smart, you can quickly come up with a complex VIM command sequence to do what you need. Otherwise, you copy and paste for 5 minutes, because that's quicker (or at least you think it's quicker, which is even worse).<p>Same with programming - if you are a good programmer, it's quicker for you to invent and refactor then to copy and paste, so you do that. Only in that case is laziness good.
artlogic超过 16 年前
Long term laziness and short term laziness aren't the same thing. Good programmers are willing to sacrifice in the short term (work really hard) to be lazy in the long term (have the computer work really hard for them). Like learning Emacs or VIM - you work hard in the short term to work less in the long term. Like almost all things in life, having a long term view of things makes short term sacrifices seem less painful.
weavejester超过 16 年前
If I recall my Camel Book correctly, Larry Wall called what the article describes as "False Laziness". Copy-and-pasting code will save you time in the short term, but probably cost you time in the long term. If laziness is about minimizing effort, then a truely lazy person will take the time to do things correctly so that he or she has less to do later on.
评论 #473712 未加载
评论 #473994 未加载
vlad超过 16 年前
What he describes is not programming.<p>"Laziness makes you not mind if you copy and paste a function 40 times without abstracting it. Laziness lets you avoid figuring out how to do something better, because you really don’t want to think about it. Laziness lets you put off finding a solution, copy code without understanding it, hard-code values in your applications, or stuff inline css in your html tags ‘just for now’."
Terhorst超过 16 年前
There's good lazy and there's bad lazy. The author of this article is confusing the two.
评论 #473404 未加载
alnayyir超过 16 年前
Well duh. I wasn't worried anyone took that little fad seriously.