News for hackers. Stuff that matters.
Re:3 lines of code shouldn't take all day by userbinator on Thursday December 16, 2021 @02:39AM (#29576001)
This is probably a controversial opinion, but I think that working in an environment where time-to-iterate is high is actually very beneficial for improving your skills. It's one of those things that may feel overly burdensome in the short term, but is better in the long term. I say this as someone who taught programming with beginners, and observed what many of them will do when given an IDE, which at the scale of the code they're writing, makes the time-to-iterate very short (press a key and you instantly see your changes). They end up getting into a "dopamine feedback loop" that causes them to continually make tiny changes and rebuild/run, and the code written as a result of this looks exactly like what you'd expect: it barely works, and is full of redundancies, "dead ends", and other evidence that its author was probably not thinking of anything more than the next line or two when writing it.

In other words, reducing the iteration time reduces the motivation to get it right the first time, and the associated deep reasoning/"mental execution" skills which are required to do so. In order to develop those skills, one should strive to write as much code as possible before running it, and a high iteration time assists with that.

Also, I'm tempted to continue the title with "...unless it's APL".

Re:3 lines of code shouldn't take all day by marginalia_nu on Thursday December 16, 2021 @04:34AM (#29576578)
Isn't that just what it's like to be a beginner? I think it's difficult to grasp when you've been coding for a few decades that new developers don't immediately see what effects a piece of code has, they can't just look at a loop for 2 seconds and say "oh, there's an off-by-one there". Sure, I can worry about the big picture while I'm typing out the code because I don't need to pay much attention when I'm typing out the code. The syntax of code is a no-brainer activity. I've been adding semicolons at the ends of lines for longer than some developers have been alive, it's not going to be something I miss. A beginner needs to focus on the details of the lines, which means their code becomes myopic and line-focused. I don't think you can meaningfully widen the scope before you're able to do the simple steps automatically.

Experienced developers typically don't sit like Hari Seldon predicting branches 50k instructions into the future with some extremely elaborate grand master plan, they're so fluent in the code and architecture that they don't need to. This is tacit knowledge that is acquired along the way, I don't think it can be meaningfully practiced.

Re:3 lines of code shouldn't take all day by pbalau on Thursday December 16, 2021 @09:07AM (#29578219)
> Experienced developers typically don't sit like Hari Seldon predicting branches 50k instructions into the future with some extremely elaborate grand master plan

This made my day, thank you.

Re:3 lines of code shouldn't take all day by hutrdvnj on Thursday December 16, 2021 @10:06AM (#29578846)
Re:3 lines of code shouldn't take all day by mannykannot on Thursday December 16, 2021 @08:50AM (#29578035)
I think that final sentence is unduly pessimistic - after all, if practice did not play a big part in expert programmers becoming that way, what did? What hope is there for the novice who is frequently making off-by-one errors and the like?

Maybe you are saying that there is no deliberate method of practice, but I think there is: whenever you correct one of your mistakes, try to figure out how you might have written the correct code the first time. Often, it might be a boneheaded mistake, but a significant number of cases have something to learn from. Can you make an argument for the current version being correct, and the previous one not? If an API did not work the way you expected, did you overlook something in the documentation? (Maybe just that the documentation was ambiguous, and you might have realized that earlier.)

I think OP's point is that slow turnaround encourages that sort of thinking, and it does, though it is quite a cost to pay.

Re:3 lines of code shouldn't take all day by marginalia_nu on Thursday December 16, 2021 @10:50AM (#29579390)
> I think that final sentence is unduly pessimistic - after all, if practice did not play a big part in expert programmers becoming that way, what did? What hope is there for the novice who is frequently making off-by-one errors and the like?

It's not that the knowledge can't be acquired, but this is a type of knowledge often can't be explicitly practiced through some training routine.

A beginner may of course learn to check off common errors they've been told about, and may arduously step through the code in their head line by line, but an expert sees the code is wrong unconsciously and understands what the code does without stepping through it. The only way to learn that is to engage with code for decades. There are no shortcuts.

Re:3 lines of code shouldn't take all day by mannykannot on Thursday December 16, 2021 @11:55AM (#29580374)
I agree that competent, experienced programmers look at code differently, and much less linearly, than do novices, and there have been studies that show this. On the other hand, a person could (and people do) spend years programming without learning to look at code in this way. The people who do improve must be doing something different.

There are no shortcuts, AFAIK (though I think most people can achieve most of their potential in less than a decade), and I am sure you cannot get there through rote learning. Are you suggesting, however, that the sort of approach I am advocating is not very helpful, or just that it cannot be explicitly practiced?

Re:3 lines of code shouldn't take all day by DarylZero on Thursday December 16, 2021 @03:30AM (#29576251)
> They end up getting into a "dopamine feedback loop" that causes them to continually make tiny changes and rebuild/run,

Yeah that's what I'm doing all the time. Just constantly testing the thing after every little change. If the test is fast, I like it. Probably there is some dopamine thing. I have thought of it in the past as like a slot machine.

> and the code written as a result of this looks exactly like what you'd expect:

Why would you expect any particular thing?

> it barely works, and is full of redundancies, "dead ends", and other evidence that its author was probably not thinking of anything more than the next line or two when writing it.

My code isn't like that though. Maybe that code was like that because it's beginner code.

> In other words, reducing the iteration time reduces the motivation to get it right the first time

I'm always hoping it works on the first time but you know how that goes. Even when it's close there's some little thing. The hope of getting untested code right on the first try isn't really something I entertain too seriously anymore. Short iteration is lovely.

Re:3 lines of code shouldn't take all day by GreenWatermelon on Thursday December 16, 2021 @05:19AM (#29576830)
Getting a particular piece if code running from the first time is so unexpected that I'm like "Huh... that's pretty cool" everytime it happens.

no need to spend 3 more minutes looking at the code when a 2 seconds build will tell me there's a Segmentation fault right there, or when Valgrind will tell me I missed a free ().

Re:3 lines of code shouldn't take all day by patrakov on Thursday December 16, 2021 @11:04AM (#29579579)
Well, yesterday I made a rather significant change to the code. Essentially, a reimplementation of an existing function in a completely different way, to avoid a memory consumption issue that cannot be solved in the old approach. 68 insertions, 15 deletions. It, unexpectedly, worked correctly and passed all tests from the first attempt, even though there are threads involved, and they are my weak point. But I didn't have a "Huh... that's pretty cool" moment. I had an "I don't like this code, it's too complex, it must be wrong somehow" moment.
Re:3 lines of code shouldn't take all day by johnny22 on Thursday December 16, 2021 @08:59PM (#29586829)
or just feel both.. at the same time.
Re:3 lines of code shouldn't take all day by mannykannot on Thursday December 16, 2021 @09:03AM (#29578165)
Only a small fraction of segmentation-fault-causing errors will be revealed in 2 seconds of testing. Thinking about all the ways your code could fail, and being able to keep a mental track of the constraints you need to observe, is a useful skill to acquire.
Re:3 lines of code shouldn't take all day by torginus on Thursday December 16, 2021 @04:35AM (#29576581)
The problem is many times, you can't really reason through the issues your encountering. For example, if you are trying to talk to a server with an undocumented API flow, or you're trying to coax an in-house library to life, you have no option but take baby steps and test every single change to see if you made progress. In environments (like C++) where the compile times are high, and it's pretty easy to introduce almost impossible-to-trace bugs, I'm often tempted to do a bunch of changes, and then test them all at once, which will invariably result in something breaking and me having to spend an inordinate amount of time to figure out what went wrong.
Re:3 lines of code shouldn't take all day by jimmaswell on Thursday December 16, 2021 @10:24AM (#29579064)
Yeah, this breaks down in this case. I've wasted so much time making small changes trying to figure out how to adapt a model in the right way for it to work in both real and test code, getting a weird injection to work, etc. on systems with agonizing build times.
Re:3 lines of code shouldn't take all day by jmnicolas on Thursday December 16, 2021 @02:51AM (#29576061)
Your example is valid for beginners but once you're getting experience you don't code like that anymore.

After 13+ years of C#, on simple projects I can code for a couple hours without compiling and get the pleasant surprise that my code work the first time I run it. And I'm certainly not a genius, I'm a 1X programmer.

Re:3 lines of code shouldn't take all day by cardanome on Thursday December 16, 2021 @05:49AM (#29576993)
I still do. Of course dabbling into REPL-based solutions in my youth might have influenced that.

For me it is crucial to always have have the code in some compile-able and testable state. I iteratively work towards the simplest, most naive solution that gets the job done. After that it is refactoring time and I form it into a proper solution.

The reason I do so is because only after having coded the naive solution, I have an concrete and proven correct understanding of the task and can pick the appropriate abstractions. I always see colleagues with an less iterative style use premature-abstractions and over engineering on the basis of "we might need it" instead of knowing.

I do invest some time into thinking about the right data structure though. (Not much about algorithms, as they mostly follow from the data structures anyway.) Also if I code a well understood problem, I might use a more top down approach.

(Not a critique of your workflow, just wanted to share mine.)

Re:3 lines of code shouldn't take all day by rvense on Thursday December 16, 2021 @03:44AM (#29576313)
Eh, ten years a professional, I frequently fall into it still, where you forget to think about the best solution and just.. mash. Sometimes it works to get a solution that can then cleaned up, other times I waste an hour before I snap out of it. I saw someone post "Stop thinking and look!" as universal advice once, but I need the inverse just as often.
Re:3 lines of code shouldn't take all day by throwawayboise on Thursday December 16, 2021 @01:33PM (#29581918)
I have been coding for over 30 years and I can barely write one function without at least making some typos if not logical errors. I would never code for a couple of hours without compiling/testing.
Re:3 lines of code shouldn't take all day by jmnicolas on Saturday December 18, 2021 @02:27AM (#29602533)
You're not using an IDE? Sometimes I joke that I just press CTRL+Space and Visual Studio does the coding for me (and this was before Github Copilot!).
Re:3 lines of code shouldn't take all day by MathCodeLove on Thursday December 16, 2021 @12:37PM (#29581056)
What does "1X" mean in this context?
Re:3 lines of code shouldn't take all day by Jtsummers on Thursday December 16, 2021 @12:49PM (#29581256)
"Average", as opposed to a 10x "rockstar" or above average programmer. Or a -1x or -10x incompetent programmer.
Re:3 lines of code shouldn't take all day by MathCodeLove on Thursday December 16, 2021 @02:40PM (#29582825)
Thanks! Haven't heard that terminology before.
Re:3 lines of code shouldn't take all day by mmcgaha on Thursday December 16, 2021 @09:40AM (#29578550)
I see you follow the Tao -- beyond all techniques!
Re:3 lines of code shouldn't take all day by jt2190 on Thursday December 16, 2021 @08:17AM (#29577802)
> In other words, reducing the iteration time reduces the motivation to get it right the first time, and the associated deep reasoning/"mental execution" skills which are required to do so. In order to develop those skills, one should strive to write as much code as possible before running it, and a high iteration time assists with that.

A high iteration time [a.k.a long feedback loop] leads to distraction more frequently than to “deep reasoning”. Human brains seem to be wired to find distraction after about eight seconds have elapsed. [1]

Furthermore, let’s not forget that an IDE doing a lot of error checking real-time, often including partial compilation and execution, so nobody running an IDE is coding for a long period without compiling, they’re more likely coding for a long period without integrating.

If we reframe deep reasoning as “stay engaged with the problem while waiting for some feedback”, we can see that there are a lot of tricks for this: Unit tests, for example, or using a different medium like pencil and paper or a whiteboard. (I’m sure this group can come up with a great list.)

[1] “Response times: The three important limits” https://www.nngroup.com/articles/response-times-3-important-...

Re:3 lines of code shouldn't take all day by taeric on Thursday December 16, 2021 @11:37AM (#29580126)
There has to be some nuance here. Feedback that comes when I'm not at a stop/review point is just a distraction. Is why aggressive spell checking is annoying.

This was a thing learning to type, for me. Our class would transcribe from paper to document. Those that watched the screen were slower, once folks learned to touch type.

That is, learning to get into deep thought is a skill that eventually doesn't want the distractions. You want to focus and produce, then review.

Re:3 lines of code shouldn't take all day by barrkel on Thursday December 16, 2021 @06:35AM (#29577213)
If you're ramping up, you cannot write a significant amount of code without errors. If you try, it's much harder to figure out which change caused the failure of a previously working system, because you're less aware - by definition, ramping up - of the mapping between edits and failure modes.

Once you're ramped up, yes, it's more efficient to produce more code and fix the odd issue that crops up. I rely more heavily on high level, slower running functional tests on code where I've been the primary author or have worked on the system for a long time. But just be aware of what you're optimizing for: tenured employees.

I wouldn't kid yourself that it's "deep reasoning", beyond people on a dopamine kick, or beginning programmers working with simple data structures. You can't reason much about a system you don't know, because everything is details - millions of lines of code, you can't mentally evaluate it. It's not until you've built a mental model of the moving parts, and are able to mentally abstract away details not relevant to your task, that you can think things through in the large.

Re:3 lines of code shouldn't take all day by ehnto on Thursday December 16, 2021 @08:26AM (#29577862)
That is a really interesting perspective, and something I have noted about myself when working with Lambda in AWS, which has a god awful iteration time.

My two comments however would be that when you don't know your context, lots of probing is required, and that can take a lot of iterating. In industry work you're very often working on a small part of a larger software orchestration, and it's often entirely new to you when you're asked to work on it. So you don't get access or time to understand the full scope of the software to reason about. So you need to "discover" your context as it actually is at run time. This is especially true when bugsquashing.

My second comment, is that we should all have a good debugger. Having a debugger is like having a superpower. I can come into a codebase I've never encountered before, step through as it runs, gain enormously useful context, and solve the problem I wanted to solve, without ever running the code to completion or having to read every bit of logic.

If I'm working on someone else's codebase, usually I spend time reading to figure out the general architecture, then dive right in with a debugger and start stepping through. I find how to trigger the code paths related to my task, see what's happening as it happens, and get a really good understanding of how it's all running.

In what might be another controversial opinion, a working programmer without a debugger is like a working carpenter who's chosen to do everything with a knife. They may produce good work with their own way, but they could be faster with the proper tools.

Re:3 lines of code shouldn't take all day by bipson on Thursday December 16, 2021 @04:26AM (#29576541)
Came here to say this.

I even see the mindset spreading to other activities, like writing an abstract, paper, proposal or preparing slides:

I regularly (more often than not) see students using their supervisors as "CI-chain", submitting iterations with lots of stupid errors, half-baked sentences, unclean structure... because they learned to hit CTRL-b and see what comes back.

Of course there are reasons to talk about half-baked ideas, but if your task is writing a proposal or a section, you should at least be happy with what you wrote before you send it to the Prof, you're wasting his time.

But I also want to say that CI, unit tests and quick iterations are still helpful, even if you know how to approach a problem (i.e. think, research, draft, test, revise, etc.)

Re:3 lines of code shouldn't take all day by tomrod on Thursday December 16, 2021 @04:47PM (#29584419)
What does CTRL-b map to? Paste?
Re:3 lines of code shouldn't take all day by CRConrad on Thursday December 30, 2021 @05:33AM (#29735529)
"Build"?
Re:3 lines of code shouldn't take all day by brokenkebab on Thursday December 16, 2021 @04:29AM (#29576557)
Your stance looks self-contradictory. An introduced change either brings enhancement, or not. In the latter case you wouldn't expect anybody to be excited. It means one only gets dopamine boost when getting closer to a goal set, i.e. the feedback works absolutely right. If after a bunch of such changes one arrives at "barely working" it indicates poorly defined goal, and/or lack of underlying knowledge. And has nothing to do with length of compilation. Actually, that's what we can expect from beginners, right? With quicker feedback they, most likely, will have a chance to absorb knowledge quicker.
Re:3 lines of code shouldn't take all day by mavelikara on Thursday December 16, 2021 @09:59AM (#29578771)
Many early programers, Knuth etc, have described how writing programs on punch cards, submitting the job, picking up the results much later had a big influence on how they thought about programing. The lack of immediate feedback, counterintuitively, made them better programers it seems.
Re:3 lines of code shouldn't take all day by throwawayboise on Thursday December 16, 2021 @01:30PM (#29581873)
Or the people drawn to the tedium of early programming were just really good and mentally twisted in the right way to enjoy it.

My first programming experiences were BASIC on TRS-80, TI-99/4a, and similar machines. It was instant feedback, for the most part, and I enjoyed being able to make small changes and seeing the results. I was around 12 years old and that worked well with my attention span at that time.

Re:3 lines of code shouldn't take all day by mavelikara on Thursday December 16, 2021 @02:01PM (#29582316)
> Or the people drawn to the tedium of early programming were just really good and mentally twisted in the right way to enjoy it.

Agree.

I think what was happening was the the lack of feedback fit the mental models of the people who were attracted to computers early.

For another example of this,Ken Thompson famously said that he never quite understood why anyone would want to see the whole file they were editing instead of the single line.

But instant feedback attracted more people to programing.

Re:3 lines of code shouldn't take all day by slifin on Thursday December 16, 2021 @09:33AM (#29578491)
I would not conflate slow feedback loops with intentional breaks

For me slow feedback loops push me into dopamine seeking activities, intentional breaks push me into relaxation and deep thought

Recently I got a treadmill desk and the physical exertion reminds me to take breaks where I can get off and relax and potentially think about a problem

Slow tests running causes me to not write tests and look at YouTube

https://youtu.be/f84n5oFoZBc

Re:3 lines of code shouldn't take all day by fy20 on Thursday December 16, 2021 @03:07AM (#29576134)
There is a cut off period though. In my current role there is one project that takes 15 minutes to clean build, and another 15 minutes to run the test suite. Incremental builds are fast, but sometimes/often the compiler decides it needs to rebuild everything.

Additionally for some reason on my machine, maybe 25% of the time it gets stuck while building and I need to kill it and start again. Usually I go and get coffee while it's building, but there's only so much coffee or Reddit you can drink. Many times I've taken a 30 minute break while it builds and tests, then come back to find it got stuck and need to start again. Anytime I have to work on this project I try to put it off as much as possible, as I know it's going to be painful...

Re:3 lines of code shouldn't take all day by Philip-J-Fry on Thursday December 16, 2021 @07:43AM (#29577573)
When I was a beginner I'd write code and run it very fast, after each small change, even though an experienced developer could probably compile it in their head and see whether it worked or not.

I think just as you get more experience you tend to write more code before you run it. I've written an entire (relatively small) application and written the tests for it before I even thought about running it. Run it, few tests fail, iterate a tiny bit, done.

It's just natural as you get more experienced that you can reason about code in your head without resorting to running it to confirm it.

Re:3 lines of code shouldn't take all day by necheffa on Thursday December 16, 2021 @01:01PM (#29581435)
Oh dear. Oh dear, oh dear.

Let me tell you, time to iterate on a huge 50 year old code base is through the roof and reaching out into interstellar space. The resulting code is pure and utter trash.

I would kill to have to have a quick feedback loop and at least be able to address quality issues through training, culture, or technical controls.

The alternative is fighting against a giant, heavy machine with a lot of inertia in the wrong direction.

Re:3 lines of code shouldn't take all day by yboris on Thursday December 16, 2021 @10:35AM (#29579201)
I'd say the opposite. The quicker the feedback loop, the faster you can learn. Just because some beginners choose to get the feedback faster doesn't mean they are doing something wrong.
Re:3 lines of code shouldn't take all day by mikewarot on Thursday December 16, 2021 @05:11AM (#29576779)
This is the same argument in favor of manual photography with film, instead of a digital SLR, or a camera phone.

While you might learn more if forced by the constraint, the opportunity cost is quite high, and these days you'll never replicate the experience of going off with your glass plates and camera packed on a mule to photograph the Sierras.

Not only all of that... but Ansel Adams spent a TON of time in the darkroom, and pretty much invented most of the techniques that Photoshop emulated in their early versions. Even faced with limited chances at exposing a negative, he iterated the heck out of the development process when making prints.

I share your view that there is value in the focus, but I don't think that anyone can afford the opportunity costs.

Re:3 lines of code shouldn't take all day by J-Kuhn on Thursday December 16, 2021 @03:55AM (#29576368)
Those short cycles are great when learning a new language. Experiment with it, try new things, understand how the language works.

But at some point you are better thinking about what to write, how to write it, which structure you will use. And this skill has to be acquired as well.

Re:3 lines of code shouldn't take all day by pjc50 on Thursday December 16, 2021 @04:37AM (#29576591)
> Also, I'm tempted to continue the title with "...unless it's APL".

Or lisp. Or smalltalk. Or forth. There's an entire subfield of computer science, headed by some prestigious people, who believe that working in a REPL is better precisely for these reasons.

At this point I deploy the left-handed user argument: different developers probably find these tools and workflows have drastically different effects on their productivity.

Perhaps also a "code kata" thing. It may be worthwhile to make beginners do each for a few months just so they have the experience (and find out their own "handedness")

Re:3 lines of code shouldn't take all day by regularfry on Thursday December 16, 2021 @02:33PM (#29582715)
I genuinely don't know what to make of the handedness argument. On the one hand it makes a sort of intuitive sense (we're all individuals! Of course we all do things differently!) On the other we're all running on the same hardware, give or take. It strikes me as like learning styles: yes, people might have expressed preferences, but if you run the numbers we do all learn in fundamentally the same way, independently of what we say we prefer.
Re:3 lines of code shouldn't take all day by vnorilo on Thursday December 16, 2021 @02:21PM (#29582573)
I think "high iteration time" taken to the extreme is programming without a computer, like when taking a walk. You construct a very detailed mental model of how the program operates and interrogate it in your head.

This only works once you're a bit more advanced, but the one sure sign of a senior dev is the accuracy of their mental model. Which is also what allows you to write your piece without a continual back and forth with the compiler.

This all said, I greatly enjoy ping pong with a repl or instant hot reloading when doing visuals or sound.

Re:3 lines of code shouldn't take all day by Zababa on Thursday December 16, 2021 @05:07AM (#29576754)
In the same vein: I'm very used to "printf debugging". When I use a language where it's harder to do that, I feel like I improve as a programmer because I spend more time reasoning and thinking about my code instead of directly trying to fix the problem I have right now.

As a more general thing: you can learn a lot by removing tools that you usually use from your toolbox. For example, going from a managed language to manual memory management. Going from an IDE to shell commands. Removing tools like language servers. Each time I did one of those things, I learned a lot. However, there are lots of things to learn and I don't know if this was the "most effective use of my time".

Another example of hard to balance learning: I'm currently working for a company. Should I focus my learning on their business and our codebase, or on general technology? General technology is a transferrable skill, and I'm scared of being "trapped" in a company if I focus on their specific parts too much. But on the other hand, companies want to recruit efficient people, and I think focusing on the business and our codebase would make me more efficient.

I'm a junior engineer, so maybe that's due to a lack of experience. If anyone has insights to share about that, I'd love to hear them.

