9 ms·
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 you
by userbinator 5y ago
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".
- jmnicolas 5y agoYour 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.
- rvense 5y agoEh, 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.
- cardanome 5y agoI 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.)
- mmcgaha 5y agoI see you follow the Tao -- beyond all techniques!
- MathCodeLove 5y agoWhat does "1X" mean in this context?
- Jtsummers 5y ago"Average", as opposed to a 10x "rockstar" or above average programmer. Or a -1x or -10x incompetent programmer.
- MathCodeLove 5y agoThanks! Haven't heard that terminology before.
- throwawayboise 5y agoI 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.
- jmnicolas 5y agoYou'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!).
- fy20 5y agoThere 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...
- throw8932894 5y agoIn 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.
- samzer 5y agoThis 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.
- DarylZero 5y ago> 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.
- GreenWatermelon 5y agoGetting 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 ().
- mannykannot 5y agoOnly 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.
- TheDesolate0 5y agoconfused crustacean noises But, seriously, I do NOT miss C/C++.
- 5y ago
- J-Kuhn 5y agoThose 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.
- abrudz 5y ago> 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…
- clktmr 5y agoI 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.
- bipson 5y agoCame 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.)
- brokenkebab 5y agoYour 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.
- marginalia_nu 5y agoIsn'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.
- pbalau 5y ago> 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.
- hutrdvnj 5y agohttps://en.wikipedia.org/wiki/Hari_Seldon https://en.wikipedia.org/wiki/Hari_Seldon
- mannykannot 5y agoI 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.
- torginus 5y agoThe 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.
- jimmaswell 5y agoYeah, 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.
- pjc50 5y ago> 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")
- regularfry 5y agoI 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.
- Cthulhu_ 5y agoMy 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.
- danuker 5y agoI 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.
- timeon 5y agoInteresting. 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.
- BurningFrog 5y agoTo me, it diverts your finite attention to the mechanics of someone a simple machine can do.
- danuker 5y agoHere is a chart I found in a quick search: https://www.researchgate.net/figure/A-comparison-of-accident-rates-by-accident-type-for-automatic-and-manual-transmission_fig2_273511021 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
- dotancohen 5y ago> 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.
- Zababa 5y agoIn 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.
- hiepph 5y agoMy 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.
- globular-toast 5y agoI'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.
- mikewarot 5y agoThis 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.
- barrkel 5y agoIf 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.
- xwdv 5y agoThat’s called compiler driven development.
- Philip-J-Fry 5y agoWhen 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.
- jt2190 5y ago> 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-limits/ https://www.nngroup.com/articles/response-times-3-important-...
- taeric 5y agoThere 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.
- ehnto 5y agoThat 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.
- oreally 5y agoThat'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.
- gilbetron 5y agoI 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!
- deleted 5y ago[deleted]
- dr-detroit 5y agoWelcome to hell my colleagues barely can grok git so youre in unicorn country suck up that fresh valley air.
- fhd2 5y agoWow, 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.
- slifin 5y agoI 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 https://youtu.be/f84n5oFoZBc
- muzani 5y agoThe 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.
- mavelikara 5y agoMany 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.
- throwawayboise 5y agoOr 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.
- mavelikara 5y ago> 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.
- yboris 5y agoI'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.
- marcosdumay 5y agoThat 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.
- necheffa 5y agoOh 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.
- vnorilo 5y agoI 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.