TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Going Fast Slowly

137 pointsby mroover 9 years ago

9 comments

kazinatorover 9 years ago
Looking at the static picture is somewhat misleading. The lines of code you see in the current baseline snapshots are not all the lines that were ever written for that project.<p>A fairly large and extensive commit <i>affecting</i> many lines can have a small impact on the absolute number of lines (which can even shrink). We <i>change</i> as well as <i>delete</i> existing lines, not only add new ones.<p>The lines which are replaced by new lines should be regarded as deleted lines, and so the figure of how many lines there are now should be supplemented with how many lines were deleted since the beginning of the project: how many additional lines of code exist in the repo&#x27;s history, which no longer appear in the current baseline.<p>The invisible lines that disappeared in the history are the underpinning for the current lines; they enabled the new lines to be figured out, which took work. Someone had to write each line, and it has to be counted in the LOC output.<p>It is not entirely clear cut. If you make a trivial change in some existing line, it&#x27;s not the same thing as a brand new line. Yet, according to the line-based diff tools, it looks like a deletion and addition of an entire line. Minus this, plus that.
bluedinoover 9 years ago
&gt;&gt; Varnish has been in existence for 10 years, so that&#x27;s 15K lines per year. 200 workdays a year makes that 75 lines a day. <i>7.5 hours of work per day gives 10 lines per hour.</i><p>You can&#x27;t really say that, though.<p>Let&#x27;s roll back the clock to when the project was new and say, only 10k lines of code. Maybe that first 10k was written in a month. Fleshing things out, then adding features like crazy. Coding in a euphoric state.<p>Once you&#x27;ve reached a certain amount of code, you&#x27;re doing maintenance. Fixing bugs. Re-factoring code. I can see 10 lines of code per day. I notice that in my own projects. I might write a few thousand lines in a week and then as time goes on, I write a few hundred, then a few tens, then maybe just a couple edits.
评论 #11214012 未加载
评论 #11213192 未加载
bronsonover 9 years ago
&quot;I no longer think about code lines as an asset to be accumulated, but rather as an expenditure to be avoided.&quot;<p>Good quote. Took me until my 30s before I started realizing this myself. Seems obvious in retrospect.
评论 #11213327 未加载
评论 #11213291 未加载
评论 #11232715 未加载
评论 #11213340 未加载
bracewelover 9 years ago
&gt; The two CVEs against Varnish were both utterly bogus &quot;trophy-hunter&quot; CVEs in my opinion. (But don&#x27;t take my word for it, judge for yourself.)<p>ok<p>&gt; CVE-2013-4484: Varnish before 3.0.5 allows remote attackers to cause a denial of service (child-process crash and temporary caching outage) via a GET request with trailing whitespace characters and no URI.<p>:|
_snydlyover 9 years ago
&gt;&gt; And eventually I no longer think about code lines as an asset to be accumulated, but rather as an expenditure to be avoided.<p>Maybe I&#x27;m a bit odd, but I got into programming with code golf, using lots of J, K, and others. So my growth has been the opposite. It was just last year that I realized it&#x27;s okay (and maybe necessary?) for other people to read&#x2F;understand my scripts.
评论 #11213747 未加载
评论 #11213745 未加载
kazinatorover 9 years ago
Slovak proverb: &quot;ponáhľaj sa pomaly&quot; -- Be not hasty, when you hurry.
评论 #11213496 未加载
评论 #11221385 未加载
评论 #11214590 未加载
FrankyHollywoodover 9 years ago
EWD talks about lines of code as &quot;lines spent&quot; instead of lines produced, this is 1988 :)<p><a href="https:&#x2F;&#x2F;www.cs.utexas.edu&#x2F;~EWD&#x2F;transcriptions&#x2F;EWD10xx&#x2F;EWD1036.html" rel="nofollow">https:&#x2F;&#x2F;www.cs.utexas.edu&#x2F;~EWD&#x2F;transcriptions&#x2F;EWD10xx&#x2F;EWD103...</a>
0x07c0over 9 years ago
I really like Douglas McIlroy concept of negative code<i>.<p>Also, the varnish source is really nice! Pen kode ;)<p></i><a href="http:&#x2F;&#x2F;programmers.stackexchange.com&#x2F;questions&#x2F;103807&#x2F;what-is-negative-code" rel="nofollow">http:&#x2F;&#x2F;programmers.stackexchange.com&#x2F;questions&#x2F;103807&#x2F;what-i...</a>
sosukeover 9 years ago
Using git can you also see the times a single line was changed? I bet the numbers jump quite a bit. Sure you&#x27;ve got a 200 line program but over time you&#x27;ve written 20k lines!