1.2: Why eval Is Evil
- In the beginning was eval string
- eval STRING compiles code, runs it and catches die and fatal errors
- eval BLOCK catches die and fatal errors
- The code in eval BLOCK is compiled compile time and the code executes
when the eval BLOCK is run
- eval STRING compiles its code at run time and executes it immediately
- Larry made a mistake keeping both functions with the same name.
- They have little to do with each other.
- Other languages call eval BLOCK names like try/catch which is much more
descriptive
- Newbies learn it and use it for everything
- Not for the timid or faint of heart
- Overkill for most problems
- Action at a distance
- Harder to debug
- Can do equivalent evil of symbolic referencing
- Symbolic references themselves are evil
- Symbol table is for symbols, not data structures