4 ms·
Just finished debugging one of those ugly issues where it works fine for the developer but for some other person things are broken. it was a piece of code that
by simion314 5y ago
Just finished debugging one of those ugly issues where it works fine for the developer but for some other person things are broken. it was a piece of code that assigned an Number to a property that should have been an object(the dev confused the property name). Because the project is complex and there is a lot of network requests and stuff running in different order depending on the user internet the bug did not happened to everybody. You could work aroudn this using setters and doing runtime checks but I have a feeling people that don't like types also don't like getter and setter.
- markstos 5y agoAre you saying that if there had been type checking, this issue would have been much easier to detect and prevent?
- jaywalk 5y agoHow could it not be? With type checking, you wouldn't be able to set a variable to a number when it's supposed to be an object.
- simion314 5y agoYes a line like stuff.anAccountTypeField = obj.aNumberValue; Would cause an error in a typed language , something like incompatible type Number and type Account. Maybe you were confused by my commnet about the network requests and different order of running code, this caused the error not to happen most of the time so it never crashed on developer machine.