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

>The need for nested functions bugged me as well. That seems like an odd deal-breaker and hints at code smell

Nested functions were a very common pattern on languages like Pascal, Modula or oberon. They are equivalent to code blocks inside a function in C.



The equivalent in C is code blocks connected with gotos. In my conversions of C code to D, I'm able to replace these gotos with nested functions, which makes the code significantly easier to read.


Indeed, it serves encapsulation.




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

Search: