7 ms·
Fear makes you a worse programmer (2014)
- atomicnumber3 3y agoAt an org I worked at, we (the whole org) were notorious (internally) for just not being able to execute big projects. In late 2022 2 of the top-level big priority initiatives got "pivoted" (eyeroll) because they just weren't "going". And allegedly a big part of the problem was that nobody wanted to admit that things weren't going just swell on these big projects, so they gussied up their status reports, and then when this was done systemically across every person in the entire project, you got a project that looked real good until it mysteriously missed deadlines, and after enough of that, finally the curtain pulls back. Now, management and leadership were most affronted by the state of affairs, I assure you, and many words were spent extolling virtues and lambasting vices and sin. But let me assure you, it's not that they love eloquent speech, they were simply not allowed to say the real reason for any of it because the real reason was a trait of the org that the founder thought was a key to their success. They run a meritocracy, you see, and a pay for performance comp philosophy. They run performance reviews very tight, and getting a passing mark is publicly said to be something to be proud of. The natural result being that everyone lives in constant fear, and being put on a big risky project is a great way to not get to vest your whole equity grant. So everyone plays defensively, the smartest people dodge the hard/big projects, and so on and so on. And they'll never fix it because they are not allowed to. How tragic.
- bluefirebrand 3y ago> Even with good design, w/o tests you will fear change and so the code will rot. With good tests, there’s no fear, so you’ll clean the code Has anyone ever actually found this to be true? I work in a place with 99% test coverage requirements and it's honestly still a super brittle system that everyone is afraid to make big changes to In my experience, automated tests don't promote quality engineering, they just calcify whatever quality exists And before you get into it, TDD is not a panacea for this problem
- nickjj 3y ago> Has anyone ever actually found this to be true? It depends. I've written a number of apps where I'm fearless with making changes because I trust the tests I wrote. One of the apps has been running for 7 years and it's had a lot of big updates, refactors, etc.. I'm breaking every rule there is on jinxing things but there hasn't been a single bug introduced due to those updates and there's ~85% coverage. It's only a ~3k line Flask app though, but it does get deployed straight to production with no staging environment and gets hundreds of requests per day. It writes to a DB, Redis, interacts with multiple 3rd party APIs and sends out webhooks so it does quite a few "external" things. I've never been a fan of TDD and personally I think tests that really hit your DB, Redis, etc. help a lot more than mocked out unit tests or a billion unit tests and nothing else. I tend to write more tests that really test things together. Not full blown Selenium style tests, but I do really write to the DB and other data stores in tests and often use a framework's built-in test client for making HTTP calls. Everything can still be really fast too (~100 tests in 2 seconds is my usual rough guide for having an assortment of "real" tests with Flask).
- solraph 3y ago> I've never been a fan of TDD and personally I think tests that really hit your DB, Redis, etc. help a lot more than mocked out unit tests or a billion unit tests and nothing else... ...but I do really write to the DB and other data stores in tests I've come to the conclusion that the idea that "unit tests" should test functions/objects in isolation with completely mocked dependencies is based more on the slow speed of those dependencies in the past than what actually makes for good tests. Now that we have faster computers and storage devices, and easy/fast store creation, we should move past this. Obviously, this is very dependant (no pun intended) on the dependency in question, but as a minimum, anything with SQL should have a test that hits a real SQL DB (PG in docker for example) at some point.
- tibbar 3y agoEarly on in my engineering career, there are a handful of times I was assigned to a project where I was set up to fail. I didn't understand the situation until far too late. There are a few tell-tale symptoms: I didn't quite understand what I was supposed to do; I didn't really know how to do it; and I didn't understand how the assigned work actually solved a higher-level problem. No one else did, either (these situations usually represent a failure of management.) As those projects dragged on and I was unable to make "progress", whatever that meant, I felt shame and a mounting dread of returning to the console each day. Eventually, fortunately, I was able to roll off them (not having accomplished much in the preceding month or two) and got back to doing useful things. These days I can usually recognize such projects in advance, but it's still not always possible to avoid them.
- nomel 3y agoAs a senior person, these are some of my favorite types of projects, because I feel like it's where I'm the most useful, and where I can have the most impact: understand the need, then implement the need rather than the request. When I see people struggling with these, it's usually from a lack of information seeking/gathering, where they first sit down and code rather than spend the first few weeks talking, reviewing understanding, and, most importantly, finding those few A-team people that have meaningful input. Definitely not something someone early in their career should be given, but these types of problems usually benefit from devaluing manager input, since they have a disconnected/warped perception of reality. I take these projects only if the understanding is that I'll be solving a problem, taking input from all involved, rather than implementing a specific solution.
- j45 3y agoGetting the need right, in lockstep with the audiences realization of it is an important soft and hard skill that should be better taught.
- nomel 3y ago> in lockstep with the audiences realization Perfect wording! I tell people the hardest problem, in my work, is getting people to see there is a problem. The crazy workarounds that people will come up with, to avoid the root issue, are really incredible.
- deleted 3y ago[deleted]
- Attummm 3y agoIn my experience, fear serves as a double-edged sword in software development. While it can inhibit us from making necessary changes, it also acts as a powerful motivator. The fear of introducing new bugs drives us to conduct thorough testing and think critically about our code. Moreover, the fear of burdening others or causing system outages reinforces the importance of careful consideration and caution The article reminded me of the military's emphasis on maintaining a healthy level of fear to prevent complacency. When working on new projects, there's room for bold moves and experimentation. However, in existing large-scale systems, the impact of our actions extends beyond ourselves to the entire team and company. Let's avoid cowboy coding and prioritize stability and reliability.
- kevmo314 3y ago> If you’re scared of making changes, you can’t make something dramatically better, or do that big code cleanup. Funny, reading the headline I thought the article was going to be about the polar opposite. Over time, I've found the headline to be absolutely true, but I have also found that many invest in tooling and overabundant testing out of fear. eg, "What if we need to recreate our entire stack from absolute scratch?" I mean yeah, from that perspective terraform is totally useful, but what's next, automate the entire creation of the company, including customer acquisition and hiring? How often do you really need to recreate everything from scratch? As a more junior engineer I used to have the confidence that things just wouldn't break, or at least if they broke it wouldn't be such a big deal. More often than not I was right. As a senior engineer, I find myself just pushing my junior engineer tenets. Usually everything will be fine, and even if it does break, we can fix it. Write tests and invest in tooling if they're helpful. If they're not, don't be afraid to just write code by ssh'ing into a server.
- deleted 3y ago[deleted]
- kazinator 3y agoThe Rust community, ecosystem and its advocacy and advancement depend critically on fear.
- kevingadd 3y agoA fear not mentioned directly in this post that definitely makes you a worse programmer is fear of (perceived) individual failure. I've dealt with (usually junior, but not always) programmers who shied away from difficult tasks or complex parts of a codebase. It seemed like they were afraid of failing and being seen failing, and preferred to select tasks they knew they could handle. A natural outcome of this is that you end up with big important parts of your codebase that are only understood by a handful of people, because they're scary. The fact that we had tons of automated tests didn't fix this. You can partly address this by trying to make sure every part of your codebase is easy to understand, but sometimes your code is just going to be complex. That becomes an education problem, you have to work with these developers and coax them into confronting difficult chunks of code and help them develop the skills they need for understanding. The same applies for development/debugging techniques. I walked one developer of equal seniority through using WinDbg once, because javascript he wrote was causing IE6 to crash. It was my first time doing it, so the role I had to play was the "let's just try things and see if we can get anywhere, there's no harm in failing" facilitator. Better to try something new than to give up. We didn't come away from the exercise with clear answers, but we had learned some useful information in the process by exploring.
- DustinBrett 3y agoI've heard it's even the mind killer.
- jt2190 3y ago(2014)
- ketanmaheshwari 3y agoI think 2014 should be added to the title.
- deleted 3y ago[deleted]
- titzer 3y agoThe proper way to fear in programming is to fear: 1. Your input will be incorrect/corrupt/malicious. Sanitize the crap out of your input. Think of every possible way your parser could go off the rails and fail. 2. Your code will hit pathologically slow cases. Thread the needle between the overly complicated but linear thing and the simplistic but straightforward to implement, debug and test O(nlogn) thing. 3. Your code will fail in production in a way that is hard to debug. Put in logging, monitoring, and dashboards. Check them. Alert on them. 4. You'll have to debug your code. Put in tracing modes, use good names, divide things up to separately debug them. 5. You'll have to explain your code. Make it easier to understand for future, drunk, or stupid you.
- saurik 3y agoFear also makes you a better programmer: people these days are way too willing to take on cavalier amounts of risk and then offload deciding whether it worked or not onto others in code review, onto a stifling number of unit tests, and even--most frustratingly--onto the ability to scope or roll back changes before they affect "too many" users. The reality is that the number of people whose photo library or bank account--or even merely whose birthday party--it is "acceptable" to ruin is 0, not a supposedly-negligible 0.0001% of your billion users :(... that's a thousand people whose lives you have affected, and at least they deserve some kind of personal apology from the engineers who failed them! My entire job and most of the money I have made in my life is following behind "fearless" programmers and picking up after them: tearing open holes, protecting user funds, and even winning a (giant) bug bounty from a company that trusted their tests too much and leaned heavily into "move fast and break things" :/. You should have courage to stand up to fear, but you should never discard it or think you have somehow outsmarted it: that fear is your best defense from hubris and it also shows you have empathy for those who rely on the correctness of your work.
- black_13 3y ago[dead]
- throwiforgtnlzy 3y agoWhile some languages are safe or safer now, the concerns of correctness and robustness are not solvable by unit testing or code coverage alone. Other holistic layers of smoke testing, property testing/fuzzing, integration testing, and user acceptance testing (UAT) must be included. Robustness means making the code defensible and easy to understand, test, refactor, and modify. Where there is most deafening silence in the area of proving correctness of the codebase and of the resulting binaries. seL4, klee, fp, and coq ran in the right direction with this in some aspects, formal verification still hasn't become a standard practice because the level of effort is still costly and tools to accomplish this aren't readily available.
- hiAndrewQuinn 3y agoI wouldn't say I have no fear reflex at all, but I've definitely noticed I have far less of it than is average in this industry. My reasoning is that, even if what I try fails utterly, I myself probably learned a lot trying to pull it off, and since my aim has always been to maximize mechanical sympathy, that's hard to write off as an unmitigated loss.
- spintin 3y agoAs with all tools the goal is to be able to use the tool without fear. Remember the first weeks of coding C? It took me 4 years to not get cold sweat just thinking about using it when the compiler didn't inform you about a typo and you have to rollback the code all the time to fix problems and learn assembly (in X86, ARM and now Risc-V). And that was without deadlines or any delivery pressure. Today I realize C is for mad people, but I learned to respect the thing while no longer being afraid to use it in a real scenario.
- jaimex2 3y agoI loved Julia's blogs as a young dev, they were like watching Star Trek TNG episodes. All hope and naive solutions. I remember reading this one especially back then. Then you learn the tests are a monster stack themselves, often taking more effort than the actual features they are guarding. Then you are part of one of these 'blameless postmortems' and realise everyone has an opinion and there are now 80 outcome actions, half of them complete horse shit but they are high priority now and jammed into your sprints for the next 6 weeks.
- rramadass 3y ago> All hope and naive solutions. Funny, but quite true.
- rramadass 3y agoNo, Fear (within bounds) is very much a necessity for a good programmer. It makes him/her think hard before doing anything. As the saying goes; "there is a fine line between bravery and stupidity". There is nothing worse than some smart-aleck programmer being all gung-ho and willy-nilly refactoring/rewriting code as they see fit when they don't understand the complete system yet. Only if the entire system design can be held in your head (possible if you were part of the original design team and stayed with the product through its evolution) can you afford to be truly "Fearless".
- liampulles 3y agoEspecially true if you are going to be touching prod. Part of being a junior I think is hearing a few horror stories, hopefully enough to make you stop and think before pressing enter on that rm command.
- Funes- 3y agoFear makes you worse at everything but running away from something. Also, being cautious is not the same as being fearful, the same way that braveness is not impulsivity (or stupidity).
- layer8 3y agoIt’s a matter of degree. An uneasiness about writing code you’re not certain is correct, and being apprehensive of code possibly causing faulty behavior in certain cases, is a good thing. Incidentally, AI not having that kind of feelings could be a drawback for it creating code.
- starbugs 3y ago> Fear makes you worse at everything but running away from something Even running away can get more error-prone with fear.
- sharno 3y agoI'm surprised nobody mentioned types or type systems as one of the best solutions for eliminating fear. Out of all the systems that worked on, the ones that were changed fearlessly were stuff written in Haskell and Purescript. That was before Rust became so popular. These systems were changed fearlessly and we had very minimal tests. The code reviews were much easier to perform as you don't tend to check if the code might throw exceptions but you just need to think about business logic. These days I'd argue that Rust is at the same level of Haskell and Purescript in fearlessness. Some languages that removes certain fears: - Kotlin: removes the fear of null exceptions - Go: removes the fear of forgetting about an error that this function throws - Languages with ADT (Haskell, Rust ... etc): remove the fear of missing a case
- m463 3y agoI wonder if there is a sort of "confident programming" alternative. Sort of "play to win" instead of "play to not lose" I imagine confidently coding and doing stuff like: if(count < 0) panic(); instead of: if(count < 0) { log_message("count is not supposed to be less than zero!"); error_recovery(); fallback_handler(); // etc... }