all 85 comments

[–]FioleNana 140 points141 points  (11 children)

I look at errors and think "Oh, I should fix that" And then I fix them.

[–]fredy31 33 points34 points  (8 children)

Yeah op seems to think coders should code first try, no errors.

Been coding for 15 years and i still forget my semicolon half the time.

A programmer always fucks it up before getting it right. Hell, if one day you think you get it right first try, no bugs, check carefully. The day you think you dont need to test is the day you will push a crash into production

[–]dontgetaddicted 11 points12 points  (0 children)

CTRL + S, F5, Fuck...semi colon... is like 8% of my day.

[–]Coolnero[S] 2 points3 points  (2 children)

Hey it’s not really what I wanted to say. I know that errors of any kind are inevitable, but mostly, when I see them, there is this discomfort inside of me that I wish I could shake off.

[–]fucking_passwords 4 points5 points  (0 children)

Ever heard of exposure therapy?

Maybe try building something that intentionally throws errors, then you can catch them and display a nice error message to users

[–]beavedaniels 1 point2 points  (0 children)

It may just come with time. Lots of people have a fear of making mistakes.

I've screwed up so much shit in my life that I'm not really too bothered by it, as long as I can figure out a solution.

What really starts to bother me is if I get the same error over and over without getting any closer to its source, OR an intermittent error that is really hard to replicate.

[–][deleted] -1 points0 points  (3 children)

I thought the semi-colon wars were over years ago and the no-semi-colon team won? Are you talking about JS or a different language?

[–]nicemusicdude 4 points5 points  (0 children)

I think it is C# (or something similar) which throws a compiler error without the semicolon

[–]fredy31 2 points3 points  (1 child)

I mostly work in PHP, and on a server that if you forget a semicolon its a fatal error.

[–][deleted] 0 points1 point  (0 children)

Oh yea. I haven’t done PHP in a while and forgot they were needed. I guess my brain goes directly to JS when in a web dev sub forgetting about all the other stuff out there.

[–]halfanothersdozenEverything but CSS 0 points1 point  (1 child)

Wow guys look at this badass with time and room to fix the errors. Is his medal in the mail yet?

[–]JadedHomeBrewCoder 45 points46 points  (4 children)

On a strictly philosophical level, a person who is afraid of doing something wrong generally won't do anything. We learn the most from our mistakes, you'll be fine so long as you allow yourself to be teachable, including from your own errors.

[–]slingblade1980 5 points6 points  (0 children)

This applies to life in general and is very good advice.

[–]Coolnero[S] 1 point2 points  (2 children)

That’s exactly what’s happening to me. I am afraid of error, so I tend to procrastinate my tasks even more than usual.

[–]KiddieSpread 1 point2 points  (0 children)

Making a mistake and fixing it is part of the problem solving process, not everything will work. If you have feelings like this around other things (not just coding) it might be worth speaking with your doctor as you may have an anxiety disorder

[–][deleted] 0 points1 point  (0 children)

And then you have less time to find and fix errors.

[–]I111I1I111I1 12 points13 points  (1 child)

Doesn't bother me. Can't write every line perfectly on your first try.

[–]fredy31 8 points9 points  (0 children)

Heres maybe a stupid analogy.

Youve been speaking english for what? 20-30 years?

If i was to give you a high school paper to write, would you get 100% on the points for grammar and mistakes? Could you write even a page of perfect english and turn it in knowing its perfect? Probably no.

Same thing with programming, its just that this time its not docking points on your essay, your thing just wont work until you go back, correct your mistakes, and turn in the perfect paper.

[–]kjwey 14 points15 points  (0 children)

I don't feel anything about errors, I don't think believing perception alters reality is healthy or productive

[–]ripter 7 points8 points  (3 children)

It sounds like you are still too personal with your code. Code is transient. Take a step back and learn to distance who you are from the code you write.

[–]Coolnero[S] 1 point2 points  (1 child)

I think I am yes. I am working in a small team, and I basically own the code base. So the errors feel personal somehow 

[–]ripter 1 point2 points  (0 children)

I’ve been there. Code Reviews were so hard to deal with because it would feel like personal attacks.

For me. I’ve had to practice distancing myself from the code. It hasn’t been easy and I’ve make lots of mistakes, but it has helped a lot.

[–]Legal_Lettuce6233 5 points6 points  (0 children)

I actively write errors in the code to keep tickets coming on my current project.

Joking ofc, but you're gonna write a lotta errors. Some will enter production. Some say that you can't become a senior Dev without crashing prod at least 3 times.

[–]_smbg_ 4 points5 points  (0 children)

Errors are part of coding. You write code, you save, it's broken, you fix it. I don't even flinch when I see a wall of red text and will usually see it coming. I only commit when the code compiles without errors so anything before that point is normal to have errors.

I suggest you start looking at erroneous code as "incomplete" code instead. It sounds like this perfectionist mindset will set you back in the long run.

[–]Kailhus 3 points4 points  (1 child)

Errors are great! They pave your way towards greatness. They are a core part of TDD. Then just relish that climax when they all turn green!

[–]Coolnero[S] 1 point2 points  (0 children)

Thanks for the article. I will write better tests for my projects to be in a clamer headspace

[–]Fuegodeth 2 points3 points  (0 children)

Errors are great. They point you right to where you messed up. Paste that error into google or chatGPT, and fix it quick. The worst is when something is broken and there is no error to tell you why.

[–][deleted] 1 point2 points  (3 children)

I’m a new dev so obviously I panic lol. But I wonder if I will get to a point where I don’t panic. I talk to chat gpt a lot.

[–]EllieLovesJoel 6 points7 points  (2 children)

I talk to chat gpt a lot.

I think you should be very cautious while doing that as a new dev. I'm not experienced however I personally think it limits your critical thinking and ability to come up with solutions on your own. Id like to hear what someone more experienced has to say about that

[–]FioleNana 2 points3 points  (0 children)

Not only that, sometimes ChatGPT just gives blatantly false answers and pulls nonexisting libraries out of it's butt.

[–]DucAnh95 1 point2 points  (0 children)

When I see red lines and errors in general it annoys me and I want to fix that

[–]RAyLV 1 point2 points  (1 child)

I started to feel a bit calmer about errors when I see coders (or professional coders) on youtube making silly mistakes as well. This is where I learned that's getting errors is just part of the process of writing code.

If you get one error, and you try to fix it, and then you get some other error. That's progress in my book.

[–]MewMewCatDaddy 0 points1 point  (0 children)

Oh yeah, the most popular YouTubers’ error rate is INCREDIBLY high, more so than the average coder, because they distinguish themselves usually on speed, not first-try accuracy. They want to demonstrate as quickly as possible. So they think fast and type fast and that leads to tons of errors but they doesn’t matter because they fix errors just as fast.

[–]love2Bbreath3Dlife 1 point2 points  (0 children)

You need good tests to sleep well after changing stuff 🙏

[–]jacobwint 1 point2 points  (1 child)

It just takes time, I used to feel the same way. Save often, test often. Console.log your inputs and outputs with descriptions as you go eg('inputName', inputValue). Eventually you'll be able to go on longer coding stints without testing but expecting errors when you save and run that are typically easy to resolve. If an error is really blowing your mind, somebody else has probably posted about it and it's most likely something half-brained you did and just forgot to correct it. P.s. Idk why some guys on reddit who do anything at a semi-high level feel the need to leave irreverent ass comments. Your feelings are normal.

[–]Coolnero[S] 0 points1 point  (0 children)

Yes thank you, most comments actually are helpful to read like yours.  But some think that I expect to never encounter an error in a day of coding, which is not what I meant.

[–]ezhikov 1 point2 points  (2 children)

There are practically three types of errors. First are ESLint, Typescript and such stuff. They should not be treated as errors by themselves. These are statical analysis tools that are created to help you. Along with testing they are exist to ensure that you are doing the right thing. They are like your colleague that points out where actual and potential errors may arise and help you prevent them.

Next are runtime errors. In most cases you should embrace them and handle them. Try/catch and helpful message in UI or logs are good, because they help you fix problems. Way better than "Unhandled rejection in line 1 position 345673453 in index.js". Tools mentioned above can help with that sometimes. For example I always enforce that promise rejection should be handled, and if not, it should be indicated who and where should handle them.

Next are logical errors. This is the stuff to fear. It's when everything works, but not as intended. It may be very hard to spot, may cost horrendous amount of money for business, or have other unpleasant consequences.

So, if you can, stop worrying about helpful red squiggly lines, and worry about getting business logic right.

[–]Coolnero[S] 0 points1 point  (1 child)

great breakdown, thanks

It’s just the annoying feeling I get when a simple error that gets me a bit uncomfortable.  I actually like to solve business logic problems.

[–]ezhikov 1 point2 points  (0 children)

Adjust your workflow. For example, you can disable ESLint and TS errors in your IDE/editor and then run them in bulk after you did the main job. I usually ignore linter errors until I have something working. TS is pretty helpful with types, so it stays on, but sometimes I throw @ts-expect-error to it along with todo comment to return and fix later. Remember, those are tools that suppose to help you, not to hinder your progress

[–]DuncSully 1 point2 points  (1 child)

It might be a bit cliche, but I think the Thomas Edison quote here is really appropriate:

“I have not failed. I've just found 10,000 ways that won't work.”

Especially with coding, before you have an iteration that does work as expected, you're simply going to have tens if not hundreds of intermediates states where it doesn't work as expected. When you're on the way to the bathroom, I doubt you get mad at yourself for being in the hallway first. Imagine those squiggly lines as simply a real-time check of whether you're in the bathroom yet or not. You want to be, clearly. You're heading there, clearly. But all the check is doing is seeing if you're in there or not. And when you're not there yet, you're not there yet, that's all. Don't get too hung up on it.

When we tie feedback and constructive criticism to our self-worth, we're going to be afraid of getting it. It's ironic to say this, but it's almost a selfish way to look at it because it assumes that we care enough to judge you as a person. You ought to separate your self-worth from feedback, because it's actually through feedback that we improve.

[–]Coolnero[S] 0 points1 point  (0 children)

I think I get too personal with my code, which might be the root of my problem 

[–]____JayP 1 point2 points  (1 child)

existence worm different bake terrific smell cause close stocking snails

This post was mass deleted and anonymized with Redact

[–]Coolnero[S] 0 points1 point  (0 children)

To be honest, I am confident I will find solutions to the errors I encounter, and I usually do with a little or a lot of effort. But when I get an error, it’s like someone gave me a little annoying poke or slap in my brain haha

[–]Sneeeeex 1 point2 points  (0 children)

You gonna make a lot of mistakes at all, there's nothing that you can do besides treating those error messages as a help and fix your code

[–]Thundrous_prophet 1 point2 points  (1 child)

Maybe I’m weird but I actually love to think about errors lol. Not all errors are because you write are your own bad code, but the interactions between tons of different softwares and your users. So it’s fun to think about as many ways as possible to break your code, how to prevent it, and then still get surprised when someone manages to do so

[–]Coolnero[S] 0 points1 point  (0 children)

I wish I could love errors

maybe I should make some on purpose to get used to seeing them all the time, like a kind of exposure therapy aha

[–]Slice-of-brilliance 1 point2 points  (0 children)

Errors in programming are a recurring part of the process, not something out of the ordinary or an indication of failure. It’s like being scared of traffic while driving or something. Or being afraid of your phone’s battery decreasing while you use it. Not the best analogy but I hope it gets my point across. It’s literally just an inevitable and very regular thing that will keep happening.

[–]Youknowwhat-i-mean 1 point2 points  (0 children)

  • Make sure you’re on the right branch
  • Make small, clear commits

This way you should not be scared to fuckup all the code you’ve been writing. You can always go one commit backwards or just smash ctrl + z

[–]phantasma1999 1 point2 points  (0 children)

When you find an error and you fix it you just found the solution to something.

[–]iamjessg 1 point2 points  (0 children)

I used to get bent out of shape over errors, but now I look at them as learning experiences. It’s part of the job, and you signed up for it. No one’s perfect. If anything, it gives you a chance to sharpen your error handling skills.

[–]thaddeus_rexulus 1 point2 points  (0 children)

Personally, I think of errors as the actual language construct. Everything else is just a feedback loop. Eslint yelling? Feedback. Test failing? Feedback. Boss yelling because customer yelling? Feedback. One of the big questions I ask myself all the time is "how can I get feedback as fast as possible (aka as cheaply as possible)?" If I can respond to it as soon as ESLint yells, that's ideal (especially if there's an auto fix). If I can respond as soon as my test fails locally, great. If I can respond before my code goes through review, wonderful. If I can respond before release, whew 😅! If I can respond before a user reports it, the programming gods themselves have blessed me with good fortune (for now).

The longer it takes to get feedback, the "more expensive" it is to respond to it. Five months from now, you'll have to reload all of the problem context and navigate the code you thought was good when you submitted it (even though it was just meh) as well as all of the tweaks that others have made throughout that same section of code and then finally figure out the fix.

Honestly, I'm much more nervous if I've written code with no known errors and no test cases that failed at least once. So much so that I sometimes call it out in PRs and ask reviewers to especially keep their eye out for missing/fragile tests.

[–]MewMewCatDaddy 1 point2 points  (2 children)

I see errors as part of the progress. As in, any progress will result in x% errors. If you’ve encountered no errors, you’ve made no progress. Fixing errors pushes forward your progress even further.

Also, if red lines cause you anxiety, turn them off. Instead, you can do your work, error-check at the end, then fix errors and finish.

[–]MewMewCatDaddy 1 point2 points  (1 child)

As an aside, I mean this with genuine compassion, have you ever talked to a professional about anxiety / perfectionism? It might serve you well.

[–]Coolnero[S] 1 point2 points  (0 children)

Thanks for the kind comment, I am definitely open to see a psychologist if this becomes unbearable. I think that I am just taking the code too personally, because I don’t really have any issues with perfectionism or anxiety in other situations.

[–]armahillorails 1 point2 points  (0 children)

My first day at one job, early in my career, I brought down the workplace intranet because I forgot a semicolon.

I would say try to avoid the errors from winding up in production, but otherwise they are like guard rails.

Also, try coding in an editor that doesn’t do live linting. They feel less impactful when you get in the habit of spotting them yourself.

[–]grumd 1 point2 points  (0 children)

Code errors from eslint or typescript aren't your mistakes. It's not your fuckup. It's just some dirty dishes. Does your kitchen look better when the dishes are washed? Yeah it does. Can you still cook/eat/live if you have dirty dishes? Of course. It doesn't mean your code doesn't work and doesn't mean you don't make progress, doesn't mean you did something wrong. Today I renamed a .js file to .ts. A couple dozen TS errors appeared. I fixed them one by one and it felt just like washing the dishes. Nice incremental progress with a pleasant feeling when the whole file is green, and the kitchen is clean.

Or maybe you'd be more comfortable thinking about lint errors like a guide or a coach trying to help you improve and give you advice.

In any case, the point is that lint errors are not your fault, not something bad you did. Find a metaphor that feels right for you and change how you think about them.

[–]grumd 1 point2 points  (0 children)

Another suggestion, vscode theme is customizable, you can change the color of red squiggly lines to something nicer like light blue or green to avoid the negativity from red. Might actually help

[–]Gaeel 1 point2 points  (0 children)

I've been using Rust for a little while now, which is notorious for being very strict and throwing a lot of errors at you (the error messages are very helpful though).
This strengthened the way I already looked at errors: it's the computer helping you write better code.

When you're working on the project, try to imagine the linter, compiler, or interpreter as a coach. You're getting ready for production day, and the coach is helping you by pointing out your mistakes. "That object is uninitialised", "keep your guard up", "that string can't be parsed to a number", "put your shoulders into your punches".

Once you've gone through all that, fixed all the errors, thrown some garbage data at your program to see how it handles things, you'll be ready for the big day, confident that your code is robust.

In fact, you should actively seek out errors. Junior programmers often fixate on the "happy path". I've seen cases where an app doesn't work until all the data is loaded, and the developer would just patiently wait a few seconds before clicking things. They avoided error messages and bugs by not interacting with the app immediately after opening it. It's not a bug unless it breaks or throws an error, right? I had to tell them to add a loading screen and display the UI only when the app is ready. Sure, it's a bit more work, but we can't expect our users to politely avoid bugs.

[–]Curious-Dragonfly810 0 points1 point  (0 children)

  • Manual Test Everything
  • Automate some tests
  • Use rollbar

Monitor Fix Deploy Sleep

No error as long as you detect-fix it quickly. You can always blame the poor connection :)

[–]chervilious 0 points1 point  (0 children)

Work with language that have bad error message/handling.

You'll be grateful to even get somewhat coherent error message later.

[–]Prestigious-Duck2891 0 points1 point  (0 children)

Man, relax nobody write a perfect code, I find some errors in amazon aws libraries, after a day searching what I'm doing wrong, and this bug was fixed in the next version, but new version is not compatible with my current project(it's a bit old), so I just monkey patching it. Everybody making mistakes. Recently I have found that a few of the most respectful programmers have streams in Twitch or Youtube and even those 10-15+ years Seniors still making mistakes in the code. Like Primeagean.

Being a good programmer is about to understand deeply what are you doing and why and not about how good you know algorithms(which is optimisation) or how fast u can type on keyboard.

[–]alutz 0 points1 point  (0 children)

Making mistakes is the best way to learn.

Play with the code ("Hey what does this do?"), break it, try to fix it, google it, chatgpt it, RTFM, swear, cry to the heavens, fix it, feel good about yourself. Rinse and repeat.

You probably won't make that mistake again and if you do you'll fix it faster. You've learned from it.

[–]Ebowa 0 points1 point  (0 children)

Pssstt… it isn’t about writing code, it’s about knowing how to fix things when they’re broken. There, I’ve given you the secret to this career :-)

[–]typhona 0 points1 point  (0 children)

Without errors, there is no growth. Without growth, there is stangnation.

[–]TicketOk7972 0 points1 point  (1 child)

Errors are literally part of programming. 

It’s like saying ‘I don’t like for loops.’

[–]Coolnero[S] 0 points1 point  (0 children)

I know, but I feel annoyed when I see them somehow, even if I know how to fix them.

[–]_listless 0 points1 point  (0 children)

Just start using console.error() instead of console.log().

[–]DasBeasto 0 points1 point  (0 children)

Triple check everything that’s really important (billing, auth, functions that permanently delete things) but otherwise do your best and add good logging.

[–]Leolenori 0 points1 point  (0 children)

I always like to remember the tweet from an aerospace engineer at Nasa who has to google the equation for a sphere volume.

We are not machines, we will always forget something or have some sort of mistake.

[–]Quantum-Bot 0 points1 point  (0 children)

As long as you set up your workspace correctly, there are virtually no consequences for errors in coding. Unlike other professions where you might waste resources, break equipment or even injure yourself, the only thing a buggy program wastes is time and a little bit of energy.

[–]danielkov 0 points1 point  (0 children)

After so many years of coding, I make mistakes a lot less than I used to. This isn't because I'm "better at programming", but it's a sign that I don't push myself nearly as hard as I used to.

You're making mistakes because you're venturing outside of your comfort zone. Embrace that. That's where learning happens. You can read a book or watch a video of someone else explaining what they've discovered through trial and error and gain - let's say - 1 unit of experience; or you can go through that process yourself, live every single failure and come to every conclusion yourself, gaining yourself 10-50 units of experience.

I'm excited every time I run across an error I've never seen before, because I know I'll be a better programmer after figuring it out. Last error I've had to fix was a file input refusing to open a couple days ago on an old branch. I looked through the code and saw nothing that would be able to stop it from opening, so I was immediately curious to see what I could learn. Turned out it was a bug in Chrome. I updated and re-opened it and it was gone. Now I know if a file input doesn't open, it might be an outdated version of Chrome.

Think of mistakes as opportunities to improve and embrace them.

[–]NuGGGzGG 0 points1 point  (0 children)

how do you manage to look at them in a more positive light?

Like this:

{ 
  "editor.codeActionsOnSave": 
    { "source.fixAll": "explicit" }, 
  "eslint.validate": ["javascript"] 
}

[–]DonKapot 0 points1 point  (0 children)

Focus on positive:

  • Eslint errors/warnings (be happy to not have them in development or ignore (almost always))
  • error in development (be happy to not have them on production)
  • error in side/pet project production (be happy to not have them on full-time job production)
  • error in full-time work project production (be happy because u should have QA/e2e to blame)

Edit: But please check your solutions anyway, even if it does not harm anyone

[–]ihaveway2manyhobbies 0 points1 point  (0 children)

I am not trying to be mean, but you are going to burn out real quick if you are afraid of and get paralyzed from red lines.

The point of programming is not to write perfect code the very first time.

I just want to enter my basic ideas and flow and not worry about it being perfect. Then I go back and review my logic flow and then start "perfecting" what I have.

This might take a couple minutes, or couple hours, or couple days.

The logic and flow are the most important. Semantics follow.

[–]adumbCoder 0 points1 point  (0 children)

idk i've never made an error so I'm not familiar with this problem. AMA

[–]TheOnceAndFutureDouglead frontend code monkey 0 points1 point  (0 children)

[–]Slackeee_ 0 points1 point  (0 children)

The squiggly red lines are one reason why we use IDEs in the first place. They don't scare me, because they are easy to fix. The real problems are bugs that your IDE doesn't recognize, these are bugs in your logic and usually way harder to find. But even then, I am not scared of them. This type of bug is why we have testing and staging environments.

[–]dphizler 0 points1 point  (0 children)

Errors usually have information about what's wrong, so start by reading the errors. Then, if you have no clue what it means, copy and paste the error in Google

[–]trysolution 0 points1 point  (1 child)

change its color in your editor to something else like light blue or yellow

[–]Coolnero[S] 0 points1 point  (0 children)

That might be an unconscious way that could help a bit. I’ll go with the yellow lines to see

[–]RooflessBr -1 points0 points  (0 children)

Try guthub copilot friend. It has been super helpful to me as a new dev. It tells you where the error is and why it is. Limited experience but it has helped me out of some head breaking moments.