Node.js high performance says: You should not have files bigger than 5 kB

60 views
Skip to first unread message

bryan rasmussen

unread,
Aug 31, 2015, 4:09:10 PM8/31/15
to nodejs
So I'm reading the book Node.js high performance on the page where the subject is Seperating your code and it says:

"Again, you should always split your code into smaller parts. Node.js helps you do this in a very easy way. You should not have files bigger than 5 kB. If you have, you better think about splitting it."

Anyway the Again doesn't seem to refer to anything, and the Node.js helps you do this in a very easy way seems especially lackiing but I am still wondering about this stricture of you should not have files bigger than 5 kB, why specifically this size is there anyone that can enlighten me?
If you can enlighten me how does it apply to files that are in some MVC framework - if my controller is bigger than 5 kb what happens?




Jeremy Darling

unread,
Aug 31, 2015, 4:30:21 PM8/31/15
to nodejs
Never heard that before.  Having worked on some very large Node.js projects I can tell you that 5k is no magic number, lots of code bases, libraries, and projects will have source files over 5k.

Really what you have to watch out for is spaghetti code that is easy to accidentally end up with.  Solution, once you have it working, refactor it to ensure readability and reuse.

 - Jeremy

--
Job board: http://jobs.nodejs.org/
New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
---
You received this message because you are subscribed to the Google Groups "nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nodejs+un...@googlegroups.com.
To post to this group, send email to nod...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/de723fc0-5889-4652-8c73-78ede4205d82%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages