All pastes #370169 Raw Edit

Miscellany

public text v1 · immutable
#370169 ·published 2007-02-24 09:28 UTC
rendered paste body
<sekio> Programming the Manly Way
<sekio> 1. USE POINTERS YOU DUMB CHINKS
<sekio> 2. variable reuse is okay
<sekio> 3. USE FREE() AND MALLOC()
<evilfourzero> new/delete
<sekio> 3a. USE REALLOC() TOO
<sekio> 4.use const
<evilfourzero> 4. use BOTH malloc and free, not just malloc
<sekio> 5. use -Wall
<sekio> 6. DOCUMENT THE CODE
<sekio> 7. READ MSDN AND GOOGLE OR PERISH
<evilfourzero> I'm going ot try and get some kind of foundation uop
<sekio> 8. don't be afraid of using bounds checks
<sekio> 8a. don't be afraid of using assert90
<sekio> *assert()
<sekio> 8b. don't be afraid to put sanity checks into code
<sekio> 9. use header files THE RIGHT WAY
<sekio> 10. macros are good
<sekio> 11. configure scripts are sexy
<sekio> 12. MACHINE DEPENDINT HACKS ARE NOT COOL
<sekio> 13. ommited
<sekio> 14. ntohl() htonl() are your friends
<evilfourzero> I don't use header files the right way
<evilfourzero> lol
<sekio> 15. USE STRNCPY AND FRIENDS INSTEAD OF STRCPY UNLESS YOU ARE POSITIVE THE INPUT WON'T OVERFLOW
<sekio> 15a. never use gets()
<sekio> 16. variable arg functions are sexy
<sekio> 16a. if you make them right
<sekio> and uh thats all i can think of
<sekio> oh
<sekio> 17. USE THE SIZE MODIFIER IN PRINTF() YOU DOLTS
<sekio> "%20s"