Re:3 lines of code shouldn't take all day by hiepph on Thursday December 16, 2021 @07:18AM (#29577438)
My strategy is you spend 80% of the time on the company problem, and 20% for learning. By that you have both the time to deeper your professional skills and get new inspiration from new technology.
Re:3 lines of code shouldn't take all day by clktmr on Thursday December 16, 2021 @03:57AM (#29576378)
I worked on projects with long compile times and nowadays I will often write code all day without executing anything and then spend the last hour running and fixing it. Maybe that's a skill I developed because of long compile times, but whenever I work on a project with short ones I feel much more motivated and productive. Your experience is probably biased from watching beginners learning to code.
Re:3 lines of code shouldn't take all day by throw8932894 on Thursday December 16, 2021 @03:12AM (#29576154)
In my experience developers develop their own "unique style" to deal with with this problem. Most often it is horrible pile of mess. Often without unit tests since they do not give much feedback. And acceptance criteria is simple "it compiles and prints ok".

With short iterative changes I have unit tests and fine grained git history, to untangle it.

Re:3 lines of code shouldn't take all day by samzer on Thursday December 16, 2021 @03:30AM (#29576246)
This holds true for ML models too when the data is large. I've seen people(myself included) when the data is small, the iteration is faster when selecting the features but when the data is large then you have to think about the features that you want to select a bit more deeply, test it out on a sample and then submit it to the larger data set.
Re:3 lines of code shouldn't take all day by globular-toast on Thursday December 16, 2021 @05:08AM (#29576758)
I've observed "trial and error coding" many times in my life. This isn't caused by a short feedback loop at all. The people who work like this will work like this with a long feedback loop too, they will just take a lot longer to do anything. These people are simply incompetent programmers.
Re:3 lines of code shouldn't take all day by abrudz on Thursday December 16, 2021 @03:50AM (#29576349)
> Also, I'm tempted to continue the title with "...unless it's APL".

Came here to say that. But jokes aside, as an APLer I wouldn't be able to bear waiting for things to compile. I regularly edit functions while they're on the stack, then have them continue…

Re:3 lines of code shouldn't take all day by danuker on Thursday December 16, 2021 @04:58AM (#29576697)
I see it like driving stick vs. automatic.

Sure, with stick you become aware of how the car works, the engine, torque and clutch, and you get more control. This might be good for learning.

But automatic lets you pay more attention to the road ahead, whether you are a new or experienced driver.

Re:3 lines of code shouldn't take all day by dotancohen on Thursday December 16, 2021 @06:04AM (#29577070)

  > But automatic lets you pay more attention to the road ahead, whether you are a new or experienced driver.
In my experience, drivers who primarily drive an automatic are easily distracted from the task of driving. They turn around to their children, fiddle with the radio or climate control, I've even seen many adjust their seating position and steering wheel position while in motion. Not to mention the internet-connected smartphone calling them incessantly, which is propped up close to eye level and blocking part of the windscreen.

Contrast to manual drivers, who will happily drive along without music. Far less prone to distractions and far less likely to touch the phone.

One could argue that the focused people who enjoy driving do prefer a manual transmission, to which I'll agree, but I'll counter that the manual transmission itself fosters that focus and enjoyment in the driving experience. The boring automatic is what invites distraction and does not foster enjoyment in the driving experience.

Re:3 lines of code shouldn't take all day by yjftsjthsd-h on Thursday December 16, 2021 @08:23AM (#29577843)
That really sounds to me like manual vs automatic is a manifestation of underlying personality traits. Or possibly just age.
Re:3 lines of code shouldn't take all day by elfchief on Thursday December 16, 2021 @12:21PM (#29580776)
Or just... wrong.

I know a bunch of people that prefer manual transmissions. And every single one of them also prefers loud music while they're driving.

