7 ms·
Why it’s necessary to shoot yourself in the foot
- jackblemming 3y agoOr you can do an apparently shocking thing to programmers: learn from others’ mistakes. Of course this would require admitting other people aren’t complete idiots and may actually know a thing or two.
- kiba 3y agoNothing drive the point home than emotional pain. Of course, if it can be avoided, do learn from those who made mistakes, but sometime the best teacher is doing it yourself.
- joeyo 3y agoBy three methods we may learn wisdom: First, by reflection, which is noblest; Second, by imitation, which is easiest; and third by experience, which is the bitterest.
- atoav 3y agoLet's celebrate that civil engineering isn't as arrogant as software engineering then. If a bridge collapses all the world learns from it. If Microsoft fucks up their Roken Authorization it is just another software error that cannot be helped.
- pjerem 3y agoI’m pretty sure civil engineering is based on mostly immutable knowledge of the physics laws which allows best practices no to evolve every year or that when they evolve, a mandatory training is required for everyone. I’m also pretty sure that students in civil engineering are making virtual bridges collapse every single day. It’s also true in other engineering branches : we have barely the same planes design since decades and that’s for good reason. It’s not really something you can do when rules and best practices are going left and right every couple of months. And don’t get me wrong I’m convinced that the peak of program engineering is in the past. But the industry keep forcing new things to developers.
- atoav 3y agoWhat I refer to here is the fact that every early bridge collapse has informed the practise of the whole field after¹. Meanwhile in programming you will literally have someone hash their passwords using md5 in 2023. Maybe the difference is liability and possibly ending up in jail when things break. Software error has become a common excuse these days. If your companies enourmous unethical fuckup is exposed, just blame it on software error. Everybody understands: software errors happen and there is nothing we can do to prevent them from happening. Only this is not true. We know how to test code. We know about formally verified code. In safety critical domains (aviation, automotive, industrial, banking, ...) we have been doing this forever. I am not saying that every garden shed should have to follow the same rules as an interstate bridge, but maybe if our webservices fail spectacularly on a regular fashion maybe we should look towards software engineering practises that prevent things from failing that often? ¹ After that most bridge collapses have been due to organisational failures, like a lack of maintenance or a lack of oversight or enforcement of the established rules
- mrfumier 3y agoExactly. You don't have to redo all the mistakes the others did, otherwise they would never be any progress from generation to generation.
- pjerem 3y agoThis doesn’t work when most people are self teaching. It’s the job (and value) of a teacher to help you understand not only how but why we do like this. Since we are more or less thrown is this beautiful "life-long learning" career without professional teachers, it’s way harder to understand the why without exceptionally great mentors. And that’s my pet theory that this is at the roots of cargo cults.
- atoav 3y agoSo what you are saying is that the solution is to make software engineering a profession that requires an actual education and certification? Before civil engineering became a profession all kinds of people would build bridges and all kind of bridges would collapse. The solution wasn't to accept that bridges collapse, the solution was to not allow just anybody to build a bridge and to create standards that bridges had to adhere to. Also, as a self thought programmer that is regularily shocked of what he finds in the field, done by supposed professionals: Being self thought has nothing to do with it. Because I can also read on someone's experiences and mind set. Every self thought programmer will read books on programming made by people who program. Even self thought programmers will avoid goto atatements like the pest even if they don't know the original reason for that rule. The problem in software engineering is one of culture. We program shit and move on. If it breaks it is not our fault. Very few people feel ownership and/or responsibility for the code. Granted: Very few companies are willing to pay the money needed to allow for such a process, except if they are in a field where it is required by law (automotive, aviation, ...) What we need is a clearer liability structure for software errors. If a companies software is investigated after privacy leaks and they are on the hook for each individuals data that they mistreated if the software is not up to standard companies will think twice to cheap out on software engineering. If software engineers are on the hook if a company gave them everything needed to make a safe product and they didn't, they are on the hook. I don't say everything needs to follow that level/standard, but as of now a software error is treated like a unavoidable act of gods will that nobody could have foreseen or prevented.
- FreshStart 3y agoHow do you know people walked the walk and not only talked the talk? It's a ass in seat times years world. And honest reflection on failure is punished in hierarchies.
- ForgotIdAgain 3y agoThat's the issue with a lot of educational ressource, they don't tell about the problems that are to be solved. For OOP for example, I would an iteratively built ressource that present a problem then a first solution, and the new problems that it introduces, and so on.
- pjerem 3y agoYes and no. I do agree with you that the profession doesn’t lack its fair share of big egos and self taught arrogant geniuses. But there is a difficult equilibrium to find between this and the other side of the coin which is the cargo cult of inherited best practices and over engineering. Most programmers (including sometimes myself) have a hard time choosing the right tool for the right job. But learning to pick the right tool is hard. Even learning this from others is hard : I’ve happily learned from a lot of specialists how to use a specific tool in depth, but I can count on one hand the number of people who suggested me a better tool for the task.
- rob74 3y agoYeah, that was my reaction to the article too: of course learning from your own mistakes leaves the most lasting impression, but you don't necessarily have to make all the mistakes yourself (e.g. you don't have to get in a car crash first to learn to drive safely).
- ixsploit 3y agoBecause you probably can extrapolate your experience from learning how to ride a bike, or to walk, so you don‘t need to crash a car. Probably everyone here has the experience, that the faster things collide with you, the more it hurts.
- atoav 3y agoI studied Film. Film similar to programming is a field where there is so much to learn and every project might be completely new and follow it's own rules and circumstances. I had many collegues in unversity that had to shoot themselves into the foot. A normal part of learning. But as we were always working together everybody had the chance to see the others doing so. Now there were some people who saw others shoot themselves in the foot in a particular way, only to go and do the same thing on their own project. Don't be that type of person. Be the person who observes others shoot themselves into their foot and wonder how you could prevent yourself from doing that in the future (and accept that for some things you can't). Software engineering is very similar. Sure maybe you are the type of person who can't grok a footgun unless they got shot by it. But you can try not to be that type of person. Making mistakes is important. But make them at home or in toy projects, don't make them in a decade long effort by a ten people team with the data of million people. And if you are in such a project it is part of your job to learn from other similar projects and the ways they shot themselves into the foot.
- scyzoryk_xyz 3y agoFilm (production) grad here as well. A good film school program is a space where teams of people get to make all their mistakes and figure out what they're about while making horrendously flawed pieces. Everyone exits with a slightly different baggage of experience. I would add one thought here - it's not just about seeing others make mistakes, or about making the mistakes yourself. It's also about seeing how mistakes can be made across bigger teams or time-frames. Well-intended innocent creative choices at one point in the process can cause serious trouble later. Or two independent choices can create unforeseen problems. That's the sort of experience that's least visible, and that's what experienced mentors can provide. So, I would argue that it's best to have a healthy mix - you want to see others fail, you want to fail yourself, but then you also want to have mentorship by others who have made these failures themselves. Seeing someone else make a mistake and then making that same mistake yourself can be a very valuable and humbling experience.
- otikik 3y agoI think that is the most obvious optimization of your time. However I also think that most people need to experience the pain and frustration of hitting themselves with their own decisions a number of times, until they develop enough humbleness to see the benefits of using other's experience instead.
- kQq9oHeAz6wLLS 3y ago“What’s the secret of success? Right decisions. How do you make right decisions? Experience. How do you get experience? Wrong decisions.” – John Wayne
- otikik 3y agoThat sounds smart, but in reality it is quite possible to become very good at identifying wrong decisions without developing the capacity to identify good ones. This happens to ... a friend of mine.
- maayank 3y agoSounds like story time :)
- fer 3y agoAs a parent, I like put it in a different way: "The good thing about making mistakes, is that you get to know which mistakes are worth making."
- thesnide 3y agoParenting is all about letting your children experience enough mistakes while avoiding all the fatal ones.
- tialaramex 3y agoIt turns out you can learn from other people's experiences. This is a valuable shortcut, because it turns out some of those wrong decisions are fatal which makes obtaining experience in those decisions the hard way a bad idea. Now, granted, too many people / organisations / whole fucking countries aren't even learning from their own experiences, but you should really strive to learn from others too.
- jstimpfle 3y agoJust came here to have you check out this -- https://news.ycombinator.com/item?id=36706893 https://news.ycombinator.com/item?id=36706893
- sshine 3y agoAnother example is taking the Advanced Programming course and being exposed to monads without having done a ton of FP without monads. The “You could have invented monads, and maybe you already did” approach: monads do solve a problem, but if you’re presented with the solution before being exposed to the problem, you’d be like “This is magical, complicated, unnecessary. Why would I ever want the problem that this solves?”
- cyrillite 3y ago“Why would I ever want the problem that this solves?” is the best way I’ve seen that mood captured. Brilliantly put and vital context for teaching.
- sshine 3y agoKubernetes is another good example. If you don't already have all the problems that Kubernetes solves and the complexity that goes with those problems, adding Kubernetes prematurely gives you problems you didn't have by introducing complexity you weren't (yet) subscribed to. A: "What the hell is a PersistentVolumeClaim? Why can't I just write to disk?" B: "But what if you don't have a disk at the edge? How does this scale?" A: "What edge?! What scale?! I have a disk!"
- spoiler 3y agoMost developers I've worked with who were complaining again containerisation and kubernetes never had to deploy code or only had to deploy code to one or two manually set up VPSs. They'd usually always be the most vocal about how its too complex. Or how "we aren't Google"; yes precisely because we're not Google who can afford multiple DevOps departments is why this makes shit easier, since the loudmouths also never want to pick up the slack to get infra shit done. /rant The ones that have experience with devops tend to appreciate Kubernetes
- sshine 3y agoI have about two years of experience with DevOps and Kubernetes. I manage my personal infrastructure with Terraform. I still prefer to keep services running with docker-compose when I can.
- deleted 3y ago[deleted]
- TheRoque 3y agoI think it highly depends on the thing you are using. Some tools like Rust have a design highly and obviously centered about the things it's trying to solve. As the author points out, a lot of things "don't make sense" in Rust unless you understand the underlying problem. But the other examples he gives, like "You should write a game from scratch before using Unity" have a different design, that mostly don't force you to hard-to-understand things all the time like Rust does. You would have to dig deeper in your project in order to hit a wall of confusing concepts that required the underlying knowledge. Of course, it's always good to know the underlying stuff, but, meh, time is limited, sometimes you have to do tradeoffs.
- aslihana 3y agoI liked this article so much. But i want to attach something on your "some opinion" title's > You should learn Zig (or C) before you learn Rust part. I had learned C before Rust but, vectors are not used in C. It belongs to C++. And although I know C, Rust is still very confusing to me. In my opinion, it would be better learn C++ before Rust.
- hardware2win 3y agoWhat do you mean that there are no vectora in C? You mean by default?
- antoineMoPa 3y agostd::vector is a C++ thing right? There is no vector standard in C as far as I know.
- tialaramex 3y agoA more general name for this kind of thing is a growable array. The choice to name this "vector" is regrettable given the other things that word means, and the Rust name Vec is at least an improvement on that. std::vector is famously the only C++ standard library container which isn't crap, but, the fun thing is that it's still a bit crap anyway. Like a lot of C++ standard library features it could be better, but that'd be an ABI break, so too bad either use somebody's custom replacement which is better or put up with the good-but-not-great std::vector
- moffkalast 3y agoWell any newer language just seamlessly rolls that functionality into regular arrays and calls them lists, Java and C# call it an ArrayList. I'm not sure if there's a standard naming convention for it. What really disqualifies C for anything practical these days is the strings. In that it has zero native support for them, they're not a first-class citizen as they damn well should be, they're a complete illegal alien. String.h is such a trainwreck from a UX perspective that I despise every minute I ever had to work with it. C++ at least has some out of the box support for them, even if it's very barebones and clunky af. Like aside from getting an educational perspective of how incredibly limited and poorly designed languages used to be, there's no reason we should still be building our cars out of wood with stone wheels which is what using C (and C++ to some degree for that matter) feels like. For learning how processors and computers work at the lowest level, going with something like assembly on a microcontroller makes more sense anyway.
- chayesfss 3y ago[dead]
- lysecret 3y agoShow closed doors first.
- qrian 3y agoI vaguely remember this as a key concept in game design, however I cannot refer to it as it does not have a canonical name as far as I know. Does it have a canonical name?
- hoseja 3y agoPedagogy needs major overhaul.
- redbell 3y agoDefinitely, a great read, addressing the mammoth in the room > When teaching programming, we should let people make these mistakes, and then show them the tools to correct them. This was one of my pain points when I was in college studying CS. It was killing me to have the teacher just dictate that programming lecture without showing what problems it solves and/or how difficult our lives would be if we don’t get it right. I still recall that interfaces lecture where the teacher keep telling us to declare some sort of class with some methods but without implementation!! Any class could then benefit from this! How/Why?! I wasn’t able to get this interface thing until I graduated and worked on a personal C# project with WPF where I designed it with a basic architecture of plugins/addons that got loaded at runtime, those plugins should all have some common functions that can be called by the host app, only and only then, I fully understood interfaces and how/why/when to use them. At that point, I wished I can go back to college, explain this concept to students and get back! I believe the reason why college teachers struggle to explain such concepts in a better way is their lack of experience in the field.
- calini 3y agoI've been doing only imperative programming in middle school (Turbo Pascal, yay), and when I started to get more curious about programming and started looking into Java, classes vs objects vs interfaces gave me headaches for weeks. It was only when I picked up a couple of online courses like CS50 from Harvard and CS106 from Stanford (quite outtdated now) that things started to make more sense. Sometimes those things take time and looking at them from different perspectives, and even different programming languages/paradigms. E.g. I started to appreciate the use of interfaces more when I started using Go, going from Java, where they're implemented implicitly, that I realised they're actually really useful and not just a nuisance.
- bgribble 3y agoPlug for one of the best algorithm textbooks, Skiena's "The Algorithm Design Manual". It clearly motivates algorithms with specific problems that needed them and how a good algorithm improves over a naive approach in real-worldish situations. Highly recommended.
- jeromenerf 3y ago> Without shooting yourself in the foot, learning lacks motivation. Complexity without reason is really confusing. Interestingly not my experience. I usually start something uselessly complex, with more passion than reason, to learn or brag, then halfway I indeed shoot shoot myself in the foot trying to be clever or lazy. I would not recommend to look for footguns, they are already looking at you :)
- q87b 3y ago> You should use javac from the command line before using an IDE That is how my university professor made whole semesters hate programming. An IDE makes the entry into programming much easier and fun.
- userforcomment 3y agoOh, wait. That's why I hate Java? We used Netbeans in university...
- chii 3y ago> An IDE makes the entry into programming much easier and fun. then they shouldn't have picked java as an intro language.
- moffkalast 3y ago"University and high school don't pick Java as the intro language challenge (impossible)"
- xen0 3y agoI think that should be caveated with 'you should try it _once_'. It is more than possible, but for anything non-trivial, it just sucks.
- DontchaKnowit 3y agoUsing IDEs for java or for python invariably sucks, in my experience. Id pick command line over and IDE for anything but debugging any day. Because on the command line it is very clear what you are actually doing- in an IDE everything is filtered through the invented language of the IDE.
- deleted 3y ago[deleted]
- Mizoguchi 3y agoYou can also shoot yourself in the foot a lot less by having a solid understanding of fundamentals before jumping into coding right away. Unfortunately learning the fundamentals requires a lot of reading and practicing and most literature and content out there isn't great. The OP would have known why holding a reference to an item in a list sometimes is not a good idea by knowing the fundamentals of memory allocation, which can be found on many books and articles totally unrelated to Rust. One of my favorite books for learning fundamentals is Effective Java, even when I wrote very little code in Java during my career I found some of the concepts and ideas in that book to be language agnostic.
- nottorp 3y ago> sometimes is not a good idea by knowing the fundamentals of memory allocation ... which can be learned by shooting yourself in the foot with C. My opinion is, it's best to have done a little low level programming because it will nag you subsconsciously when you go accidentally quadratic or worse in a high level language.
- Ensorceled 3y ago"To damage or impede one's own plans, progress, or actions through foolish actions or words." Learning C before Rust so you better understand Rust isn't "foolish action" nor does it "impede one's own plans". I grow tired of authors twisting and abusing the meaning of common English idioms so the author can say "well actually some times you want to shoot yourself in the foot"
- g-w1 3y agoThe shooting yourself in the foot part is doing memory unsafe things in C where you get a segmentation fault that Rust would have stopped you from doing.
- thatjoeoverthr 3y agoI think what he means isn't the act of learning C first, but rather having the segfault.
- Ensorceled 3y agoSo, the foolish action was intentionally creating the segfault?
- thatjoeoverthr 3y agoI side with this and like to remind people of Joel Spolsky's words, "all abstractions leak". It's very gratifying when you're a Unity dev in a room of Unity devs and you're the only person who can diagnose and fix a build problem involving raw OpenGL ES and Objective-C++. From another angle, these baser systems like C and vanilla JS are _simpler_ and you just have a lot less to learn at once. It's a good waypoint.
- AnimalMuppet 3y agoI have a bit of a different take on this. "Men say that a stitch in time saves nine, and so they take a thousand stitches today to save nine tomorrow." - Henry David Thoreau, Walden. It's good to not shoot yourself in the foot. Really. But, depending on what you're working on, it may not always be worth the effort to prevent. For some things, of course it is. If you're working on something either safety-critical or enterprise-critical, you almost certainly want to use whatever tools you can to prevent shooting yourself in the foot. But sometimes the price of the safety costs more than it's worth. At the extreme other end, if I'm writing an experimental one-off for my own curiosity, I'm not going to worry about satisfying the borrow checker (unless the point of the one-off is to learn Rust). If I'm writing an experimental one-off for work, that's likely to be still true - I'll write it in whatever gets me there fastest, because the point is learning what the results are, not producing production-level code. Use the level of protection that's appropriate for what you're working on - no less, but also no more. Note that all this is somewhat orthogonal to the question of whether one needs to shoot oneself in the foot before learning how not to. This is more like, once you've shot yourself in the foot, learn when to leave yourself exposed yourself to the possibility of shooting yourself in the foot again.
- cranium 3y agoOther shots in the foot you'd want: - Trying to refactor a big chunk of your app and have a way to rollback if needed: use Git to do version control - Revert part of a commit containing bad code: make smaller and cleaner commits - Merge huge branches to submit your project due in two hours: create smaller and independent feature branches - Swap an implementation for an improved version without introducing bugs: create regression tests against the interface - Collaborate with people: pick one tool and stick with it - Setup a development environment on different machines: use Docker or other declarative setup - Have projects die because of decision paralysis: start working on it as soon as possible when the general direction is clear - Lose important data because of a dead drive: implement a backup strategy - Have a drive die because of a power interruption: get an UPS
- tobyjsullivan 3y agoThe expert is the person who has failed in more ways than everybody else.
- Georgelemental 3y agoAdding to the list: you should learn a dynamically typed language before a statically typed one
- gosenx 3y agoGreat point. I remember years back when I tried to learn Webpack and I found it to be unnecessarily complex for me at the time and I did not get which problem it was trying to solve. It was only when I decided to do things on my own way that I hit limits that I had my Eureka moment. It is sad that newcomers are told to learn this tool and that tool while they never get to know the problem those tools are solving. Another experience that triggered an A-ha moment for me, was reading the OAuth2 RFC (6749). I had previously read multiple docs of libraries implementing the protocol and had integrated with such libraries in the past, but it was only when I read RFC and the problems the different flows try solve that it finally clicked.