Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I don’t see how typing relates to this.


Probably one of the variables is undefined, and static typing could catch that.


It'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.


Is it the compiler that would catch it?


Yes. This would be caught by the compiler in C, C++, Java, Rust, Haskell, etc.: 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.


Also warning for unused variable.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: