Hacker News new | past | comments | ask | show | jobs | submit login

Horrific is a new one! Thanks for posting your solution :)



It's worth looking at the other solutions in-thread. Key points:

- Use of higher-order operations, like filters and aggregations, to avoid loops.

- Passing around functions (the * and + side are the same, except for one operation) to avoid repeated code

This results in:

- Less code. Defects per KLOC tends to be pretty constant, so shorter / higher-level programs are typically less buggy.

- In particular, less repeated code. Cut-and-paste introduces a whole slew of potential defects.

- Less dependence on order-of-operations, which eliminates whole classes of errors, from off-by-ones to data structures in intermediate inconsistent states.

The relevant book here is still SICP.




Join us for AI Startup School this June 16-17 in San Francisco!

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

Search: