4 ms·
Sounds like javascript "code". A normal language with proper type system would not allow that.
by EVa5I7bHFq9mnYK 2y ago
Sounds like javascript "code". A normal language with proper type system would not allow that.
- CalRobert 2y agoI don’t see how typing relates to this.
- mkl 2y agoProbably one of the variables is undefined, and static typing could catch that.
- timeon 2y agoAlso warning for unused variable.
- normie3000 2y agoIs it the compiler that would catch it?
- mkl 2y agoYes. This would be caught by the compiler in C, C++, Java, Rust, Haskell, etc.: https://stackoverflow.com/questions/1517582/what-is-the-difference-between-statically-typed-and-dynamically-typed-languages#1517670 https://stackoverflow.com/questions/1517582/what-is-the-diff... Many statically typed languages do have escape hatches to do some dynamic typing at runtime, but this is not the default (hence the classification), and it requires some additional effort to use.
- zo1 2y agoIt's not the language, it's the IDE and laziness. They're doing this in notepad or maybe VSCode and don't have anything configured for highlighting or checking. Heck they probably don't even know how to interpret the error message saying "file_name is not declared". I'm the first to bash JS, but this is not a JS issue. It's 100% a "bad and lazy" human actor that is throwing spaghetti on the wall to see what sticks. In this case, they have a minigun cannon called ChatGPT/CoPilot that is letting them do more of it than what they used to.