Re:3 lines of code shouldn't take all day by JoeAltmaier on Thursday December 16, 2021 @12:22PM (#29580797)
Or, me. Never turn the radio on at all. Driven manual all my life. Prefer it.
Re:3 lines of code shouldn't take all day by timeon on Thursday December 16, 2021 @05:45AM (#29576968)
Interesting. I was thinking that you pay more attention with manual. The point of manual shifting is not in how the car works. The point is in knowing what will happen before it will happen.
Re:3 lines of code shouldn't take all day by BurningFrog on Thursday December 16, 2021 @06:47AM (#29577264)
To me, it diverts your finite attention to the mechanics of someone a simple machine can do.
Re:3 lines of code shouldn't take all day by danuker on Thursday December 16, 2021 @09:58AM (#29578770)
Here is a chart I found in a quick search:

https://www.researchgate.net/figure/A-comparison-of-accident...

From the paper:

> whether looked at by human factors leading to accidents, by driver age or by accident type and age, the results all support the conclusion that, among all accidents, the accident rate for AT vehicles is twice as high as for MT vehicles except for head-on collisions

Re:3 lines of code shouldn't take all day by marcosdumay on Thursday December 16, 2021 @10:37AM (#29579229)
That is a very good argument for controlled large feedback times in a learning environment, also, just some of the time, when thinking about your code is the focus of the exercise.

I'm one if the people that thinks that coding in paper is a great learning task. I tend to not ask people to do that in practice because it's a very effective way to lose control of a classroom, but I do use the second best task that is asking people to explain their code.

Anyway, if thinking about the code is not your focus, the increased feedback cycle is all cost and no gain.

Re:3 lines of code shouldn't take all day by fhd2 on Thursday December 16, 2021 @09:27AM (#29578420)
Wow, I never quite formalised this in my head, but I think it's true!

At least for small delays, say 30s-3m, I'm not tempted to go for that (other) dopamine shot of checking messages or whatever at all. I keep thinking about the problem I'm solving, what to try if the thing I'm currently trying doesn't work, and so on. I don't remember ever feeling limited with such cycles - literally only when fiddling around with CSS, which I quite often just do in the browser's dev tools for the fastest possible feedback cycles.

Re:3 lines of code shouldn't take all day by muzani on Thursday December 16, 2021 @09:43AM (#29578593)
The drawback with long time to iterate is you have to be in flow to do things. That's non-negotiable in environments with a lot of meetings.

There's also a "sketching" element with faster iteration. On slower iterations, you're engineering. The engineering skill is often underdeveloped but sketching is more valuable without a dedicated designer.

Also some things are poorly documented, often things like UI and browser code or legacy support for say, older Android OS. So even if you have your calculations right it ends up wrong.

Re:3 lines of code shouldn't take all day by gilbetron on Thursday December 16, 2021 @08:59AM (#29578126)
I would say that practicing in a long-compile-time environment is part of improving your skills, but that once you have a certain level of skill with a language and tech stack, then it is beneficial to go back to having compile times of a few seconds or less. Generally speaking, it is far better to have a rapid iteration time to quickly test that the ground you are working on is solid as you progress.

But definitely having a phase where you are dealing with long build times helps you enhance one aspect of software development!

Re:3 lines of code shouldn't take all day by Cthulhu_ on Thursday December 16, 2021 @04:52AM (#29576663)
My longest compile times were when I was doing iOS development (native), and even then I couldn't kick the habit of relying on quickly looking at my changes and using logging for debugging. Not the best.

On the other hand, at least it's a motivator to look at the build pipeline every once in a while and see if there's anything that can be improved.

That said, working in a typed language with good IDE support definitely helps build up the confidence that things will work as intended before you hit compile.

Re:3 lines of code shouldn't take all day by oreally on Thursday December 16, 2021 @08:56AM (#29578098)
That's what you'd like to think. But the quantity vs quality pottery grading story is a tested and retold one. Also this might just go to show that you've settled for a slower pace of progress. And this term 'correctness' that indicates perfection and the enemy of perfection - bad for getting things off the ground.
Re:3 lines of code shouldn't take all day by xwdv on Thursday December 16, 2021 @06:53AM (#29577301)
That’s called compiler driven development.