Well, no matter how much we grow as developers, designers or ourself even, we always do noobs things, It happens even the best. So, I wanna know what Junior mistakes sometimes you do while coding or designing, and please no the typical "lost semicolon" stuff. Mine, was debugging a CSS (A last minute change) for a client which site wasn't responsive; after working hours the viewport meta tag was missing.
Now you, what mistakes have you done and then realized it was something from elementary Programming/Designing school?
PD: I'm still learning English
I frequently over-engineer my Rust code, doing fancy stuff in methods and requiring mutable references as parameters. The pitfall: the borrow-checker. It often does not let me do fancy stuff when the API is actually called (even if the lib compiles), because of the mutable references :( After getting a coffee, I usually sit down and rewrite stuff in a sane manner, ending up with immutable references and the same behavior as before (from the API perspective).
There is so much leeway in the way we program certain things - these rewrites sound like magic :D However, it takes a lot to re-think my way of writing code. I am so happy that I can use Rust to improve my overall code quality and stability!
When i got the error, i will open the file and resolve the error and check the browser again. Still the error comes. After the 15 mins i will find that, i have changed it on the wrong file. Happens always
The most common pitfall I face is callback naming.
Imagine a function, that has many functions. Here's a crude example of what I mean.
function 1(inputParams, cb) {
function 2(params, callback){
return cb();
}
}
Instead of return callback(), I typed return cb() here. I often end up calling the wrong callback function. These days I name my callbacks properly to avoid this.
When switching from js to php multiple time.... Writing var in php. And asking me... "what wrong.??? &#@"
I use tabs it is neat and clean but some dev use spaces, spaces shows ugly comparison in the git.
while refactoring my code i changed some class names without thinking because they don't have any meaning at all , but previously i wrote some functionality tasks and design tasks for those removed class names , it almost nuke the imp parts of my project. it makes two days delay of my project
I think I trick myself with object references more than anything else in JS. It's elementary and yet every now and then I get some bug related to it and it takes me longer than it should to find the mistake.
Not changing the images to RGB (from CMYK), doing fast stuff at javascript with horrible optimisation and good practices just because it had to be done really fast and say to myself later or tomorrow I'll fix it, but then later or tomorrow you can't 'cause you have to do other stuff and days later regret it.
In a previous job me and my coworker write all the classes and objects of our application with douplicate code, after maybe more than year and half with the boss see there is a inheritance than make it all more easy
Writing colon instead of semicolon or comma instead of dot, and they are f### hard to see sometimes and the buttons are so close to each other. And a lot of other things, but luckily you learn to read errors and identify these very fast so it's not a big problem.
This was at a previous job, more related to systems administration then programming, and not my mistake but I figured out how to fix it (ok, maybe not on topic, but close enough haha)
We were opening a new office in a different state and the PBX was to connect back to the home office over an MPLS.
I and the phone techs flew down there, got the network up and running, all the equipment installed, everything else. I got back to the home office to be there for the final install and nothing. We could not call from the home office to the remote office; but we could call from the remote office to home.
2 days and nights, 8 of us in the server room at home, a few more in the remote office - checking cables, checking router configs, trying different hardware thinking it was hardware failure, on the phone with the ISP / PBX provider.
Finally, exhausted - it hit me "Wait wait wait. What did we learn going through PCI compliance? Never leave un-needed ports open. Has anyone actually checked if port xxxx is open on the PBX to communicate with the remote office?"
5 minutes later, calls were going through just fine.
It happened just some days ago.
To hide some potentially dangerous properties and restrict access in the browser I used a closure function. Pretty boring stuff. I committed everything, created a PR, and on getting my stuff merged into master and automatically deployed my phone rings. Someone of the Sales department called me and argued about some weird stuff happened, and he lost some data.
It sounded impossible to be true. All test cases passed successfully. The guy who did the code review accepted my changes. How on earth is it possible that my last code changes cause data lose?
I debugged, I struggled, I called for an additional pair of eyes. We found nothing.
I called our database teams to restore some data sets, and they told me nothing to restore, it's all still there. I was surprised. I called the Sales guy and convinced him that everything is okay. We try to fix the 'view' problem early tomorrow morning.
I went home and when I parked my car I had a thought:
What if, I just enclosed the data?
I called to a colleague in Mexico (glad we have 9 hours difference between Germany and Mexico), maybe he can fix my stuff. Some minutes later he called me back by phone and laughed at me because I forgot to return the correct value. Instead, I returned false because that was the initial return value to fulfill the interface rules defined by the test cases. To my surprise, the tests didn't detect the issue due some typo in the test suite. The guy before me wrote all the tests my code had to pass. But two of the tests never run in the test suite. I executed them manually not by running the entire test suite.
Shit happens. I sweated blood and water because losing financial data is a problem for the J-SOX and SOX auditors. Lucky me, fixing the issue was just as easy as count from one to three.
Bill O'Neil
I'll throw this out there as something I see a lot of companies doing. Design by blog posts. Twitter / Netflix does this awesome thing we should too! A small 5 man team ends up with a system of 10+ micro services, service discovery, async message queues, SQL and NoSQL, Easticsearch, Redis... End up with a pretty expensive bill from AWS and a system that is very complicated to maintain / debug. Seriously most companies are fine with a monolith, or a monolith with a few micro services. Stop over engineering.