Ask HN: How to learn best practices when you have no one to teach you?
440 pointsI am currently working for a startup and am one of 3 developers. Most of my work revolves around building the API in Node + Express as well as some small projects with MongoDB. The other developers don't really assist me since they have their own projects to work on, and, honestly, they have less experience and knowledge than I do.
So my question is: What is the best way for me to go about learning best practices in API development, or using MongoDB, or even just being a better software developer in general?
Comments (197) 98 threads
Earlier commentsTotally depends on the startup. Building a new blog engine? Sure, go wild. Making financial software? You need to be very careful, and write good, secure code.
Shop Class as Soulcraft, by Matthew B. Crawford. This is a much more philosophical/academic argument that skilled manual labor is both intellectually and morally superior to most office work - you're shaping reality, rather than shaping yourself. I happily lump the craft of software development in with physical labor here, though, as it faces the same kinds of reality-based limitations.
Zen Mind, Beginner's Mind, by Shunryu Suzuki. Transcribed lectures by a well-known Zen monk. The entire book is basically about learning how to sit still. If you can't even sit still, how do you expect to do anything else well? And do you have any idea what it even means to just sit still?
I also liked Mastery by George Leonard [2] - it's a little booklet about mastery with the same kinds of generalisable takeaways, drawing on his experience as an Aikido practitioner.
[1] https://www.jstor.org/stable/202063?seq=1#page_scan_tab_cont...
[2] https://www.goodreads.com/book/show/81940.Mastery
1. Visit a complex web app, check if source maps are enabled.
2. Using Chrome DevTools, download the sources and source maps.
3. Install shuji, https://github.com/paazmaya/shuji
4. Run shuji recursively on the source maps to output normal code.
5. Review Components/code to see how current companies are carrying out (best) practices, etc.
For me, it helped break down how different companies (with closed source) are structuring React/Redux code for complex apps.
1) learn (read guides, books, code)
eg: find something close to what you're doing at one of the books at: http://aosabook.org/en/index.html
Read about nginx if you're working with web servers - even if your server is in node. Read about postgresql or mysql if you work with data. Etc.
2) implement
Try things out. Do a module in ttd (red/green/refactor). Pack a sub system up as a node module, distribute it on npm.
3) automate
If you have any tests - set up CI. See that all your commits "pass" (ok, because you only have that one test - but now it's easy to add more).
Once CI is working, you can set up automatic lining.
4) repeat/improve
In general, try to find the smallest step from where you are, towards where you want to get to. Avoid leaps. Change one thing at a time (eg, you've used mongodb+node+express+react: try using typescript or change out react for vue. Or look at using postgres over mongodb etc.
I'd also try to encourage some kind of internal sharing. Maybe tech lunch Friday - where you can each give a lightning talk on some small nice thing you've found/used recently.
Try to "budget" for improving. Make it work, then spend an hour or two making it (more) beautiful.
All comments shown.
Couldn't load more comments. Check your connection and try again.