HNHacker News
TopNewBestAskShowJobs

uweschmitt

10 karma · joined January 24, 2017

submissionscomments
uweschmitt··on Writing Documentation When You Aren't a Technical Writer
The referenced report from Nielsen-Norman is from 2006 and outdated. They published corrections at https://www.nngroup.com/articles/f-shaped-pattern-reading-we...
uweschmitt··on Ask HN: How do you deal with loss of motivation?
My order of priorities: satisfaction, purpose (both are tightly connected) and finally enough money to make a living (see https://80000hours.org/articles/money-and-happiness/).
uweschmitt··on Postmodern Error Handling in Python 3.6
I'm not a big fan of type annotations because the code easily turns unreadable which is not what I expect from Python code.

But for larger projects type checking is valuable. Types introduce additional contracts between components to manage and control the overall complexity of the system.

For small scripts and self contained applications I regard type checking as a burden. For larger projects not.

Pylint is a valuable tool to detect typical errors but does not check types. Regard a function which returns the sum of two given arguments. It will work with both arguments being integers and for both being strings. PyLint will not complain here, but if your code uses this result you might trigger errors much later during progam execution which are hard to detect or understand without type checking.

uweschmitt··on Postmodern Error Handling in Python 3.6
Good unittesting can trigger the relevant exceptions. I know this can be a lot of work to write tests which trigger all your corner cases. I practiced this in a recent project but now I'm much more confident in my code.

Another strategy is to catch the "expected" exceptions first followed by a general exception handler. This can use the `traceback` module to log the call chain and error message.