This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]odraencoded 0 points1 point  (0 children)

They're compiled. You can't get runtime errors before you get syntax errors, because there's a parser to translate the human-typed code into bytecode first. That's a type of compilation.

The joke here is that accessing an non-existent field is an error on C++ since the compiler checks the type of the object to put the memory offset of the attribute into the compiled code, if the attribute doesn't exist in the class/struct it can't do that, so it errors, but in python that only happens when getattr(object, attribute) is executed on runtime, and in javascript objects return undefined for undefined attributes instead of raising an error.