Comment

Comment by AndyKelley

If I made my own criticism of these rules it would be very different from OP. It was difficult to take the article serious from the get-go when it defended setjmp/longjump. That pattern is so obviously broken from anyone who has ever had to go near it. The article makes an argument like this:

1. setjmp/longjmp is exception handling

2. exception handling is good

and I take serious issue with that second premise.

Also the loop thing obviously means to put a max iteration count on every loop like this:

for (0..N) |_| {

}

where N is a statically determined max iteration count. The 10^90 thing is silly and irrelevant. I didn't read the article past this point.

If I were to criticize those rules, I'd focus on these points:

* function body length does not correlate to simplicity of understanding, or if anything it correlates in the opposite way the rules imply

* 2 assertions is completely arbitrary, it should assert everything assertable, and sometimes there won't be 2 assertable things

parent AndyKelley 1 year ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton