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

> Realistically, that's just what happens when a language allows top-level statements, as they are executed when a file is loaded. As such, scripting languages tend to fall victim to the problem, but compiled ones don't.

Lots of languages allow initialization code (e.g. Java static initializer).

But in the case of scripting languages, usually the classes and functions themselves are initialization code....i.e. everything is initialization code.



Consider applying for YC's Summer 2026 batch! Applications are open till May 4

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

Search: