Ask HN: How often do you really reuse your code?
11–15 of 15 posts
Re: Ask HN: How often do you really reuse your code?
#12This turned out to be a life saver when I had to analyze / modify a bunch of data- I was able to get a node script up and running over one weekend re-using the existing javascript models and just focus on the analysis, instead of having to recreate everything in Java or Python.
Re: Ask HN: How often do you really reuse your code?
#13I do a lot of HTML/CSS specialist stuff, writing a lot of front-end interactivity from scratch. I maintain a list of snippets that have helped me and others.
https://gist.github.com/tomhodgins/27c29ecb4aceaefe5cdf
Any code I have re-used three or four times ends up getting cleaner each time I work with it, and if it has proved useful a handful of times I add it to list of Snippets :)
Lately I have also been building teeny tiny HTML pages that illsutrate one concept clearly.
Here's my demo of how to harness multitouch cursors with plain JavaScript: http://staticresource.com/touches.html or heres another demo that illustrates JavaScript's Math.random() http://staticresource.com/marbles.html
Little pages like that serve as reminders, teaching tools, and provide a quick reference for me when I want to re-use similar concepts in another project, without looking up what other people are doing or grabbing the trendy Framework du jour.
Re: Ask HN: How often do you really reuse your code?
#14Also I often approach project planning in such a way that I can reuse solutions for problems I solved previously.
Re: Ask HN: How often do you really reuse your code?
#15If you aren't generalizing the problems you're solving in such a way that you can just use policy-types to customize behavior, you're probably not doing yourself any favors in the code re-use sense.