Hacker News new | ask | show | jobs
by carlmungz 2521 days ago
I've been toying with the idea of creating my own lightweight JS and CSS framework so I can achieve similar levels of productivity. I know it varies between people but I find using third-party frameworks slows me down more often than not when I want to quickly build something.
1 comments

I wonder if it is faster to learn a tool deeply than to build your own.

The advantage of building your own is that you are forced to go over every piece of it. However, if there was a way to do that for a pre-written tool -- say, rewrite things more efficiently, or just use it in weird ways -- it might be faster to learn than build.

The reason it would be faster/better to learn a tool deeply is now you have more than one mind working on the problem. Your own and all the other geniuses out there working on the tool. And the tool can be simple. (Just use Torus, for instance).

I think there's truth to both. A great example of the second kind is Chrome Devtools (or firebug, or insert-other-browser-equivalent-here, but I think Chrome leads the pack here). Chrome's developer tools is a gold mine of incredibly useful tools for profiling, measuring, and understanding complex frontend applications, and most developers only use a tiny fraction of the features it offers. Learning devtools deeply has been one of the most worthwhile investments of my time in my short dev career.

But the reason I lean towards build-your-own is that, especially for libraries and dependencies, popular tools that are "production-ready" also tend to aggregate over time features that everybody wants, but might not be useful to me personally -- it's hard to stay focused while growing to be the dominant tool in the industry. And that also makes it difficult to understand it completely. I think I understand React _well_, but wouldn't dare say I understand it completely; I can confidently say I understand every single line of Torus, because I maintain all ~1000 lines of it. And that makes it easier to stay in "the flow" when working.

I am currently in the process of doing something similar: https://github.com/CarlMungazi/aprender-js

Once I'm done, I'm probably going to have a proper crack and either building my own tool or collating smaller libraries (and by small I mean they do one thing only and do it very well) into a toolkit I can build stuff very quickly with.

I think the knowledge gained by building your own tool (CSS library, UI framework, state management library etc) seeps into any work you do with other tools or programming in general. It also depends on your aim. You will be more productive using whatever approach you spend time learning deeply.

Boy have I got a treat for you -- or maybe not if you're very knowledgeable in the space -- but this is an amazing course for walking you through the main functions of a framework and the code for some major frameworks:

https://www.udacity.com/course/front-end-frameworks--ud894

I am not associated with Udacity, but I love them so much I promote them every chance I get.

Nice - will check it out if I ever get the time.
I would imagine rolling your own also puts you at significant risk of being distracted by yak-shaving.