What's new

Stupid coding mistakes

chriswp

Well-Known member
Rating - 100%
17   0   0
Joined
Nov 21, 2011
Messages
327
Points
1,285
Age
25
Location
Stellenbosch
Whats the longest you have been stuck on a bug/error and it turns out that you were just stupid?
Mine is now in Python:

I have spent 3 hours quering a pandas dataframe and getting no results (there should always be results for this query), and it turns out that I had a % instead of a &:
h_records = dfh.loc[(dfh['date']==station[0])%(dfh['lat']==station[1])&(dfh['long']==station[2]), :]

So much time wasted
 

ViVception

Official Carbonite Polizei
Staff member
Administrator
Rating - 100%
47   0   0
Joined
Sep 29, 2014
Messages
3,793
Points
3,105
Age
25
Location
Centurion
:ROFLMAO: I once spend 3 hours trying to figure out why the data does not update on the frontend side, turns out I binded the wrong data property to the frontend. Was a great moment 🤦‍♀️
 

thePridge

Well Known Member
Rating - 100%
14   0   0
Joined
Mar 18, 2014
Messages
490
Points
1,135
Location
Vereeniging
Website
www.organicode.co.za
I've done plenty dumb stuff, but I've blocked it all from my memory... I only remember the following because it was funny because of how the guy reacted.

Once helped a buddy at work who was struggling with an issue for like 4 hours... He asked me to come look and I was like
"click there... hit delete and it will work"
He had copied the control ID including the # from the JS and pasted it into the actual HTML when changing the control ID... resulting in
<div id="#someid"></div> ... so the js going $("#someid") wasn't finding the control to drop the partial view in to.

He was like "F#### you" (which was more to himself lol) when I told him to just remove the # and it worked instantly... because he had been debugging all the backend code for hours, making sure the right variables were going into the method and the right data was coming back and the right partial view was getting populated and sent back. lol
 

PHalanKS

Senior Member
VIP Supporter
Rating - 100%
102   0   0
Joined
Jun 28, 2010
Messages
1,736
Points
2,185
Location
Benoni/JHB
This one time, at band camp, I used JSON Utils: Generate C#, VB.Net, SQL Table, Java and PHP from JSON which is an amazing tool that let's you paste in a block of JSON and it will generate a C# (or a few other langs) model for you.
Unfortunately one of the properties was called "System" which then made a "System" class. I only notice stuff was broken a little bit after adding that stuff so now I was in some other file that refused to compile because it was "using System.<something>". I checked and the DLL was there and everything and wasted a good amount of time wondering WTF on that one...
 

Erohann

Senior Member
Rating - 100%
16   0   0
Joined
Jun 8, 2014
Messages
965
Points
1,745
Location
Randburg
A guy at work was stuck on one issue for half a week. They combed through everything back and forth, analysts, devs, and who knows all. Some dev environment wasn't being populated, but everything checked out. He was missing a "\" at the end of the path.
No idea what the environment/data/language or the sort was though 🤷‍♂️
 

chriswp

Well-Known member
Rating - 100%
17   0   0
Joined
Nov 21, 2011
Messages
327
Points
1,285
Age
25
Location
Stellenbosch
A guy at work was stuck on one issue for half a week. They combed through everything back and forth, analysts, devs, and who knows all. Some dev environment wasn't being populated, but everything checked out. He was missing a "\" at the end of the path.
No idea what the environment/data/language or the sort was though 🤷‍♂️
I have a colleague who uses this 'crude' path joining method. I've had this issue a few times when I use his scripts and change some stuff.
 
Top