DEV Community

Cover image for What's the Most Unusual Thing You've Discovered While Coding?
dev.to staff for The DEV Team

Posted on

What's the Most Unusual Thing You've Discovered While Coding?

Was it an Easter egg that made you chuckle? πŸ₯š A hidden gem buried deep in the code? πŸ’Ž Or some some truly atrocious lines code? :scared: We want to know! Join the discussion and share the most unusual, unexpected, or downright cringe-worthy moments you've come across while coding.

Follow the DEVteam for more discussions and online camaraderie!

Image by pch.vector on Freepik

Top comments (8)

Collapse
 
tandrieu profile image
Thibaut Andrieu

Security of a whole portal was based on β€œRestriction”, not β€œAuthorization”. Meaning your access was β€œrestricted” depending on the profile stored in your cookie.
Remove the cookie, remove the restriction. BAM ! You are admin 😁

Collapse
 
jmfayard profile image
Jean-Michel πŸ•΅πŸ»β€β™‚οΈ Fayard

Collapse
 
webjose profile image
JosΓ© Pablo RamΓ­rez Vargas

While maintaining a BHO (Browser Helper Object) for IE7+ over a decade ago, I found out that:

  1. Invisible windows CAN get the keyboard focus.
  2. Changing focus is a kernel-mode operation, subject to deadlocks.
  3. Microsoft does not consider that invisible windows can have the keyboard focus, a waste, or a bug.
Collapse
 
webjose profile image
JosΓ© Pablo RamΓ­rez Vargas

I also had to correct the same bug in a Silverlight project 96 times because programmers looooove their copy/paste.

Collapse
 
citronbrick profile image
CitronBrick • Edited

Nice to see someone mention Silverlight, when Adobe Flash almost appears to be forgotten.

Collapse
 
ibrahimraimi profile image
Ibrahim Raimi

The Mars Climate Orbiter incident In 1999, when NASA's Mars Climate Orbiter spacecraft was lost in space due to a software error.

The software on the spacecraft used metric units, while the ground-based navigation software used imperial units. This mismatch in units led to incorrect calculations and caused the spacecraft to approach Mars at the wrong trajectory.

Collapse
 
jmfayard profile image
Jean-Michel πŸ•΅πŸ»β€β™‚οΈ Fayard • Edited

That's my favorite example for explaining primitive obsession

❌ Your types should never be "Int" or "String"
βœ… Use instead "Duration", "Length", "DateTime" ...

refactoring.guru/fr/smells/primiti...

Also the metric system is objectively better than imperial units.

Collapse
 
citronbrick profile image
CitronBrick

There is (as of 2022 start) way in Android to get the typed key in JavaScript in Chrome.