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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

3 lines of code shouldn't take all day

302 点作者 devtailz超过 3 年前

56 条评论

userbinator超过 3 年前
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&#x27;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&#x27;re writing, makes the time-to-iterate <i>very</i> short (press a key and you instantly see your changes). They end up getting into a &quot;dopamine feedback loop&quot; that causes them to continually make tiny changes and rebuild&#x2F;run, and the code written as a result of this looks exactly like what you&#x27;d expect: it barely works, and is full of redundancies, &quot;dead ends&quot;, and other evidence that its author was probably not thinking of anything more than the next line or two when writing it.<p>In other words, reducing the iteration time reduces the motivation to get it right the first time, and the associated deep reasoning&#x2F;&quot;mental execution&quot; 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.<p>Also, I&#x27;m tempted to continue the title with &quot;...unless it&#x27;s APL&quot;.
评论 #29576578 未加载
评论 #29576251 未加载
评论 #29576581 未加载
评论 #29576061 未加载
评论 #29577802 未加载
评论 #29577213 未加载
评论 #29577862 未加载
评论 #29576541 未加载
评论 #29576557 未加载
评论 #29578771 未加载
评论 #29578491 未加载
评论 #29576134 未加载
评论 #29577573 未加载
评论 #29581435 未加载
评论 #29579201 未加载
评论 #29576779 未加载
评论 #29576368 未加载
评论 #29576591 未加载
评论 #29582573 未加载
评论 #29576754 未加载
评论 #29576378 未加载
评论 #29576154 未加载
评论 #29576246 未加载
评论 #29576758 未加载
评论 #29576349 未加载
评论 #29576697 未加载
评论 #29579229 未加载
评论 #29578420 未加载
评论 #29578593 未加载
评论 #29578126 未加载
评论 #29576663 未加载
评论 #29578098 未加载
评论 #29577301 未加载
评论 #29578249 未加载
评论 #29578399 未加载
dan353hehe超过 3 年前
Agree with this so much. One of the main things that I try to do is ensure that the turn around time between testing and writing code is as short as possible.<p>As an example I inherited a codebase about 2 years ago that would take 15 minutes to run the test suite. It was painful. It was just long enough that it would waste an entire day just trying to implement a simple feature. The project was behind schedule and no one wanted to work on it because it just took too long to do anything.<p>So I spent a few weeks running benchmarks on the tests and figuring out where the slow down was. I did a bunch of different things, reusing SQL tables, only truncating tables ones that were used, refactored how the tests worked, removed some code so that docker was not needed to do the testing, etc.<p>I got those tests running in 3 seconds down from 15 minutes. And that changed the whole velocity of the project.<p>Always sharpen your ax.
评论 #29575493 未加载
评论 #29575829 未加载
评论 #29584423 未加载
评论 #29575635 未加载
评论 #29575715 未加载
dinvlad超过 3 年前
Going from &quot;manual testing&quot; to automated testing is the biggest jump. Unfortunately, lots of folks (both developers and managers) fall into the trap of thinking they will &quot;use up&quot; their development time on automated tests, and not really thinking how much time they&#x27;re already wasting just to do (incomprehensive and hand-wavy) manual tests each time.<p>And while this strategy might work for the folks who actually wrote the code (and thus have tacit knowledge about it), the moment they leave and&#x2F;or someone new joins the team, all that &quot;speed advantage&quot; is lost and it turns from minutes to hours to days instantly.<p>Automated tests really are the only way to capture the business logic of any code for it to not to become &quot;legacy code&quot; before its time.
评论 #29576763 未加载
评论 #29576365 未加载
评论 #29576096 未加载
评论 #29576135 未加载
评论 #29577200 未加载
tayo42超过 3 年前
I see this is about game development, but in the web&#x2F;server world idk how anyone ever thinks its acceptable to make development impossible on your local laptop&#x2F;computer. Everyone time I do a code review I need to ensure they didn&#x27;t break local development. It blows my mind that I need to do it, like they think its ok to build and deploy for every little test. When I first joined I spent so much time just getting it to work on my laptop. I really just don&#x27;t understand the mindset. This is has been the case in multiple places. Who was this first person to break local development and decide it was ok. Please fire that person, black list them from getting jobs ever again.<p>We have so many tools to make this easy now like docker and yet it still gets messed up.
评论 #29575638 未加载
评论 #29579404 未加载
ChrisMarshallNY超过 3 年前
<i>&gt; 3 lines of code shouldn&#x27;t take all day</i><p>Sure they should. I often spend all day on negative numbers of lines (I always say that the best code I write, is the code I don&#x27;t write).<p>The complaint seems to center on CI&#x2F;D services that provide inefficient build times. These increase the pain of &quot;round-trip&quot; implement-test-refactor.<p>That&#x27;s quite valid, as this is how we tend to work, these days (at least, that&#x27;s how I work). I often take it a step further, and iterate the design as I progress[0].<p>But I am one that got their start in the waning days of &quot;big iron,&quot; when compute time was the costliest and most time-consuming part of the whole process. You&#x27;d need to schedule for computer runs, which would often happen overnight. This meant that it was <i>very important</i> to have your code complete, and debugged, <i>before</i> submitting it for compilation.<p>Argh. I miss it like I miss a case of food poisoning. It did teach me to do my homework, though.<p>[0] <a href="https:&#x2F;&#x2F;littlegreenviper.com&#x2F;miscellany&#x2F;evolutionary-design-specification&#x2F;" rel="nofollow">https:&#x2F;&#x2F;littlegreenviper.com&#x2F;miscellany&#x2F;evolutionary-design-...</a>
评论 #29583148 未加载
wojciii超过 3 年前
I do embedded work.<p>I experienced this while working for a multinational.<p>- A long build process and linker step that takes ages. 1-2 minutes for a small change.<p>- Trying the change on a real device took perhaps 5 minutes.<p>- A review process that can take days or even weeks sometimes.<p>- There was a process that merged my change set which often failed and needs to be rerun several times - often 1-2 days were spent on trying to commit something where everyone was doing the same.<p>- There are no unit test because some manger decided that they provide no business value.<p>- There were no simulation tools for software be because some manger decided that they provide no business value.<p>- Testing would be done overnight.<p>With the right tools (unittest and pc simulation) I would be effective and could test my changes prior to testing on a real device. This was for me the bottleneck and not how long it took to build the project. I was testing code that was just C on a complex embedded device that I could have tested&#x2F;debugged easily on a PC in 1&#x2F;10 of the time.<p>This was really a management problem where the management didn&#x27;t understand what to do to make their employees efficient with the right tools.
评论 #29576577 未加载
评论 #29577166 未加载
yashap超过 3 年前
If I had to order the things that make me productive, starting with the most important:<p>1. It’s easy to have a fair amount of confidence in changes without even needing to run them. Strong static typing, good&#x2F;clean abstractions, local reasoning - little to no mutability, code is mostly pure functions with side effects pushed to the edges. Being able to just write a bunch of code without needing to run it at all (and having it “just work” the first time, most of the time) is HUGE for productivity<p>2. Excellent automated test suite, with a nice pyramid (small number of E2E tests, solid number of integration tests, exhaustive unit tests). Also excellent monitoring and alerts, with automated canary releases and automated rollback. Basically make it so that it’s hard for mistakes to fully reach production. Being able to be a bit of a cowboy, safely, is huge for productivity too. I’ve worked on plenty of systems without this, and then I’m MUCH more careful, but when you really do have this, it makes everyone so much faster, especially once you learn to stop worrying and trust the guardrails (for simpler changes)<p>3. Test suite runs quickly locally, and is not flakey<p>4. Running the app locally is quick. Also ideally I can run just the one component I’m working on (like a front end, or service, or whatever), but have it fit into a full system running elsewhere<p>5. Full build&#x2F;test&#x2F;deploy process on CI is quick and reliable<p>This article emphasizes 3 and 4, and they’re certainly very important, but I think 1 and 2 are even more important. With them in place, often I don’t even need to do 3 and 4 for more trivial changes - just “I’m pretty certain this works,” and then the tests all pass in CI, and I’m very certain.<p>Compared to systems without 1 and 2, where I have to basically change a line, then run tests and&#x2F;or the app because I’m not sure it’ll work, then do extensive manual testing to be sure because the automated test suite sucks. Muuuuuuch slower.<p>3 and 4 are great, and necessary for more complex changes, but 1 and 2 let you ship simple changes super quick, without even needing to run anything locally. That’s fastest of all, and can still be quite safe in the right environment.
评论 #29579186 未加载
评论 #29576338 未加载
onion2k超过 3 年前
<i>In a future post, I will go over how web developers needs to start taking iteration time more seriously as the influx of new tools and frameworks starts to bloat up build times.</i><p>The newer tools in web dev have crushed iteration times to a fraction of what they used to be. A combination of things like esbuild, fast refresh, yarn&#x27;s offline cache, and a few other bits can get your iteration times on a site you&#x27;re manually testing down to milliseconds to both build and update (literally). Decent devs have been writing tests for years; the test runners could be a bit faster but people are working on that as well.<p>The React app I&#x27;m working on at the moment takes well under a second to build, under 10 seconds to run the test suite (could be a sign I need more coverage..), and milliseconds to update the code in the browser in dev mode. It&#x27;s nice to work with. It&#x27;s not even clever or special. A default Next.js app will do that. Create-React-app 5 launched a few days ago with more of the tooling too. In Vue things like Vite are based on the new fast tooling and it works well. Vue dev work is fast. SvelteKit even goes further by using Snowpack to remove the bundling step entirely. Snowpack claims a default refresh time of 50ms.<p>I really hope the author&#x27;s article about web dev is simply &quot;Yeah, update your tools and you&#x27;ll be fine.&quot;
评论 #29577487 未加载
smcameron超过 3 年前
Heh. I remember a time back when I worked at Google, and we&#x27;re using a proprietary internal language to construct some monitoring stuff. It took three of us a day to implement some simple thing that was a line or two of code, so opaque and intractable the language was. When we got it to do what we expected, we still weren&#x27;t quite sure it was really correct. It was really kind of an existential moment where we collectively wondered, &quot;wtf are we doing?&quot;
评论 #29580161 未加载
webmaven超过 3 年前
The last time some one told me something like &quot;changing three lines of code shouldn&#x27;t take all day&quot;[0], I responded with &quot;Fuck you&quot; because the way they managed to work &#x27;faster&#x27; was to make and test their changes in production before committing them to version control.<p>I also once spent a week pursuing a small-but-necessary authentication flow change across two dependencies (one of them owned by a different team) and three tests, only to be fired for talking to the other team members directly (I was a mere contractor) rather than playing &#x27;telephone&#x27; and relaying everything through my management and their management, which would have made it take a month instead.<p>[0] It was actually five lines of code.
jeffrallen超过 3 年前
Neves Law says that &quot;the harder a bug is to find, the smaller the fix will be&quot;. The worst Neves ratio I ever saw was about a week to two bits, where a plus (0x2b) had to be changed to a minus (0x2d).
评论 #29579261 未加载
kyruzic超过 3 年前
How I wish a single line code change only took a 15 second build.<p>The java app I work on regularly takes 3 minutes for a single line change. Then you just need to pray that jrebel will work today and actually hot reload your change. Otherwise you have another 8 or so minutes of redploying weblogic.<p>Of course the ideas suggested in this can help, but when you need to run an integration test which also takes minutes to run you realize that 3 lines of code isn&#x27;t bad for a days work.<p>One day soon I will never touch Java again.
评论 #29575679 未加载
评论 #29578961 未加载
KronisLV超过 3 年前
Recently decided on using TDD for some library code and aiming for &gt;90% test coverage at my dayjob. Frankly, things do take longer to develop this way and i needed to put in more thought into how the interfaces should be structured, vs just doing what people sometimes do in other projects - just relying on concrete implementations or using frameworks that use reflection to do what they want.<p>However, the experience itself feels like a positive one - even if the code takes longer to craft, it&#x27;s much easier to work with, since now i don&#x27;t need to worry about sloppily written if&#x2F;else chains that depend on enums or runtime type checks, but can utilize different implementations as needed. Also, writing the actual tests allowed me to be sure about how everything would actually work, all the way up to discovering that Paths.get (Java) on Linux accepts almost anything as a valid path string, whereas Windows has actual validation rules, leading to many headaches in regards to the code coverage quality gates that i set up, since the coverage differs based on which platform you run on.<p>But i guess that my point still stands: in certain circumstances slowing down might actually be a good thing, when you really want to know how your code will work under most circumstances and make it maintainable.<p>Of course, on the other hand, compilation speeds and other factors in regards to the speed of iteration definitely shouldn&#x27;t be overlooked either, and having everything else apart from writing tests and actually thinking about how everything will fit together be faster is a good thing! I&#x27;m not sure what i&#x27;d do if my test suite took 10 minutes to run instead of 10 seconds as it currently does. Probably drink lots of coffee.<p>I guess it depends on slowing down for good reasons, vs just wasting time because of tooling or other sub optimal circumstances (e.g. what was described in the article, personally i&#x27;ve also seen a local API service be pretty chatty with a remote DB which was slow over a VPN, yet no one had a local DB with all of the migrations in place, and a bunch of other things like that).<p>Offtopic: Anyone remember how fast Pascal compiled? Now that was a really nice stack to do some stuff in, it&#x27;s a shame that it never got as popular as Java, or didn&#x27;t have tooling like JetBrains has, it felt like a more ancient Go (which is also pretty good as far as ergonomics go).
评论 #29576442 未加载
substructure超过 3 年前
AWS CloudFormation had one of the worst user stories related to iteration time a few years ago.<p>The lack of feedback between the writing of the yaml file and validation of the structure&#x2F;type&#x2F;format was frustratingly slow. I would pay good money for better tooling in the Infrastructure as Code(IaC) space.<p>Waiting for the resources to update, fail with cryptic error messages, then slowly rollback only to then fail the rollback. Now in an invalid state, manual resource creation was required before the rollback would succeed.<p>The AWS cdk has improved this significantly. As a result the sun shines just a little bit brighter.
评论 #29575689 未加载
评论 #29575873 未加载
aappleby超过 3 年前
This is why you hire old programmers, so that you have someone to yell &quot;WTF&quot; when they see you have no testbench. We had that stuff figured out in the PS1 days.
PaulDavisThe1st超过 3 年前
In 1989, I was working at my first (very short lived) US job, for Bell Labs (not <i>the</i> Bell Labs, but related). I was working on their &quot;office-scale&quot; phone switches, the kind that allowed you to forward a call from one extension to another. There was a hard-coded limit of (I think) 16 forwards, and for some reason it was decided to increase this to (I think) 64. This involved changing a constant in a header file, a documentation string and one conditional in the code that for some reason didn&#x27;t use the constant.<p>Expected time for this work was: 1 week.
评论 #29579605 未加载
zuhayeer超过 3 年前
Another thing here is that often times people are so busy &quot;developing&quot; product that really trivial efficiency gains get overlooked. Things like simply removing unnecessary parts from the build at least when you&#x27;re testing &#x2F; in dev mode. Also compartmentalizing the build to the portion of the app you&#x27;re working on, ensuring it&#x27;s not building the entire app when you&#x27;re only testing one feature (you&#x27;ll be surprised how common this is even especially at large companies). It&#x27;s a huge value add to the rest of your team to bite the bullet and take an hour or so to shave off some minutes from the time you have to wait for a build. That one hour saves you from many multiples more (hours &#x2F; days &#x2F; weeks) of fiddling your thumbs in the breakroom waiting for a build to finish.<p>(better yet to have someone regularly scanning for these efficiency related things)
solididiot超过 3 年前
Was working in a similar product and it was by far the worst dev experience I&#x27;ve ever had. It was actually worse than what the post describes. It was like having to go through a lot of stages to get to the area I&#x27;m working and half of them not working at all - so instead I was doing bug reports on other people&#x27;s areas which was only slightly familiar with. (Yeah, our CI QA gateway was a joke. Our CI in general was a joke).<p>It was hell. That much so that I jumped to the first half-decent role that came my way.<p>Something is wrong with the way we build systems that integrate too many other systems. Perhaps if we designed them with a TDD approach all the way up things would be better...or worse. Dunno. Sometimes what we&#x27;re trying to do is just way into the entropy zone.
sovietmudkipz超过 3 年前
I love this. I made an ask HN post about testing practices for games[0]. The answers I got are interesting and an opportunity to reflect. There are clearly some differences in programming cultural practices.<p>I’m of the opinion that applying great testing practices to unity programming is very important. It’s been fun synthesizing ideas I’ve encountered into my hobby game dev career.<p>I’m glad there are others out there doing the good work of generating content to popularize the benefits of good testing practice :)<p>[0] <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=29459292" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=29459292</a>
meheleventyone超过 3 年前
Whilst I very much agree with the premise I do think this exposes a fallacy many programmers fall for. That passing unit tests means your code actually does what you think it does. Using unit tests this way is a crutch to avoid improving startup times, implementing hot reloading and other schemes to skip gameplay. You lose an awful lot by not testing your code for the job it’s actually expected to do in situ. In games this results in increasing the total iteration time as it’s usually now a different person who actually runs the code, find issues and submits them back.
评论 #29575893 未加载
评论 #29576089 未加载
评论 #29575896 未加载
thibran超过 3 年前
As someone writing Lisp code, this feels so archaic. Then I remind myself that Lisp is older and than those games and that the future just hasn&#x27;t caught up yet.
ineedasername超过 3 年前
<i>Testing changes here could mean progressing through several seasons of career mode in order to test out a change</i><p>That&#x27;s like the Groundhogs Day of programming. Living the same season over and over again, changing things until you get it right and can move on. Sure, ai guess that&#x27;s kind of programming in general, but on this level it&#x27;s most of your day. No developed cheat codes?
cagenut超过 3 年前
The &quot;sub-second response loop flow state&quot; he mentions here is &quot;the doherty threshold&quot;[1] just applied to programing as a particular user experience.<p>After working at a CDN that delivered a couple hundred kb objects in milliseconds around the world I thought &quot;code is data, so why cant code be updated in milliseconds?&quot; I tried starting a startup that could do this, treat code as data, and therefore achieve sub-second round-trip trial-and-error loops.<p>Did not pan out, but to be honest we never really got to testing that thesis. I still think it could be amazing, just not sure how much of the lang&#x2F;ide&#x2F;build&#x2F;test&#x2F;deploy&#x2F;validate cycle you could integrate and how much you&#x27;d have to build.<p>IMHO this is the main thing that made PHP successful. The &quot;edit a file -&gt; alt-tab -&gt; click refresh&quot; test loop being faster than you could click.<p>[1] - <a href="https:&#x2F;&#x2F;lawsofux.com&#x2F;doherty-threshold&#x2F;" rel="nofollow">https:&#x2F;&#x2F;lawsofux.com&#x2F;doherty-threshold&#x2F;</a>
rob_c超过 3 年前
By comparison I&#x27;ve worked with someone who pushed a &#x27;2 line fix&#x27; live which had fallout which lasted &gt;2 weeks because their code was pushed without checking to production and had hard-coded their uid into the fix because it was a quick &#x27;hack&#x27;... The main reason when cornered was &#x27;running pip install is too difficult to run the test-suite&#x27; (tests themselves took &lt;30sec to run all ~300).<p>We eventually (1 week later) got permission to pull the release from our shared (pseudo write-only) storage area but as he was project lead he tagged a new minor version for his &#x27;2 line fix&#x27; without consulting anyone and our users were reluctant to move to a new bugfix release unless prodded with a red-hot poker.<p>Can&#x27;t say I miss working with _some_ programmers turned managers.
wingerlang超过 3 年前
Regarding the &quot;testbeds&quot;. I recently built this for an (iOS) application and it helps SO MUCH. Each module in the app has its own local target (the testbed) with a menu which lets you open the module for a given scenario. A scenario is a combination of local JSON for endpoints, device fakes (think fingerprint enabled&#x2F;disabled) and module-specific configurations. The ability to near instantly get to a specific functionality with the same network requests makes everything super simple. I run the UI tests on these targets as well, and they are near perfectly non-flaky.<p>The best part is when I receive a new bug report from QA, since they include the network logs I usually just need to create a new scenario, register the JSON and fix the reproduced issue.
roeles超过 3 年前
&gt; This is the sweet spot amount of time where you become tempted to “do something else” while you wait.<p>I think this is an important observation. The time where you &quot;wait&quot;, you can allow your mind to drift off right after being immersed in the problem. In my experience, this time has the potential to give you great insights.<p>I think fast feedback is great, but only if you know what you&#x27;re trying to accomplish. Or trying to learn. Don&#x27;t use it as a tool to throw stuff against the wall and see what sticks. Once you start to do that, spend some time away from the computer. Draw a picture, formulate some hypothesis based on your mental model. Make a map before you enter the jungle of trial-and-error.
angarg12超过 3 年前
If what is slowing your iteration speed is testing, I&#x27;d say you are in a somewhat happy place. At least you can write test, speed up the build, or somehow improve the situation.<p>What drains my soul is when you need to use legacy or poorly designed tools that slow you down and you can&#x27;t do much about. Here are real examples of times I wasted entire mornings: tools that, if you make a mistake, leave the environment in an inconsistent state, and then you need to manually fix it (it isn&#x27;t documented and changes on a case by case basis). If you miss anything or make another mistake, start from the beginning again.
globular-toast超过 3 年前
This is something I&#x27;ve worked to get right my entire career. Whenever I start a new project, I make sure the feedback loop is small. If it&#x27;s a new technology for me, this can take a while to get to a process I&#x27;m happy with, but it&#x27;s worth it.<p>Way back when I was at uni I remember watching over people&#x27;s shoulders at the painfully slow iteration process. I couldn&#x27;t believe not a single one thought of doing anything about it. They looked more like factory workers, endlessly turning the same handle and waiting. If you spend your time doing this, you will have no time left for creativity.
flohofwoe超过 3 年前
Entirely relying on unit tests for development can never be the only solution, because tests are quite simply not the product, and they shouldn&#x27;t be a substitute&#x2F;workaround for fast iteration right on the product. Easier said than done of course, especially in such a complex environment as game development.<p>The future for fast compiled-code iteration in game development will most likely be hot code reloading, so that code changes are compiled and implanted right into the running game instead of requiring a full linker run and then getting back to the right place in the game to be tested.
评论 #29581565 未加载
jarek83超过 3 年前
Sounds like EA has (had?) actually pretty good developers. The game itself has so many things gone wrong that from the players perspective it&#x27;s very hard to find any good words for. Shame that the company hates their customers so then customers started to hate anyone involved in EA. In the forums of the game, devs of this game are considered to be the laziest and the least skilled across the industry.<p>PS. Anyone did figure out whether DDA is officially in the code or is it just a matter of network quality difference between players and the server (the game stopped to be p2p in any mode)
kubi07超过 3 年前
My first full time job as a junior dev was to maintain a legacy GWT project which makes tons of $ every year.Setting up the development environment took 1 week. For some odd reason we couldn&#x27;t build the project module by module. Build was taking at least 2 mins with the bare minimum module count. I quickly become depressed. Waiting the builds and half way into build an error pops-up and you start again. This was 4 months ago, i literally became a deppressed junior dev who hates his job in 1 month. I started applying for job after a month and quit that job after 2 months.
adolph超过 3 年前
<i>Bill Atkinson, the author of Quickdraw and the main user interface designer, who was by far the most important Lisa implementor, thought that lines of code was a silly measure of software productivity. He thought his goal was to write as small and fast a program as possible, and that the lines of code metric only encouraged writing sloppy, bloated, broken code.</i><p><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>
dinvlad超过 3 年前
1000% this. THE secret to productivity is not some magic skills (though that helps) but just the right tools used correctly. That gets you ~80% there.
whalesalad超过 3 年前
I love building test harnesses. I think the trick is making sure that your system is built in such a way that 1. You can actually pull the core of it out to run in a different situation and 2. You keep enough of the real system such that you’re not getting lots of green passes which are going to completely fail in the real world.
mysterydip超过 3 年前
The other day I was working on an embedded system and running out of space for the program (512KB). It took me two days to rewrite a few sections to use compressed data instead of the &quot;easier to read but bulkier&quot; original way. The end result to the user was the same, but used 10KB less space.
Tarucho超过 3 年前
I worked in lots of projects like this. The most amazing part is most devs didn´t care. Never understood why.<p>In one of those projects the code got so big and bloated that it took around 1 minute (sometimes more) to move from one line to the next while debugging. For me it was a torture, it was ok for most.
bitwize超过 3 年前
Makes me even sadder that something like GOAL didn&#x27;t take off. In GOAL, you could make changes at the REPL, compile instantly, push the compiled changes out to the console and see them immediately in the running engine.<p>There&#x27;s a reason why old-school Naughty Dog games were so refined.
literallyaduck超过 3 年前
You can pack in a lot more training, reddit, and mobile games into a day when you only write 3 loc.
max002超过 3 年前
Haha, so true. People are used to old ways. I know its not c++, but If you run docker on mac or Windows for web dev or any other project that has thousanda of deps you know how painful docker sync is and how slow&#x2F;crash prone. But hey &quot;docker is easy&quot; :)
allo37超过 3 年前
IME reducing iteration time is one of the best ways to increase my productivity.<p>I like Android Studio&#x27;s approach to running unit tests: It will run them on the host PC instead of deploying them to the target, so you can avoid the often long deployment process.
nearmuse超过 3 年前
While it sounds painful because of the inefficient development &amp; testing process, I think that if that day is spent on research instead (looking for a better solution or reading existing code) it is OK to spend 1 day on 3 lines of code.
wwilim超过 3 年前
Coming across this article and reading it while waiting for a long build was very ironic
评论 #29582384 未加载
m0llusk超过 3 年前
That really depends on how critical the code is. The amount of attention that has gone into optimizing ObjC message send is astounding with many man hours of top programmer time in each and every single line.
gitgud超过 3 年前
&gt; <i>“it takes too darn long to test these changes, is there a better way?” This is a question we should be asking ourselves every day.</i><p>Agree, continuously re-evaluate your systems, they can always be better
senectus1超过 3 年前
For all the issues I have with Elon Musk, I really like his design philosophy.<p>Step 1 Make it less dumb<p>Step 2 Delete a part of the process<p>If you&#x27;re not adding step in 10% of the time, you&#x27;re not deleting enough<p>Step 3 Simplify or Optimize<p>Step 4 Go Faster<p>Step 5 Automate
评论 #29576027 未加载
pechay超过 3 年前
Aside from looking at changes in your dev methods, this is a good way to demonstrate to your management the value of having fast, up to date hardware on your desk.
xwolfi超过 3 年前
This guy is young and probably not educated in modern dev. I refuse C++ jobs when I ask how they do unit test and they reply it&#x27;s too hard in C++, and take Java jobs because there the first question THEY ask is HOW I do unit test, what I think of coverage metrics (hints: they don&#x27;t matter much) and how I propose to enforce ALWAYS unit testing important code.<p>In this blog post the guy took 3 job change to DISCOVER unit tests, it&#x27;s insane :( It&#x27;s not like they know but don&#x27;t have time, it&#x27;s that he&#x27;s a &quot;champion&quot; just for proposing limited scope testing.
评论 #29576703 未加载
atum47超过 3 年前
I once spent the better part of a day figuring out a off by one error, when I pushed the fix it changed two characters. Almost the whole day, imagine that.
thrower123超过 3 年前
It&#x27;s always fascinating how game development studios tend to consistently lag ten or fifteen years behind enterprise software development practices.
Jtsummers超过 3 年前
From a systems perspective, there is a balance to be achieved.<p>You want faster iteration times in order to provide feedback, but if they&#x27;re too fast then you neglect other things or end up swinging wildly. Consider a thermostat that turned on the heat or cooling at just .1 degree below or above its target, or turned it off as soon as it hit the reverse. Or if because the feedback comes in as a torrent of data you attend to that feedback instead of other elements of the system or your capabilities.<p>As a system gets more complicated you have more factors to consider. In the case of programming, if you rely <i>too</i> much on that near-instant feedback, how much are you internalizing about your system, language, and environment? How often are you making the same errors but recovering quickly (so it&#x27;s not slowing you down too much, or doesn&#x27;t appear to be slowing you down too much) because of the feedback? How much faster could you ultimately be if your work were <i>smoother</i> and not so rough and jagged?<p>Introducing a delay, here, gives you time to contemplate. Even if it&#x27;s just taking an hour or two a day to sit back from the keyboard and ponder what you&#x27;ve done that day and what you will do the next. Create a plan instead of jump into action, even if the plan doesn&#x27;t get executed perfectly or ends up being the wrong plan that bit of contemplation is when you <i>learn</i>.<p>But too long a delay (especially a forced delay) causes other problems. The actually needed feedback (not just compiler errors and such, but your V&amp;V issues discovered from testing and evaluation) getting delayed by a day or more can be too much (especially when working with a team, where other parts are potentially changing around your own changes). Too long a delay also promotes batching many unrelated changes together because you don&#x27;t want to sit through the whole process again. Consider a system that takes a week or a month to get feedback from an external test team, you&#x27;d be tempted to throw many changes at them because of that week or month long delay (or more!) and not just one change.<p>So strike a balance, find a point where your iteration cycle permits you time to think and not just act so you can really learn (both programming and the particular system you&#x27;re trying to develop). Smooth out your development so that you&#x27;re slowed down not by having to take <i>corrective</i> steps but having to ponder <i>logical</i> steps. &quot;Is this the right data structure? Well, if I isolate it in my domain model then I can swap it out later and no one will be impacted.&quot; or &quot;I&#x27;ll take a walk around the building and think about what I actually need here.&quot;
tomrod超过 3 年前
This is so important! Good tools, good processes, and even keeled egos can accomplish awesome things.
makach超过 3 年前
Sometimes a negative amount of code lines took me whole days...
phendrenad2超过 3 年前
3 lines of code per day? Damn that&#x27;s pretty good!
privacyonsec超过 3 年前
Now I understand why making games takes so much time
mro_name超过 3 年前
even less so should three letters take ages, shouldn&#x27;t it?<p>E = m c^2<p>Any 5-year old can write this.
vbphprubyjsgo超过 3 年前
Uhhh... just improve your build process.