Live data from Hacker News

Ask HN: How to learn best practices when you have no one to teach you?

news.ycombinator.com

131–140 of 209 posts

Re: Ask HN: How to learn best practices when you have no one to teach you?

#131
So, avoiding the discussion of what constitutes best practices, it's important to recognize that you don't know everything (which you seem to get), but also identify the things you don't know and learn how to research them enough to handle your task, which is definitely more than Wikipedia but most often you don't need to be an expert in a thing. Unfortunately, if you don't have people around to grade your work, developing a sense of this can be quite hard.

Re: Ask HN: How to learn best practices when you have no one to teach you?

#132
There is about five to ten books that will be commonly recommended to be a better programmer. Code complete, Smalltalk best practice patterns, clean code etc. You can find lists online. Read a few that seem interesting and at least you will have common ground with many other programmers.

Re: Ask HN: How to learn best practices when you have no one to teach you?

#133
Conference Youtube videos. They are a goldmine of useful tips and tricks. Go look for videos from the Node [1] and MongoDB [2] conferences and you will find tons of war stories and what is actually working for people. Using this option arguably connects you directly with some of the best people in the world who are actually using this stuff.

ps. using the youtube 2x playback speed option can really help digest lots of video content quickly [3]. I use this almost exclusively on youtube now.

[1] NodeConfEU 2018 - https://www.youtube.com/watch?v=UMgMSb7d-Os&list=PL0CdgOSSGl...

[2] MongoDB - https://www.youtube.com/user/MongoDB/videos

[3] https://sysadmincasts.com/episodes/52-video-playback-speed

Re: Ask HN: How to learn best practices when you have no one to teach you?

#134
post #132

There is about five to ten books that will be commonly recommended to be a better programmer. Code complete, Smalltalk best practice patterns, clean code etc. You can find lists online. Read a few that seem interesting and at least you will have common ground with many other programmers.

Speaking of which, my list:

https://news.ycombinator.com/item?id=18794561

Re: Ask HN: How to learn best practices when you have no one to teach you?

#135
I did a quick control-f "read" and almost everyone is telling you to read books or articles about best practices. That might be useful once as a highlevel overview when getting started on a topic, but my personal advice is to only do that briefly. You'll get the most bang for your buck READING CODE. There is no better way to improve as a developer than reading good code.

Reading articles and books will teach you things that sound good but may not hold up in real life. Code is battle tested and real. To learn about art, you can read volumes about form, shape, color, composition etc. but you really need to look at great art. Same with code.

Of course, you may wonder "how do I find good code?" I would just try to find high-profile OSS that deals with whatever kind of tech you are interested in. It may not all be good, but if you diversify the code bases you read, you will notice the differences and learn for yourself why some might be better than others.

Re: Ask HN: How to learn best practices when you have no one to teach you?

#137
It's a real challenge. You really just need someone to tell you "no, do this, don't do that." A lot of things are just wrong in subtle ways or invisible until you hit a certain scale, so you have no idea.

For example, I built my first production application taking a database connection from the pool in middleware and then returning it to the pool at the end of the response. My much more experienced friend looked at my code and told me that connection pools are made for taking out connections and returning them to the pool as soon as you were finished with them. And that I should use timestamptz instead of timestamp. And so much more.

It makes me cringe to think how long I would've gone without figuring out these things had it not been for someone to set me straight early on.

Re: Ask HN: How to learn best practices when you have no one to teach you?

#138
post #49

Earlier quoted context omitted.

This. I have been looking for a company to be mentored at for the past 8 years. They don't exist (well they do, but they are few and far in between - and it varies from team to team even in a company) The way I've learned is through books/talks, common sense (often things are clearly terrible for obvious reasons), people willing to take risks on giving me projects, and sweat/mistakes/learning how to focus on the righ…

They do but they're extremely rare. Before I started for myself I spent a lot of time mentoring my team. Most if it was building their confidence up so they could think critically themselves whilst reading the right books. I myself have never had a technical mentor. Never needed one. What I did need and have were mentors for the other 90% of being a successful professional (and people who built my self confidence up)…

I think this is because "mentorship" is very hard to plan at the company level. My best mentors have been specific senior devs who were willing to share what they knew.

Re: Ask HN: How to learn best practices when you have no one to teach you?

#139
This is something that can be difficult to learn even if you've been working in the industry (lord knows we've all seen awful practices at various companies in our career).

This is probably not popular advice, but of all the places I've worked, Google seemed to have the highest standards for best practices I've seen. I recommend paying attention to Google's best practices, in their blogs, certification programs (like the google cloud developer cert), Coursera courses, product docs, codelabs, style guides, git code, etc. Obviously everything they do won't be a right fit for your company, but it's something to aim for.

Enforce code style (be specific and use a linter), and write tests as you go. Try to keep bad code out of your repo before PRs can even be merged. I use Jenkins and git hooks to enforce this for the whole team.

Draw up design docs and understand business needs before diving into projects and features.

Understanding good architecture and operational principles will make you much more valuable as a developer than your peers. Read the Google SRE book, it's free. Also read http://highscalability.com/ articles and learn from other companies' triumphs and mistakes.

Books about architecture include the micro services book by Sam Newman. You may not ultimately be responsible for making these decisions, but demonstrate your value by being able to understand and provide quality feedback to your tech leads and architects.

Study and learn about project management techniques and craft/enforce your process. Not everything boils down to good code and architecture, if your development process sucks, everything else will definitely fall apart.

Be able to spot the flaws in your organization and offer ways to improve their process and quality. By doing so, you will also improve your own.

If you have a cloud provider and a support package, use it often. Most of what I know about best practices came from supporting Google Cloud customers, seeing what they were doing poorly, and working together to find better solutions.

Be sure you're not just abstracting your API libraries, but your use of 3rd party libraries and services as well. You don't want to have to refactor all of your code just because you need to swap out one technology for another.

If you're actually better than the rest of your team, you should be mentoring them. Teaching others is incredibly helpful at solidifying our own understanding of topics, and exposing the gaps in our knowledge.

Read "The Phoenix Project". It probably applies more for the DevOps/SRE/Management side of things, but I think there are VERY important lessons to be learned for everyone in there. Highly recommended.

Re: Ask HN: How to learn best practices when you have no one to teach you?

#140

Earlier quoted context omitted.

My inner Northcote Parkinson sort of triggers on 'best practices'. Best tends to imply that all the other ways to skin the cat are 'bad.' Which is likely objectively untrue. Idiomatic is more neutral and means basically just do it the way everyone else tends to. The real advantage to that is you generally avoid pitfalls and annoying other coders.

They can mean very similar things so that the question could be: How to learn idioms when you have no one to teach you?

To which I think we land on the recommendation: seek good examples and mimic them. Trouble is finding them.
Post reply on HN