In the book Deep Learning and Neural Networks by Michael Nielsen, he used a naive approach to write the code which is a bigger considered to a code written in tensorflow.
I want to know which code is better and how it is better ?
In that book the author encourages the reader to write a neural network library from scratch, to gain an understanding of the principles of deep learning. Tensorflow is a mature deep learning library that can be used in production, and can make use of high performance computing resources like GPUs and TPUs. The code in the book is better for learning and Tensorflow is better for training models for real world applications.