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.

You've only added two lines – why did that take two days?

964 pointsby gregdoesitalmost 5 years ago

104 comments

caymanjimalmost 5 years ago
A variant of this that has driven me to quit more than one job is having a non-technical manager look at a UI prototype and consider that 90% of the solution. "The UI guys had this page ready two months ago! Why doesn't this work yet?" It's even worse when you present a working prototype. They simply don't understand that the backend functionality is what's doing the bulk of the work, and just because you can see something, that doesn't mean it's secure, performant, scalable, or even functional beyond demoing with dummy data.
评论 #23837406 未加载
评论 #23840061 未加载
评论 #23839654 未加载
评论 #23836991 未加载
评论 #23838189 未加载
评论 #23838094 未加载
评论 #23839223 未加载
评论 #23837643 未加载
评论 #23843074 未加载
评论 #23838006 未加载
评论 #23842511 未加载
评论 #23838009 未加载
评论 #23840036 未加载
评论 #23843281 未加载
评论 #23838827 未加载
评论 #23841833 未加载
评论 #23837675 未加载
评论 #23840361 未加载
评论 #23839013 未加载
评论 #23839557 未加载
评论 #23840952 未加载
评论 #23841717 未加载
评论 #23842215 未加载
评论 #23841098 未加载
评论 #23848106 未加载
评论 #23838795 未加载
评论 #23840051 未加载
评论 #23839202 未加载
评论 #23837676 未加载
评论 #23841457 未加载
评论 #23841759 未加载
评论 #23840278 未加载
评论 #23843987 未加载
评论 #23840294 未加载
评论 #23842112 未加载
评论 #23840711 未加载
评论 #23836846 未加载
评论 #23839064 未加载
rubyn00biealmost 5 years ago
Oh this reminds me of what went from one of the most infuriating questions I would get asked by investors to one where I almost wanted to bait them into asking it...<p>&quot;Why&#x2F;how is this worth X dollars&#x2F;time? I know someone who says they can do it in a week.&quot; To which, I eventually learned to reply: &quot;Wow, well... In that case, let me shoot you an article on how to build a Twitter clone in 15 minutes. [awkward pause while I smile at them] There&#x27;s a lot more than just literal lines of code that goes into building a successful software product.&quot;
评论 #23842806 未加载
评论 #23838033 未加载
评论 #23838089 未加载
elnygrenalmost 5 years ago
An alternative take to this article would be that this person wasted two days because he was reluctant to ask more questions from the person who filed the bug report.<p>How often do you actually receive quality bug reports at work? My experience is that external or internal users almost never provide sufficient information and you as a coder are always expected to drill down on what they reported with a barrage of questions.<p>ie. if you are not doing <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Five_whys" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Five_whys</a> then you might be doing it wrong and wasting time because of it.<p>I&#x27;m referring to this:<p>&gt; Some developers would have immediately gone back to the person reporting the problem and required more information before investigating. I try and do as much as I can with the information provided.<p>Which seems like being stubborn and making a mistake because of it.<p>Couple other parts also seem a bit overdoing it:<p>&gt; Because I investigated if there were other ways of getting to the same problem, not just the reported reproduction steps. &gt; Because I took the time to verify if there were other parts of the code that might be affected in similar ways.<p>These seem like taking a gamble. Maybe something comes up, but is it more probable that this work should be minimised until there is more proof of &quot;other ways of getting to the same problem&quot;? Developer time is expensive, is this really the best way of using it? Would it make sense to just fix the issue at hand and only put in more time if more bug reports come in after the fix or if there is some other indication that this part of the code might be more broken?
评论 #23843662 未加载
评论 #23842972 未加载
评论 #23842453 未加载
kevsimalmost 5 years ago
Do people actually have fights like this with management at their companies? Not trying to knock the author, but I&#x27;m just surprised anyone would actually hear this kind of comment in 2020. I&#x27;d think by now any and all metrics tying lines of code to productivity would be long dead.
评论 #23837574 未加载
评论 #23836443 未加载
评论 #23838527 未加载
评论 #23836617 未加载
评论 #23840285 未加载
评论 #23836460 未加载
评论 #23836491 未加载
评论 #23836473 未加载
评论 #23837905 未加载
评论 #23837642 未加载
评论 #23837704 未加载
评论 #23837002 未加载
评论 #23836940 未加载
评论 #23839327 未加载
评论 #23843540 未加载
评论 #23837669 未加载
评论 #23836770 未加载
评论 #23836433 未加载
评论 #23836342 未加载
评论 #23839382 未加载
评论 #23836436 未加载
snidanealmost 5 years ago
&quot;My point today is that, if we wish to count lines of code, we should not regard them as “lines produced” but as “lines spent”: the current conventional wisdom is so foolish as to book that count on the wrong side of the ledger.&quot;<p>~ Edsger Dijkstra
评论 #23841594 未加载
mirekrusinalmost 5 years ago
This is achilles heel of non-tech managers. You can link as many articles like that as you want, it will still be a problem. They may be more aware of it, but it will still be, daily struggle. Non-tech manager should be paired with tech-lead with high trust relationship for this not to be a problem.<p>This example is just one case&#x2F;symptom of much larger problem.<p>Non-tech managers will only see fast progress on combination of: - poor developer - doing fast progress - with shitty code - on good quality codebase<p>They will see tech lead&#x2F;good coder as asshole in general, with poor performance in general, who for some unknown reason is respected for their code and sometimes magically ticks off hard problems quickly which &quot;must be a coincidence, overestimated work to begin with or something like that&quot; on combination of: - person who actually cares about the project - who repairs shitty code&#x2F;tech debt - who thinks more deeply about the problem - and as a bigger picture issue, not just ticking off ticket with the lowest resistance possible - writes good quality code - if the problem breaks current abstrations, refactors abstration itself - who cares about readers of the code
评论 #23840290 未加载
评论 #23839737 未加载
ww520almost 5 years ago
The one that drives me up the wall is the schedule&#x2F;cost anchoring question, &quot;this should be easy to do, right?&quot; every time they asking for a new feature. It&#x27;s set to manipulate you to lower the schedule or the cost. If you say it&#x27;s not easy, they would question your competency. If you say it&#x27;s easy, they would say, well then you can get it done this week.<p>It always gives me a pause, and then I would double the schedule.
评论 #23839527 未加载
评论 #23839533 未加载
评论 #23858283 未加载
评论 #23839501 未加载
评论 #23843588 未加载
newshortsalmost 5 years ago
The assumption that asking for more information to recreate the bug is a lazy tactic to get out of the bug fix is also a terrible assumption and discredited the opinion IMO.<p>Often times asking for more information can speed things up and lead to a quicker resolution.
评论 #23836978 未加载
评论 #23836677 未加载
评论 #23837555 未加载
评论 #23836399 未加载
评论 #23837121 未加载
评论 #23841347 未加载
评论 #23836663 未加载
评论 #23837190 未加载
pdpialmost 5 years ago
“I’m sorry for the long letter, but I didn’t have the time to write a shorter one.”
rmasonalmost 5 years ago
Because I had to explore all the things that wouldn&#x27;t work before finding the two lines that did.
评论 #23836453 未加载
rburhumalmost 5 years ago
My most challenging bug was fixing a memory overwrite of a COM reference counter (of all things!) that would only happen under very rare conditions - when a 3rd party C library that was compiled with different calling convention would be called with a certain amount of parameters. It took me a month to chase down - frankly, it would have been impossible for me to figure out if Visual Studio did not have <i>data</i> breakpoints implemented for C++. It took a month... and the fix was also a two-liner. Still proud of that fix 17 years later!
评论 #23844856 未加载
dev_tty01almost 5 years ago
-2000 lines of code. <a href="https:&#x2F;&#x2F;www.folklore.org&#x2F;StoryView.py?project=Macintosh&amp;story=Negative_2000_Lines_Of_Code.txt" rel="nofollow">https:&#x2F;&#x2F;www.folklore.org&#x2F;StoryView.py?project=Macintosh&amp;stor...</a>
评论 #23842079 未加载
phreackalmost 5 years ago
It&#x27;s like the old story of the engineer who charged 10k to fix a loose screw[0]. It&#x27;s not just the obvious effort, it&#x27;s the effort behind the experience and know-how to recognize and find the most appropriate fix for the problem.<p>[0]<a href="https:&#x2F;&#x2F;www.snopes.com&#x2F;fact-check&#x2F;know-where-man&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.snopes.com&#x2F;fact-check&#x2F;know-where-man&#x2F;</a>
srikualmost 5 years ago
One solution to the OP&#x27;s problem is to continuously document the activity leading up to those two lines of code. That way you can point to the notes and say &quot;here&#x27;s why&quot; .. and I&#x27;ve found that quite often justifiable and shows you&#x27;ve not been goofing off. Furthermore, it also helps someone who&#x27;ll have to look at those two lines later on to grab some context and understand why they&#x27;re there.<p>This could be as simple as notes logged against an issue about experiments done, etc.
评论 #23842123 未加载
abalashovalmost 5 years ago
There&#x27;s no paradise anywhere. I&#x27;ve been self-employed for 13 years in a rather niche area, as an involuntarily solipsistic army of one for lack of ability to grow my business. Most of my customers are highly technical, but don&#x27;t understand what I do quite enough to have a &quot;lines of code&quot; resolution on it.<p>I wish they _would_ ask me why those two lines took two days (in my case, it might be simple burnout; been coding for too long, and longer than a more conventional career track would have prescribed). Instead, nobody much cares whether I write 2 lines of code or 2000; same difference to them, and boils down to the all-important &quot;delivering&quot;.<p>There&#x27;s some intellectual and creative freedom in that which I suppose folks don&#x27;t have with a code-involved boss who scrutinises their commits. But the opposite--nobody scrutinising your commits--isn&#x27;t all it&#x27;s cracked up to be, either. I almost never have to explain why I did something a certain way to anyone, not because I&#x27;m so important and command so much distinction or recognition of my expertise, but because nobody gives a crap. :-)
arnvaldalmost 5 years ago
Oh, that reminded me of my &quot;two lines&quot; moment. Years ago I was writing software for some university project, and one feature took me a few days to figure out and implement, and when I checked the diff I realized that &quot;all&quot; it took was removing some 20 lines of code. I literally added a feature by removing some constraints that I had previously introduced.
评论 #23838296 未加载
whoisjuanalmost 5 years ago
If someone is measuring productivity in code, based on the amount of lines of code written, then they have never written code. Anyone with a tiny understanding of how programming works would totally get why something so small could take so long.
评论 #23837013 未加载
评论 #23838156 未加载
eikenberryalmost 5 years ago
&gt; I don&#x27;t like having to fix bugs.<p>???<p>I rather enjoy fixing bugs, particularly really hard ones. They can be fun logic puzzles that take some sleuthing to figure out and offer multiple pay outs... First time reproducing it. Figuring out the problem. Figuring out the best fix. Test case fail -&gt; test case pass.
评论 #23839347 未加载
rurpalmost 5 years ago
This article made a number of great points.<p>&gt; I know some developers don&#x27;t like having to fix bugs, and so do whatever they can to get out of it. Claiming there isn&#x27;t enough is a great way to look like you&#x27;re trying to help but not have to do anything.<p>God, this behavior has annoyed me so much at times. I&#x27;ve worked with a few developers that were not bad overall, but would use the slightest excuse to punt on fixing an issue they were tasked with but didn&#x27;t want to track down. Regularly weaseling out of tasks like this wastes the time of multiple people and either ends up back with the original dev or gets dumped on a more responsible worker.<p>&gt; Because I took the time to verify if there were other parts of the code that might be affected in similar ways.<p>Not looking for other places in the code that are very likely to be affected by the same issue is bafflingly common, in my experience. Although I would say that managers are much more often to blame for this behavior than the devs. Any workplace that puts less weight on fixing an issue well than on artificial metrics like number of tickets closed is incentivizing exactly this type of behavior. Why bother getting criticized for spending all day fixing a simple bug the right way when you can fix 5 different iterations of that same bug and close 5 tickets in the same amount of time?
评论 #23840518 未加载
评论 #23839234 未加载
adrianmonkalmost 5 years ago
You&#x27;ve only rendered one two-word verdict -- why did that take five days of deliberation? You had twelve people working on it!
otikikalmost 5 years ago
Those two lines took two minutes to write.<p>Knowing which lines to add, and where, took 25 years of experience.<p>That&#x27;s what you are paying.
评论 #23842804 未加载
kmcleanalmost 5 years ago
&gt; I know that reporting errors can be hard, and I&#x27;m grateful for anyone who does. I want to show appreciation for error reports by trying to do as much as possible with the information provided before asking for more details.<p>This might be coming from a noble place but sounds a little like shooting yourself in the foot. Bugs that can be reliably reproduced are the easiest to fix, and I&#x27;ve found the quickest way to get to a set of reliable reproduction steps is just to ask exactly what the user was doing when the problem happened. They don&#x27;t always remember, but often do. Sometimes they even remember the time, which can be really useful for digging through logs, which otherwise are too voluminous to be relevant.<p>Maybe it&#x27;s a cultural difference. But maybe we could &quot;show our appreciation&quot; for the bug report by just saying so (&quot;Thank you so much for taking the time to report this issue. Users like you play a big role in helping us improve our software&quot;), instead of soldiering on in the dark for 2 days.
jedbergalmost 5 years ago
It’s not just management that feels this way. A lot of junior engineers feel the same way. It’s what leads to bloat because they assume “it can’t be right” if it’s just a small change.<p>It takes a while for a lot of junior engineers to realize small elegant solutions are better, and requires good mentorship and code review to get there.
RandomInteger4almost 5 years ago
Because I procrastinated due to the overwhelming complexity overloading my mind with the myriad scenarios resulting from those two necessary lines and my lack of experience with this scenario depriving me of the intuition necessary to prune the aforementioned tree of mental complexity in an efficient manner.
评论 #23836370 未加载
not2balmost 5 years ago
I recall a story about someone at a government contractor who did a major refactoring and removed thousands of lines of code from a project, increasing its performance, only to be told by management that they&#x27;d signed a contract that said the company got paid by lines of code delivered, and his improvement would cost them tens of thousands of dollars, so revert the whole thing.
评论 #23837843 未加载
评论 #23837650 未加载
glouwbugalmost 5 years ago
What if a single line change, given it took 2 weeks, fixed 40% of your crash rates? That fix alone is worth millions, almost 100x - 1000x the engineer&#x27;s hourly salary in down time.
评论 #23836672 未加载
notsag-hnalmost 5 years ago
The only mistake of the procedure is that if you don&#x27;t have enough info you should ask for help before. This is very common and I have done that so many times to understand it&#x27;s a waste of time. The only exception IMO is when you really need to understand certain parts of the codebase at a very low level so spending time solving things by yourself it&#x27;s well worth as an exercise and helps a lot. If it&#x27;s a part of the codebase you&#x27;re not likely to be working on any time soon, just don&#x27;t do it. Talk to whom reported the bug and also talk to the last person that worked on that piece of code (git blame is your friend here)
kabdibalmost 5 years ago
One of my favorite bug fixes took me two weeks to find, and the fix was to swap two assembly language instructions (this was a bug in the Apple Newton context switch code, and swapping the instructions let timer interrupts happen reliably, which is kind of important for thread scheduling). We&#x27;d been having intermittent problems for months, with no smoking gun. I got mad at it, and found it.<p>No one was upset at the fix -- if anything, the checkin&#x27;s brevity communicated its correctness -- and I got a couple of pats on the back for it.
TallGuyShortalmost 5 years ago
I would add: &quot;Because we keep punting on our tech debt, and our infrastructure is so bad that after I spent 2 minutes writing the code, it took 2 days to get it tested, committed and deployed and deal with the fallout&quot;
addicted44almost 5 years ago
If the reporter hasn&#x27;t provided enough information to recreate the issue (it&#x27;s obviously not a major deal breaking issue otherwise it would be obvious and easy to recreate) and they are internal to the company, tell them to provide more information before moving forward.<p>The author&#x27;s approach is good for external bug reports, but they don&#x27;t clarify that&#x27;s indeed the case here.<p>I have to strongly appreciate the author for finding the root cause and tackling that instead of the symptom.<p>So often, especially in front end coding, you will see an exception being thrown because of a null value being passed in, and the &quot;fix&quot; checked in by the developer basically returns the default value if null is passed in, when they should be investigating and fixing why a null was passed into the function in the first place.<p>If your function has a contract that forbids nulls from You resolve the immediate bug, but this almost certainly leads to multiple bugs being created in the future (or worse, something that is quietly wrong, because 1 row in a 100 row table is missing and no one noticed) until the root issue is resolved.
Piskvorrralmost 5 years ago
Reminds me of that time a PHB decided to measure efficiency by kLOC. All the pull requests in the following week had a net negative line count.
评论 #23836631 未加载
BurningFrogalmost 5 years ago
Conclusions:<p>1. Picking a good manager is very important!<p>2. Communicating with your manager is very important!
评论 #23836926 未加载
lavametenderalmost 5 years ago
+2 lines? That&#x27;s rookie numbers! <a href="https:&#x2F;&#x2F;www.folklore.org&#x2F;StoryView.py?story=Negative_2000_Lines_Of_Code.txt" rel="nofollow">https:&#x2F;&#x2F;www.folklore.org&#x2F;StoryView.py?story=Negative_2000_Li...</a>
评论 #23842702 未加载
ilyas121almost 5 years ago
One time I spent 3-4 months working on a project that amounted to adding 11 lines of code to a config file on kubernetes. Tbh, a lot of it was bad communication, but it was also because I wrote and rewrote so much of the same code.
slaymaker1907almost 5 years ago
I’d rather write 2000 lines in two days since if I’ve only written 2 lines, figuring out those 2 lines must have been miserable.
评论 #23839681 未加载
caseymarquisalmost 5 years ago
Let&#x27;s not forget meetings. Advising on sales. Talking with customers about new features. Helping out tech support and services. Traveling to customer sites to review specialized requirements.<p>Or the real reason it takes 2 days is that the code base is a big ball of unbuttered spaghetti with no tests.<p>I was lucky enough to be able to rewrite a couple of products from scratch with the benefit of hindsight. When the code is loosely coupled and well organized, it&#x27;s rare for any of the reasons listed in the article to stall development. When the code base evolved unpredictably over a couple decades, the article is spot on.
m4rtinkalmost 5 years ago
Two lines ? Bah, a one line fix took me 5 weeks once!<p>(issue deep in the storage stack with exotic hardware only available at a customer with all debugging going ping-pong over an issue tracker between me and a customer engineer)
jerzytalmost 5 years ago
This is a great write-up. This is real life. And then you get a corporate dude berate everyone and ask: what are you doing to make sure that it never happens again? And I always want to respond that &quot;I can guarantee that the same thing won&#x27;t happen again, but something very similar will happen, if you won&#x27;t assign sufficient resources to fix the real problem, instead of putting on a band-aid. And you won&#x27;t even know the difference.&quot;<p>I think the OP covers this case very well.
mro_namealmost 5 years ago
E = m c² is just three letters and a bit of gutter, how long could that possibly take to figure out?
评论 #23841862 未加载
mastazialmost 5 years ago
I agree with the general sentiment of the article, but the following is a big mistake IMHO:<p>&gt; Some developers would have immediately gone back to the person reporting the problem and required more information before investigating. I try and do as much as I can with the information provided.<p>Some developers have a hard time with interpersonal communication but you can&#x27;t isolate yourself if you&#x27;re working in an org. That mindset will inevitably make you less effective (I learned that the hard way).
dspillettalmost 5 years ago
<i>&gt; You&#x27;ve only added two lines – why did that take two days?</i><p>If this is hard for them to understand, the confused look when you reveal a change was a net removal of lines&#x2F;statements must be amusing!<p><i>&gt; Because the issue was reported with a vague description of how to recreate it</i><p>This is something my current management fully understands, but I wish we could get through to our clients. Short of being actively rude about bad requests I&#x27;ve run out of ideas over the years. Luckily these days we are big enough that I usually have a bit of a shield (provided first line support people and BAs who I trust) between me and direct client contact.<p>I&#x27;m quick to put tickets on hold as &quot;needs more information&quot;, and been around long enough that I&#x27;ve developed the confidence to respond to &quot;this is urgent, there is an SLA&quot; with &quot;and that service level agreement covers a minimum level of reporting from you before even an urgent matter can be progressed&quot; or more facetiously &quot;then it is urgent that you furnish me with the information requested&quot;, but while they <i>accept</i> it each time they never <i>learn</i> to give better details up-front next time - we still get reports of &quot;an error&quot; or something &quot;not working&quot; or, even worse, the open-ended question &quot;is there a problem with...?&quot;.<p>Obviously this can&#x27;t be applied to truly urgent issues, but they are usually massive problems that we are already aware of and working on before the client contacts us because, for instance, we&#x27;ve had an alert that something is down (sometimes we tell the client about an issue and resolution ETA before they notice, which they seem pleasantly surprised by and thankful of).
评论 #23843320 未加载
not2balmost 5 years ago
Too bad about the low-contrast gray on white text. It is a source of eyestrain.
评论 #23837438 未加载
评论 #23837577 未加载
femiagbabiakaalmost 5 years ago
<a href="https:&#x2F;&#x2F;speakerdeck.com&#x2F;jallspaw&#x2F;findings-from-the-field-devops-enterprise-london-2020?slide=6" rel="nofollow">https:&#x2F;&#x2F;speakerdeck.com&#x2F;jallspaw&#x2F;findings-from-the-field-dev...</a><p>this reminded me quite a bit of this deck -- in particular, a focus on a shallow metric (in this case LoC) as a proxy for measuring complexity.
dllthomasalmost 5 years ago
One of my favorite contributions involved two commits: one that added 5 lines, another a bit later that removed a different 5 lines. This was after more than a week of building tiny models to understand how the system might behave. Thankfully I was on a team that appreciated it, although the reduced load on on-call quickly drove the point home :)
zabzonkalmost 5 years ago
Nobody should manage programmers who is not themselves a very experienced programmer. Otherwise, you are in Dilbert Country.
评论 #23837592 未加载
Slartiealmost 5 years ago
&quot;Because I had to spend a lot of time to compile this long list of things that I also did while fixing the problem which are essential for a good solution but aren&#x27;t immediately visible from the two lines I actually added so I would have something in hand to rebut this stupid question of yours!&quot;
whotheffknowsalmost 5 years ago
Because product managers struggle to comprehensively understand value add and have instead replaced stating business goals and value add with bullying based micro managing tactics like counting lines of code and conflating other such arbitrary metrics related to code with having a 1:1 ratio of accomplishing the goal and do not respect the thought of troubleshooting, architecture design (unless you take another two days to turn it into a diagram presuming it needs to be consumed by some other party) and finding an elegant way to implement code to accomplish the goal as work because they can&#x27;t see it, and they can&#x27;t understand it because they are too busy collecting visual days to prove they are properly micromanaging you to take the time to learn the challenges inherent to the architecture and challenge at hand.<p>Does that help?
White_Wolfalmost 5 years ago
That sort of question is ussualy asked by a someone that either has no clue how programming works or are just from the sales team. I do admit I left one software company because of a manager like that that. Fixing bugs is painful(to say the least) if you don&#x27;t know the code properly. Even worse when you have to &quot;hit the ground running&quot; and take over a project because the main guy for it left &quot;due to personal circumstances&quot; or &quot;difference in oppinion&quot;. Ever since then: - &quot;If you think it can be done faster please go ahead.&quot; - &quot;It will take as long as it takes, not a minute more&quot; - &quot;if you really want a time estimate: it will take me 4* &lt;time I think it will&gt;&quot;
entha_saavaalmost 5 years ago
At what point we, as an industry, failed to mandate a level of technical education for being a manager? Almost always the non technical people who can&#x27;t think beyond quarterly profits and their resumes are the biggest problem of this industry.
评论 #23843098 未加载
gratonalmost 5 years ago
A good commit message can also help to explain why the two lines of code took so long.
tdrpalmost 5 years ago
We had a non-tech lead at some point (although his title was something like development manager) and he would praise my coworker for how many check-ins he did. Except that coworker would do things like:<p>1- Copy-paste an entire class into a new class and change a single constant in it, because he was too lazy to do inheritance.<p>2- &quot;Solve&quot; multiple bugs a day that he had introduced himself the day before.<p>3- Loudly complain about other people&#x27;s frameworks&#x2F;codes.<p>He was the super confident type even though he was wrong more often than not. But paired with a non-tech lead with his own impostor syndrome, it was a recipe for disaster.
评论 #23838672 未加载
lmilcinalmost 5 years ago
Hindsight is 20&#x2F;20.<p>It takes more work to produce succinct code and it can take surprising amount of effort and care to land at a simple solution to a complex problem.<p>My solution is to try to involve other people in my &quot;process&quot;. This helps me transfer some knowledge of the decision process, helps debug ideas early on and hopefully is useful mentoring for the team.<p>I can do this because I am senior engineer &#x2F; tech lead at my org. For other engineers I highly recommend pair programming and constantly rotate developer pairs so that everybody can get some appreciation of everybody else.
augustkalmost 5 years ago
With unit tests included it would probably be more than two lines.
评论 #23840354 未加载
thaynealmost 5 years ago
Only two days? I&#x27;ve spent two weeks on a single line bug fix before (although I wrote quite a few more lines of unit tests to make sure it continued to work).
bpynealmost 5 years ago
So much good in this short piece. He sounds like someone I want on my team.<p>Users who work with IT often tend to give better descriptions and test cases. Quite often I need more information though. He&#x27;s right that you try not to bother the reporting user. Sometimes there&#x27;s no other way.<p>Reproducing a bug is often the most time-consuming part of a bug fix. It&#x27;s doubly difficult when you have a shared test environment and the bug leads you into a shared data set. For instance, we have a scheduling table that&#x27;s used by many applications. I can&#x27;t change the data, even on test, because it can easily mess up other teams. So I have to make a copy of it to my schema, alter data, and point the code to the altered copy.<p>&quot;If some code is throwing an error, you could just wrap it in a try..catch statement and suppress the error.&quot;<p>Yes, these developers exist. I worked with several over my career. They are frustrating because they leave damage for other people to fix, often at the worst time.<p>&quot;Finding the exact cause of a problem, and looking at all the ways to get there can provide valuable insights.&quot;<p>Yes a thousand times. Bug fixes are opportunities to learn more about a system and, often, the user area for whom we wrote the software.<p>&quot;I want a fix that isn&#x27;t likely to cause confusion or other problems in the future.&quot;<p>A good fix takes into account the overarching software design and fits it if possible.<p>&quot;I don&#x27;t want a bug to be found in the future and for me to have to come back to this code when I&#x27;ve mentally moved on. Context switching is expensive and frustrating.&quot;<p>Writing software is building an abstract machine in your mind. These machines get complicated. Even when you&#x27;re fixing a system written by someone else, you need time to &quot;load&quot; the machine into your mind.<p>The only time I don&#x27;t like fixing bugs is when I&#x27;m against a deadline on writing&#x2F;modifying another system. The context switching is a deadline killer. But, it happens. Nowadays I let the project manager know that I&#x27;m switching to a bug fix, give an estimate of how long I&#x27;ll be away from his&#x2F;her project, and my best guess on whether or not it&#x27;ll cause a deadline slip.<p>Great post.
kentlyonsalmost 5 years ago
One of my favorite personal commits was removing about 5000 lines of dead code tightly woven into many other parts of the overall codebase.
laci37almost 5 years ago
This reminded me of this commit from my GSoC internship: <a href="https:&#x2F;&#x2F;github.com&#x2F;lihaoyi&#x2F;Ammonite&#x2F;pull&#x2F;93&#x2F;commits&#x2F;a5e30eff4daf1082d080e95b9e099d4248f4f0f2" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;lihaoyi&#x2F;Ammonite&#x2F;pull&#x2F;93&#x2F;commits&#x2F;a5e30eff...</a><p>This single change took more than a week of debugging.
shultaysalmost 5 years ago
I remember removing a single line taking me about a whole day. Was working on an embedded c++ project (a tv) and for some reason it was randomly stucking in an infinite loop. Debugging tools were minimal and it took me a while to figure out it was stucking in some kind of mutex and all I did was removing one mutex lock because it wasn&#x27;t necessary.
Beldinalmost 5 years ago
This reminds me of the story about an older engineer called in to fix a computer problem. Previous efforts by the local IT staff had failed. In two clicks, the problem was fixed. He charged $100 for it.<p>Outraged at having to pay $100 for two clicks the customer demanded an itemised bill. The engineer wrote:<p>- 2 clicks: $0.05 &#x2F; click<p>- knowing where to click: $999.90
alex_dufalmost 5 years ago
I wrote a whirl article about a single line of code, I hope the mentality starts to change.<p><a href="https:&#x2F;&#x2F;www.theguardian.com&#x2F;info&#x2F;2019&#x2F;dec&#x2F;02&#x2F;faster-postgresql-connection-recovery" rel="nofollow">https:&#x2F;&#x2F;www.theguardian.com&#x2F;info&#x2F;2019&#x2F;dec&#x2F;02&#x2F;faster-postgres...</a>
mongolalmost 5 years ago
There is an annoying tendency that business people get the credit for coming up with the ideas that bring in the value, and the IT people get the blame for the defects and the problems that costs the business money. It is not like that everywhere, but in companies where it is, it is unhealthy to work as the IT staff.
kpsalmost 5 years ago
For a previous job long ago, I spent several months off and on working on an obscure and difficult-to-reproduce bug, without success. A year after I was laid off, a customer encounter a clear reproducing case, and I came back for a day to work on it. The fix was <i>one character</i>: &lt; vs &lt;=
arendtioalmost 5 years ago
Actually this is one of the upsides of web development: Since every line contributes to the file size of your software and therefore to the loading time there is a motivation for keeping the code base small.<p>Sadly, there are many projects out there which obviously failed to reach this target at some point.
评论 #23836871 未加载
cel1nealmost 5 years ago
This is not an IT specific problem.<p>For most jobs they don&#x27;t do themselves people tend to understand the time it takes.
electrondoodalmost 5 years ago
Had a PM ask why we were taking so long to build a future-proof platform when this other team over here built an emergency project in 3 weeks.<p>Had to explain that that project was held together with duct tape, not one bit of it was reusable, and even the engineers who build it were saying it was shit.
评论 #23840664 未加载
lowbloodsugaralmost 5 years ago
Bill:<p><pre><code> Adding two lines: $ 1. Knowing which two lines to add: $10,000. </code></pre> <a href="https:&#x2F;&#x2F;www.snopes.com&#x2F;fact-check&#x2F;know-where-man&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.snopes.com&#x2F;fact-check&#x2F;know-where-man&#x2F;</a>
icedchaialmost 5 years ago
The real reasons: depressed due to the current world situation, browsing reddit, HN, youtube, doing housework, checking stock portfolio, chatting with friends. In between all these distractions, one does manage to get some work done, at least 2 or 3 days a week.
bmcahrenalmost 5 years ago
If you work somewhere you&#x27;re defending yourself from this question repeatedly, just move on at your earliest convenience. They don&#x27;t value quality developers and you&#x27;ll eventually turn into the low-quality developer they&#x27;ve always wanted.
ngcc_hkalmost 5 years ago
Trying to fix a very minor bug of a game of solitude of c heard from this site. It is somewhere it must be missng a range check causing a core dump (or whatever the name linux&#x2F;macOS gave to the MVS thing). The problem is where is it. 2 days now.
ChicagoDavealmost 5 years ago
I can’t like this post enough. We are not accountable by lines of code. Delivering healthy, maintainable software requires thought, experience, and thorough testing. This is why companies have taken so long accepting the idea of unit testing.
thysultanalmost 5 years ago
&gt;Because I tested the change thoroughly and verified that it addressed the problem for all the different code paths that were affected.<p>Doesn&#x27;t this imply that the&#x27;d be more than two lines of code unless they&#x27;re not counting the tests.
评论 #23840348 未加载
Beltirasalmost 5 years ago
I love the bughunt. I hate greenfields. I procrastinate when I have to write a project someone else has to maintain. I feel the pressure to perform. Squishing bugs is fun. That was someone else who done the foulup.
Consultant32452almost 5 years ago
I spent a month figuring out a single line of configuration. That really hurt.
nojvekalmost 5 years ago
I personally do value velocity not in number of lines, but in terms of unblocking users and other team members.<p>So:<p>1) user wants X done. Focus on that. Help the user X done. First iteration you have something crappy, doesn’t look great, too simple. That’s okay. Did it get X done. Cool. If you shipped some pretty UI but users don’t actually use it since it doesn’t solve the problem. That’s not productivity.<p>2) now that there are users using the tool, watch them use it. Ask questions, look at th me dashboard. Optimize their flow to do X. Make the UI delightful. We know with good certainty that this is a decent solution. Make it fast. Add tests. Harden it up so someone else doesn’t break it accidentally.<p>So if someone added two lines of using some existing node module that solves the user’s problem, those are very productive two lines.
celticninjaalmost 5 years ago
The fix is a refactor of a refactor of a refactor of the actual fix.
pjettteralmost 5 years ago
I once reduced the amount of code for a client by ~75% and added usability and fault-tolerance. I wasn&#x27;t even half done and they thought it was good enough. LoC is no measure.
ak39almost 5 years ago
Because coding is like the art and science of distillation. Cheers.
ablancoalmost 5 years ago
It&#x27;s really sad that people (managers) still thinks of code this way. Luckily this has never happened to me, but if it did I think it would be a great sign to change jobs.
abraaealmost 5 years ago
Most of the article is good, but this is weak:<p>&gt; If some code is throwing an error, you could just wrap it in a try..catch statement and suppress the error. No error, no problem. Right? Sorry, for me, making the problem invisible isn&#x27;t the same as fixing it. &quot;Swallowing&quot; an error can easily lead to other unexpected side-effects. I don&#x27;t want to have to deal with them at a point in the future.<p>I actually did work with someone else who did this sort of thing, however it is certainly not the normal in my experience, not for anyone who takes any pride in their work.<p>Including this one really devalues the &quot;it took so long because I&#x27;m so professional&quot; message IMO.
k__almost 5 years ago
Nobody I ever worked with cared for LoC.<p>They had a shitty bug. It took me a month to find and fix in the code. Wrote about 5 LoC. Nobody asked how I fixed it, they just were happy that I did.
doonesburyalmost 5 years ago
Symptom v Root cause. Bad spec&#x2F;no spec. Known issues in manufacturing since pre-75. Software gotta get with the program...
bananafacealmost 5 years ago
I sympathize with this, but taking two days to add two lines of code <i>is</i> unproductive. Sorry, that&#x27;s just not a lot of output. Two-day bugs happen, but they should be rare. The real question is: is this rare, or is it typical for this developer?<p>IMO the real problem is trying to evaluate an employee&#x27;s productivity on the scale of two days. There isn&#x27;t enough context to understand the situation.
评论 #23842771 未加载
RocketSyntaxalmost 5 years ago
The hardest and most time consuming work is the architecture&#x2F;design. The code should be the easy part.
CodeWriter23almost 5 years ago
Dude, you could have just said “because I take my job seriously and executed with complete diligence”.
m3kw9almost 5 years ago
Cuz trying to understand someone’s code, testing, debugging and finally apply the fix, and test again.
reactoralmost 5 years ago
Programming is like playing chess, the move only takes about seconds, but what to move takes time.
goatinaboatalmost 5 years ago
The response to a manager who says this is, you don’t do anything at all, why are you even here?
pocwalmost 5 years ago
MAKING CHALK MARK ON GENERATOR $1. KNOWING WHERE TO MAKE MARK $9,999. -Charles Proteus Steinmetz
pauljurczakalmost 5 years ago
You&#x27;ve only written a few letters. How long does it take to write: &quot;e = mc^2&quot;?
mrwhalmost 5 years ago
&quot;Because the text was so light it was difficult to read&quot;<p>Snark aside, it&#x27;s quite a good list.
jmartricanalmost 5 years ago
Because i wrote failing unit&#x2F;integration tests before implementing the solution.
k3liutZualmost 5 years ago
I once spent a week just to add a &quot;;&quot; in the right place to fix a bug.
irrationalalmost 5 years ago
I just spent 3 days figuring out that I needed to remove a single line.
shoes_for_theealmost 5 years ago
It&#x27;s beside the point, but grey-on-white fonts give me a headache.
csoursalmost 5 years ago
Because looking at this code feels like walking on broken glass.
pibsdalmost 5 years ago
Mmh there should be more than two added lines if he wrote tests, no? I know some bugs are difficult to track, reproduce, and fix. But whenever I can I write as much as automated tests to check that the bug has really been removed.
jrochkind1almost 5 years ago
Hey, sometimes it takes two days to REMOVE 2 lines of code!
29athrowawayalmost 5 years ago
Because the code is architected like a Jenga tower.
cesarefalmost 5 years ago
2 lines of code? Where&#x27;s the test cases?
wilmoorealmost 5 years ago
anxiety === lack of documentation + lack of frequent communication + general desire to be _done_ as soon as possible
cmollisalmost 5 years ago
this happened to me.. except it was one line: free(ptr); &#x2F;<i></i> here it is ---&gt; *&#x2F; ptr = 0x00;<p>a classic.
jiveturkeyalmost 5 years ago
you think adding code takes a long time? try removing code!
knownalmost 5 years ago
Doesn&#x27;t stand good to ask a doctor
pibsdalmost 5 years ago
There should be more than two lines of codes added anyway: whenever I can I add as much as automated tests as needed to check that the bug has really been removed.