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

Just be sure that each one of the 30 function is doing something interesting and obvious at the same time.

For example, if your language lacks a CopyTagedMatrix then you just write one, it gets the correct size, allocates the memory if necessary, copy the elements and return the new matrix. Now you can use it without remembering the implementation details, and it’s much clearer than the 10 lines that necessary to get the bounds and the fors to iterate over the matrix.

An extreme example is the GMP bignum library. You use each function as magic, and never read the implementation details. (Unless it’s in a very tight loop in a very hot part of the most important feature of your program, but I doubt that it’s good to use GMP in that place.)



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

Search: