Hadrat Abdullah bin Abbas radiallahu anhu narrates that to acquire and transmit knowledge (by writing etc) for a portion of the night is better than making Ibaadat for the entire night. (Daarimi). One should understand that by mentioning all these virtues of knowledge, it does not mean that optional prayers should be discarded completely. Instead, some time should be kept aside for optional prayers. However, more time should be spent in intellectual pursuits because this is the greatest form of Ibaadat. Knowledge in the above context refers to Deeni knowledge.