Question 1/13 fast.ai v3 lecture 12

Debugging machine learning code is hard. Does it make sense to follow strict formatting guidelines? What are some of the things you should focus on when formatting your code?

Answer

You should format your code so that you can understand it better. Following strict formatting guidelines, in many instances, might not be ideal.

Relevant part of lecture

supplementary material

Fast.ai coding style guide - a very comprehensive resource referencing many ideas not generally known

Jeremy Howard emphasizes formatting for your own understanding. Another aspect worth highlighting is the 'code is meant to be read' approach. You write your code thinking of the person who will read it some time down the road. Adapting this perspective can make your code much more understandable and better suited to refactoring. And quite often, the person reading your code a couple of weeks or months down the road will be... you!