DEV Community

Phil Nash
Phil Nash

Posted on

Those silly mistakes we all make

I've been developing for years. Years! Yet every now and then something that turns out to be simple floors me for just a little bit longer than is comfortable.

Working with code really can keep you humble. What always catches you out or got you stuck recently that really shouldn't have?

Share your silly mistakes and maybe we'll all feel a bit better about it.

Latest comments (117)

Collapse
 
ali profile image
Haider Ali • Edited

One of those silly mistakes that a friend of mine always does in laravel is when he is editing a "blade" file and expect the result in another file .. so we often spend 15 min until we figure out that we are working on the wrong route or blade

Collapse
 
philnash profile image
Phil Nash

I had to check, blades are view templates in Laravel, right? It's a badass thing to say you're working on regardless! So many templates look the same though, it's easy to mix up.

Collapse
 
totally_waqas profile image
Waqas • Edited

I made a new react component but kept getting type errors (was using typescript) in VS Code. I removed everything one by one until I was left with just a ‘< div />’ and still there were squiggly lines all over. I looked everywhere but couldn’t figure out why (even copied the entirety of a component that was working). Ultimately, I realised my file was a ‘.ts’ instead of ‘.tsx’.

Collapse
 
philnash profile image
Phil Nash

One "x" out of place and not even in the contents of the file. Ouch!

Collapse
 
ferdelvalle profile image
Fernando Del Valle

Why isn't my function working?!

*forgot to call it

 
yechielk profile image
Yechiel Kalmenson

Lol, yes, we're sure 😂

Collapse
 
metalmikester profile image
Michel Renaud

I spent all day yesterday on a problem only to realize that it was an array index off by one (some code was in JavaScript, some in C#/Razor, and I didn't notice the C# part was generating the wrong numbers in the HTML). Of course, the code was trying to resolve something in the wrong set of data, leading to very weird results.

Expletives were used.

Collapse
 
marcellothearcane profile image
marcellothearcane • Edited

User: I can't save anything!
Me: What? Of course you can.
User: It won't save, it just says 'field not found' - what does that mean?
Me: Ohh...

I haven't unlocked permissions for the user role. It works for my admin role!

Collapse
 
deathshadow60 profile image
deathshadow60 • Edited

I forgot to include a viewport META in the example code for an article about using CSS instead of JavaScript to make a mobile "hamburger" menu, then for a week couldn't figure out why people were reporting that the font size was uselessly tiny on their devices... wasted time throwing all sorts of style at the problem and staring at the CSS, when the problem was in the markup.

Collapse
 
sturdy_dev profile image
Carson Sturtevant

I can't tell you how many times I've done something like:

if(a = b) {
// do something
}

After some time I finally realize that i didn't put a second =.

Collapse
 
philnash profile image
Phil Nash

Oh, I've done this before. It's such a pain to spot a missing =!

Collapse
 
metalmikester profile image
Michel Renaud

Nearly 25 years ago. Programming in SAS on the mainframe for the first time. I had to process some data and output some summary reports. Of course, there was a need for some blank lines.

Now, printing on the mainframe: The printer was in another building. A few times a day, someone would bring the printouts over to a specific floor in the other two buildings. So, you had to wait until the time the printouts are dropped off and then go to the floor in the building where they are left and hope it had printed in time for this run.

Obviously, since I was new at this, I figured I'd develop the reports on screen until they looked good enough to see how they looked on paper. Makes sense, right?

The blank lines would never show. Everything was stuck together with no spacing. I tried dozens of things, to no avail. I mentioned it in passing to a couple of more experienced people but they just assumed I needed to work more at it, I guess.

I worked at this all week, no success. Come Friday, we have a section meeting and I mention the issue. Right away some guy with lots of mainframe experience says, "Oh, that's normal. The blank lines won't show on the screen. You have to print if you have to see them."

That look of annoyance on my face coupled with me laughing out loud must have been something.

Collapse
 
dansilcox profile image
Dan Silcox

Could not get a Lambda .NET core project to run locally with AWS toolkit earlier, spent about 1/2 hour digging around and searching for some missing dependency - ended up asking another dev - turned out I just set the wrong start up project in VS 🤦‍♂️🤦‍♂️🤦‍♂️