VirtualTam's bookmarks

  1. Bigger than my head 2015-03-17

    A friend of mine was once interviewing an engineer for a programming job and asked him a typical interview question:

    • How do you know when a function or method is too big?
    • Well, said the candidate, I don't like any method to be bigger than my head.
    • You mean you can't keep all the details in your head?
    • No, I mean I put my head up against my monitor, and the code shouldn't be bigger than my head.

    ~ from http://www.gigamonkeys.com/book/practical-a-simple-database.html

  2. Beware! Very cool book dealing with Lisp programming, with plenty of examples

  3. Given your unittests are in the tests directory:

     1# run a specific test module
     2python -m unittest tests.<module>
     3 
     4# run a specific test suite
     5python -m unittest tests.<module>.<class>
     6 
     7# run a specific test
     8python -m unittest tests.<module>.<class>.<test>
     9 
    10# run tests matching a given pattern
    11python -m unittest discover -s tests -p <pattern>
    
  4. electric-indent has been activated by default in emacs 24

    to disable it for Python: (add-hook 'python-mode-hook (lambda () (set (make-local-variable 'electric-indent-functions) (list (lambda (arg) 'no-indent)))))

  5. TL;DR: you won't.

    This website is rather a good memo regarding each language's foundations:

    • what's its general purpose?
    • how to write core instructions, such as functions, loops, conditional structures?

    I find this kind of reminder quite useful when it comes to documentation languages (e.g. TeX, Markdown)