
Ask HN: How to learn best practices when you have no one to teach you? - bradhoffman
I 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&#x27;t really assist me since they have their own projects to work on, and, honestly, they have less experience and knowledge than I do.<p>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?
======
WestCoastJustin
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...](https://www.youtube.com/watch?v=UMgMSb7d-Os&list=PL0CdgOSSGlBY7DBgOp1xsRvV31AAUZrX2)

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

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

~~~
LandR
I would say do not look to conference videos for how to write production
quality code... Most talks at conferences are shallow and at worst just the
blind leading the blind.

Be very careful, I've even seen people from places like Microsoft showing code
at conferences that would fail even a decent code review process.

I think for this reason conferences are a complete waste of time. Talks are
too short to go into anything approaching useful detail, and s spend an hour
talking about pointless demo quality code.. Or the talkers arent experts in
what they are talking about. Waste of time.

I would say the same for the majority of blogs. Most are garbage and it can be
difficult to tell the code is garbage if you're a beginner. I dont know a
single development blog worth reading...

~~~
askmike
The blind leading the blind? Most conferences have lineups of well respected
people involved in an ecosystem. From language authors to open source
maintainers and such.

It seems you don't seem to understand the purpose of conferences and blogs.
These talks are not to showcase the best quality production code that can pass
any review process. They are to showcase new developments and new approaches
to do things in a specific field. It's meant for people already in the field
(or starting to get into it) trying to learn more.

If such talks have high quality production code in slides the message would
get easily buried under stuff that isn't important for conveying the message
they are trying to say.

------
iheartpotatoes
"Best practices" is a bit of a red herring. Every company differs
considerably, and online blogospher experts throw the term around as sort of a
gatekeep-y way to keep the order ("What do you mean you don't know (arbitrary)
best practices??!?!") The only way to learn best practices is to work at
multiple companies / projects.

For example, I worked at Intel, Lucent, Apple and DEC. Each one had
significantly different "best practices". When I look at how we did code there
vs something like, oh, the GNU project, they were WORLDS apart. So even if you
made the claim, you'd still fall short from the new environment.

If you're lucky, eventually YOU'LL be the one defining best practices.

~~~
Gibbon1
I'll second that a lot of 'best practices' is cargo cult like gate keeping.

Just learn how to write idiomatic code in whatever language / framework you
are using. At least the approaches are good enough. And other OCD/Autistic
programmers won't lose their shit when they see it.

Do try to write code in an active AKA explicit way. Whne you read the code it
should be obvious what it's trying to do. Code where the right thing 'just
happens' is never clever it's just bad.

Do remember the process you use for a tiny team is different than google or
facebook or a web dev sweatshop.

~~~
seniorsassycat
'idiomatic' vs 'best practices'?

~~~
Gibbon1
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.

~~~
colechristensen
They can mean very similar things so that the question could be:

How to learn idioms when you have no one to teach you?

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

~~~
LandR
It is. I work in c# and if we take idiomatic to be how most devs write c#,
then idiomatic c# is garbage.

------
opportune
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.

~~~
afarrell
How do you learn to read code without guidance and without getting lost? How
do you keep your thoughts organized? At each step, how do you confidently
decide where to go next?

———

I’d like you to take as given that I’m reasonably intelligent — I graduated
from MIT and have been working as a software engineer for 6 years. Yet when I
sit down to read [https://github.com/cypress-
io/cypress](https://github.com/cypress-io/cypress) or
[https://github.com/webpack/webpack](https://github.com/webpack/webpack), I
don’t know where to start or how to incrementally build up an understanding.

How can I learn how to read a project’s worth of code?

~~~
olikas
I've spend my career reading code. I find it particularly difficult without
guidance. I would recommend using some old school technology (pen/pencil and
blank paper) and draw diagrams, write down every question and observation,
notes. Others may recommend using some digital tool, but be mindful how much
energy you spend organising your thoughts, drawing with a digital tool. If
your goal is to understand a software, then don't waste time creating
beautiful documentation first.

It is also important to have a clear goal. Let's say you want to understand
how webpack starts up, or how it does a specific feature. Make this question
your main concern and don't wander around. Don't try to understand everything
at once. Divide and conquer.

It is also useful if you can ask questions, but please spend some time coming
up with a theory first why things are the way they are. Formulate a hypothesis
(e.g. "this piece is necessary because it handles an edge case", or "this
piece of code looks uglier than the rest, is there a reason?") and try to
prove it. If you can engage with the community, the better, but please don't
outsource your "thinking efforts" to other project members. You can't learn
how to reason about code, if you don't reason.

The most important one: be humble. Just because you would've solved a problem
differently, it doesn't mean that the code is bad. Don't spend time judging
the code. You are there to learn from others, so be open to other solutions.
Whether it is a good or bad example is so difficult to judge... be patient and
you will realise what kind of code is easy to understand. Once you have some
idea, take that knowledge to your next project. This may take
weeks/months/years depending on the project size.

~~~
dmux
This is all great advice. Two things that have helped me in particular

(1) applying the "analytical reading" rules defined in "How to Read A Book" to
a code base. One of those rules, as Olikas said, is formulating hypotheses and
questions and "actively engaging" with a code base (or any text).

(2) Compare and contrast a similar project (i.e. using the same language and
framework) to figure out whether the structure of the project in question is
following a general layout or not (e.g. Maven projects in Java).

~~~
afarrell
> “How to Read a Book”

I’d seen that book a while ago but not picked it up. I’m now going to. Thanks!

> formulating hypotheses and questions

I think this reduces to “how do you keep those hypotheses organized?” which
sounds kinda like the problem of “How do I write an outline?”

> Compare and contrast a similar project

This makes sense to me for web apps. Less so for a package manager.

I suppose that means the questions splits off into lots of domain-specific
quesions like, “what should I pay attention to when reading a RESTful
service?” “What should I pay attention to when reading a package manager?”
Etc.

————

For a RESTful service, I would recommend first getting and idea of the core
models from the API docs and then from reading structure.sql or models.py or
whatever holds the relationships among tables. Draw an entity-relationship
diagram on a big piece of paper of the important models.

Then, try and trace the path of a web request from the outside in through
middlewares to the controller then to rendering and back out again.

------
d0m
Adding on top of what others have said..

* Switch job to a place where you can be pushed and mentored

* Make a lot of mistakes, but be sure to learn from them

* There are so many amazing books where the authors shared their mistakes/experience and how they made things better

* It's often much better to slow down and get things right by researching, discussing and prototyping than rushing and having to rebuild it a few times or maintaining shitty code.

* Try to think of the 10X when working on something. Of course, optimize for the current spec, but what happens if you get 10X more loads/users? Is there a way you can make it work for that use-case with roughly the same time? Often, the answer is yes by using a well-tested library and better tools. Ironically, sometimes being forced to think at a bigger scale makes you realize that your solution wasn't that great after all.. and that this problem was already solved.

------
barbs
In general I think it's good to be in touch with communities centred around
your language and framework to get a good idea of how people are solving
similar problems to yours. Things change so much over the years and there are
multiple ways to solve the same problems that you won't get from just reading
official documentation. Once you get a sense of the general playing field you
can deep dive into certain topics.

I can't speak for other languages and frameworks but I know with Android
Development it's useful to keep an eye on the subreddit
([https://www.reddit.com/r/androiddev/](https://www.reddit.com/r/androiddev/))
to see what the latest general consensus is with libraries and frameworks.
There's also a #android-dev channel on Freenode IRC that I dip into from time
to time. Meetups are pretty good too, and people tend to enjoy conferences
although personally with my poor attention span I tend to switch off. There's
a weekly newsletter as well which I find really useful
([https://androidweekly.net/](https://androidweekly.net/)).

No idea what the equivalents would be for Node + Express and MongoDB but I'm
sure they exist :).

~~~
zamalek
> No idea what the equivalents would be for Node + Express and MongoDB but I'm
> sure they exist :).

GitHub, up for grabs issues. If you really want to learn, stick with the more
popular proects, as they usually have more experienced developers involved.

The problem with this is that you need to work after-hours, which is not
everyone's cup of tea.

------
rabi_penguin
I'd like to give a contrasting answer, which is that you should go somewhere
where you can be mentored and learn. If you're concerned about your ability to
continue learning best practices and level up as an engineer, you should keep
in mind that there are many engineering organizations where you'll be able to
work directly with engineers much more senior than you who you'll learn a lot
from -- in my prior experience, it was this kind of collaboration that I
learned the most from. It's true that I learned a lot when I was younger from
self-teaching and experience, but there was a certain amount that I'm not sure
I could have (or should ever have) picked up on the job in production, because
it would have been infinitely more painful and less productive than
collaborating with someone who could help guide me in the right direction, as
well as whom I could look up to as a mentor and a guide.

If you want that (which is reasonable because it's an excellent almost
invaluable resource for your career), you have to first find an organization
that provides that. Where you're at may or may not be that place.

------
tuxxy
All of these responses are missing a huge point here:

If you're a solo developer, stick to _standards_. There are standards for how
something should be implemented (like REST), there are standards to how things
should be written (like PEP8 for Python), etc.

Follow those standards as close as you possibly can. Ultimately, you'll find
issues with them -- that's great! Perhaps you'll even find a more clear way of
doing something that the standard doesn't suggest. This means you can probably
iterate on your original design.

Join a Slack/Discord/IRC with other developers using your toolchain and ask
questions there if you have concerns. If you're worried about design
decisions, find others who have been in similar boats and ask how they did
things and what the result was like.

Typically, best practices are those that emphasize 1) clear code, 2) readable
code, and 3) the KISS principle. Anything that favors complexity over
simplicity _must_ have a good reason for doing so.

~~~
zimablue
I massively disagree with this, as the other part said a lot of standards
don't make any sense. REST always seemed very suspect to me, and Facebook with
some of the best developers in the works basically threw it straight out of
the window with graphql, seeming to validate the scepticism. Html also has
complicated standards about elements which everyone ignores with divs
everywhere. There seem to be a lot of nonsense standards around.

~~~
tuxxy
The reason you massively disagree with it is the reason why OP should try and
do it. Nothing better than learning from the mistakes of others.

------
haolez
You have a lot of people to teach you! It's just that they use books and
GitHub repos to communicate :)

Emphasis on GitHub repos: you can learn a lot of good practices and efficient
solutions in open source projects somewhat related to your problem domain.

------
gdulli
"Best practices" are not the best way to think about your output nor your
(personal) development.

The term is flawed to start with in the sense that it invites you to think of
practices as fixed or objective rather than contextual.

You should think of your development as striving to amass the
experience/wisdom to recognize the practices that are likely to work better in
each situation on the fly. And that just comes with hours and hours and hours
of trying different stuff and seeing for yourself (consciously) what you like
best and what works best and when. It's slower, but finding that stuff out
through experience is really the only true way to learn. Knowledge is a
commodity, wisdom is what matters.

And there's a lot more subjectivity to it than we normally treat it as. A
given practice can be better along dimension X. But two (great) developers can
disagree about whether X is the dimension to optimize vs. Y.

If what you need is a specific practice that is working for people in one
specific context at one specific time, you can search the web. But even then,
it's not a black and white "best" thing and without your own instinct to judge
what you're reading or being told by someone, you're making at some level a
guess.

~~~
ahartmetz
I think you're somewhat taking down a strawman here. Some practices (e.g.
using source control, being super extra careful about state changes) are
indeed almost always best, and it's rather likely that you'll also learn when
to use them for the best practices you do learn. We're - so I hope - not
talking about some nonsense like learning design patterns by heart or some
such.

~~~
gdulli
Using source control is basic and vague, the specific practices around it you
might be tempted to call an education are just as subject to getting lost in
dogma vs. developing personal wisdom as anything else.

------
gridlockd
> 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?

The path to enlightenment leads through suffering. I particularly like "Why I
stopped using X" or "X sucks" or "Pitfalls when using X" kind of blog posts.
Browsing Stackoverflow to see what kind of issues other people run into also
can help sometimes. Focus on the negative. If nobody complains about it, it's
probably not a real problem.

That's also why I'm often skeptical about so-called "best practices". It gives
people excuses to do questionable busywork passed off as "polish". Real work
is not about getting an A+ with a smiley face, it's about choosing the trade-
offs that provide the most value. That implies cutting out a lot of "nice"
things that aren't strictly necessary.

------
salex89
I don't think this will help tremendously, but don't feel frightened if there
is nobody to mentor or push you. When I started fresh from college (although
that is some kind of experience), I found myself in a small start-up with 4
people, one of which was my good friend, but we were not leaders, just
executors. The owner was the business guy, with little technical knowledge.
Nevertheless, we pushed on hard. Learned ourselves (each of us four had little
overlap, we interfaced). And you know what, although I felt lost and
disoriented, I learned a lot, in perspective. Partially because I was
inexperienced, but everything we did was quality, I must say.

Some years after I got into a company where everyone was much more
experienced, and with mentors and all that. You know what? I become a mentor
to most of them in a matter of months... Don't know how it happened, but it
turned out that I've proven more agile.

Now I'm in a much more experienced and serious company, and now I do have
seniors than myself. That helps a bit by helping me differentiate valuable
from invaluable knowledge. But again, if you don't push yourself, no body will
instead of you.

I'm not that experienced, it was only 6 years since I graduated.

------
allan_s
I would like to point out a possible problem with the generic advice "read
books" "follow blogs etc."

=> technological bias

As you are from Node/Express and Mongodb background the biggest risk is trying
to become only better in these technologies. So you will only know how to make
faster horses, how to train them for the best, but you will never learn car
exists.

More than best practices, what makes a great developer valuable (especially in
a position like you where other people in your company are less experienced
than you) is your ability to see wider not deeper.

Try to challenge the status quo ? Why MongoDB? What kind of alternative do you
have ? Same for Node + Express.

Doing so will force you to see where your tool shine and where it reach its
limit. Doing so will permit you to know when you need to dig deeper on "how to
use better this tool", and when to step back and "wait a minute, no amount of
best-practices/knowledge will balance the fact that MongoDB is just no the
right tool here"

So read a lot, but also from people that are not from your community (and to
be honest HN is a good starter on getting different point of view)

The other important things is about perspective, it's not because a
googler/guy from netflix wrote about how they needed to split the code in
microservices, or needed to implement $design-pattern-with-a-very-cool-name
that it does apply to you.

Especially looking to the size of your dev team, I think the worst things that
could happen to you in your journey of trying to be a "better developer" is to
try to be use too complex tools and too complex developments techniques

these articles explains better what I mean:

[https://programmingisterrible.com/post/139222674273/write-
co...](https://programmingisterrible.com/post/139222674273/write-code-that-is-
easy-to-delete-not-easy-to#_=) [https://medium.com/@rdsubhas/10-modern-
software-engineering-...](https://medium.com/@rdsubhas/10-modern-software-
engineering-mistakes-bc67fbef4fc8)

Being able to stop your fellow developers from writing too smart code will be
even more valuable for the companies you will work for. And at the end of the
day, that what will define if you are a good software developer for your boss.

~~~
sjellis
"As you are from Node/Express and Mongodb background the biggest risk is
trying to become only better in these technologies. So you will only know how
to make faster horses, how to train them for the best, but you will never
learn car exists.

More than best practices, what makes a great developer valuable (especially in
a position like you where other people in your company are less experienced
than you) is your ability to see wider not deeper."

Yes, you need to balance the need to be proficient with the stack that you
have now with the big level-ups that come from learning something quite
different. The best way to grow as a developer really is to learn a different
programming language, and the thinking that goes with it.

I've never written a line of production code in Clojure, but learning Clojure
taught me lessons about immutability and functional thinking that changed the
way that that I wrote everything afterwards.

------
pjc50
> 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.

Best practice tip: no developer should be an island. You should all have some
idea what each other is doing, at least once a week. You should be reviewing
each others' code, and asking about the decisions and tradeoffs involved.

------
rocky1138
Don't worry about good code at a startup. Worry about building something
people want. Once you hit hockey stick growth you can hire the technical
talent.

~~~
enraged_camel
>>Don't worry about good code at a startup.

Totally 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.

------
beat
A lot of it is about learning how to learn. Developing skill and mastery is a
similar problem in almost any field, and you can learn a lot by reading from
masters in other fields. I'm currently reading _Handmade: Creative Focus in
the Age of Distraction_ , by Gary Rogowski, who makes furniture. The first
half of the book, at least (that's how far I am) is all about the wide variety
of difficult lessons he's learned on the way to mastery of his craft. There
are many other books like this, and they tend to be very instructive.

~~~
dcx
This is interesting to me. Would you have any other book recommendations in
this vein?

~~~
beat
_Effortless Mastery_ , by Kenny Werner. _The Music Lesson_ , by Victor Wooten.
Both of these are about music, but are really about mastery.

 _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_?

~~~
dcx
Thanks for the recommendations, I've added these to my book list! In exchange,
have you seen this [1] report about excellence in competitive swimmers? The
lifetime of a swimmer is short and outcomes vary wildly, from local swim meets
all the way to the Olympics. It's a great case study on the differences at
each level. There should be copies on sci-hub or other online summaries.

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...](https://www.jstor.org/stable/202063?seq=1#page_scan_tab_contents)

[2]
[https://www.goodreads.com/book/show/81940.Mastery](https://www.goodreads.com/book/show/81940.Mastery)

------
sbr464
One method I’ve found, although slightly obscure and more frontend related:

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](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.

------
e12e
My advice:

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](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.

------
marcamillion
I love this question, but I would like to extend it a bit. Even though the
body of the question the OP asked is about software dev specifically, how do
you learn other non-software dev best practices when no one is there to teach
you?

Specifically, how do you learn how to build a company around your product? Or
how to build a board of advisors/directors? What are the best practices around
managing those?

How do you shift your cash flow management thinking from spending out of the
reserves built up, to spending out of future cash flows?

In other words, aside from building product, there are so many other skills
that a founder has to learn as they grow their company. I assume most YC
companies learn this stuff from YC or their batch mates that have done it
before them.

But for those of us not in the Valley or in YC, how do we learn this stuff?

Also, I guess the main premise behind my question was how do we learn best
practices in company building in general? Ie how do we build the machine that
builds the machine using best practices for everything, or as many things as
possible (for both tech and non-tech companies)?

------
Townley
It's hard to get "better" at something because it can mean so many things.
Describing the attributes that makes you better with MongoDB, APIs, or
software development gets you a lot of the way towards learning how to do it.

Take Mongo for example: is the issue that your database keeps going down? If
you frame it that way, it doesn't take long to discover clustering,
replicasets, and monitoring. Is the issue that your queries are hammering the
server? If so, googling that leads you down a months-long rabbit hole that
ends in indexing, caching, and denormalizing strategies. Are you frustrated
with the amount of boilerplate needed to get mongo data to the frontend?
That's a good hint that you're in the market for a library/framework that
might help with that.

Much in the same way that one of the hardest parts of solving a bug is knowing
what to Google, specifically defining what "better" looks like is the first
step towards getting there.

------
johnwheeler
1\. Make lots of mistakes.

2\. Experience pain in the form of late, buggy software and angry clients.

3\. Read books and work on side projects. (Martin Fowler’s were my favorite).

4\. Repeat for 5-10 years with hopefully ever-decreasing amounts of 1 and 2.

You probably think I'm kidding...

~~~
scarface74
That really doesn’t help. How do you know that what you are doing is a
“mistake” if it works?

10K line UserManager classes “work”.

That’s how you get the “expert beginner”.

[https://daedtech.com/how-developers-stop-learning-rise-of-
th...](https://daedtech.com/how-developers-stop-learning-rise-of-the-expert-
beginner/)

The only feedback you get as a sole developer are your compiler and errors in
production. You would never know that it isn’t a good idea to write your own
AcmeDatabaseManager or AcmeLogManager.

~~~
mindcrime
_How do you know that what you are doing is a “mistake” if it works?_

Reading. Plenty of books, blog posts, and forum posts point out that you
shouldn't have "10 KLOC UserManager classes".

The thing is, one has to figure out how to _integrate_ "book learning" AND
real world experience, so that they're constantly synthesizing a newer, better
understanding.

~~~
badpun
Funny thing is, if you look at codebases of some opensource projects [1] doing
complex and ambitious stuff, written by some real experienced engineers,
you’ll see the common „dogmas” (don’t have long classes, don’t have long
methods etc. etc.) are not obeyed. And yet, they shipped very complex and
successful software. It’s almost as if these rules are mostly arbitrary and
don’t really matter.

[1] I’ve noticed that in codebases of Apache Spark, Apache Oozie, Apache
Cassandra, and Firefox.

~~~
mindcrime
_It’s almost as if these rules are mostly arbitrary and don’t really matter._

Definitely. I mean, _some_ of them probably have some objective basis. But
clearly some of them are indeed subjective and arbitrary. Take "long method
names" for example... I believe method names should state what they do, and
should be however long it takes to do that. To my way of thinking, making a
method name shorter just for the sake of being shorter, and eliding semantic
information, is an anti-pattern, not a best-practice. _shrug_

~~~
sbov
Reminds me of other comments on this subject: one person's best practice is
another person's bad practice.

------
mikekchar
I'll follow the pattern here of expressing incredulity on the fact that my
personal way of dealing with this is different from everybody else's ;-) Read
code. Look around the internet for projects similar to what you are working
on. Try to find and fix a bug or two in each. Concentrate on how you feel
working on these unfamiliar projects. Was it straightforward to work on it?
Was it fun to poke into? Did you feel straight jacketed in your approach? When
you submitted the fixes, how was the reaction? Was it easy to get a positive
reaction? Did people thank your for your contribution but then rewrite
everything you did? Did they tell you that you didn't understand the issue and
reject your contribution? These are all big clues on the success (or lack
thereof) in the approach taken on those projects.

------
JamesSwift
There are a lot of niche slack communities popping up. I've gotten a lot of
great insight being a fly on the wall of a couple.

Other than that, just consume multiple sources of 'best practices'
recommendations and see where they line up. Figure out what works by applying
what you read and form your own opinion.

------
jinfiesto
My advice would be not to worry about this too much at this phase. A lot of
"best practice" is institutional and has to do with how the
stack/org/community is structured. There's not a lot that's "best practice" in
a vacuum. In terms of stuff that would be considered best practice in a
vacuum, you can maybe look at some of the classic stuff like Code Complete, or
any of the TDD or pattern books.

Other people have mentioned that "best practices" can be a double edged sword.
Software engineering is very varied and it's hard to abstract out "best
practices" that apply in all situations. Don't get blinded by "principles" and
evaluate each technical situation on its own merits and weigh the tradeoffs of
the solutions you can think of before proceeding. There are way too many
variables for you to have a playbook that reads "in x situation do y" most of
the time.

With regard to best practice being institutional, you'll formulate a lot of it
on your own as the org grows (if it does.) For example, having code reviews
would widely be considered a best practice across the industry, but in your
situation it is obviously not reasonable. Who would review your code? You?
Lots of institutions have style guides for software engineers (I would
consider this a best practice) to keep software easily readable to as many
team members as possible. In your situation, what engineers are you trying to
keep on the same page? None? In your case, this is then not a useful best
practice.

There are community best practices that sometimes spring up around quirks of
the language and its tooling. I would say the best way to deal with the first
is to use a lint. That will teach you a lot. The second is something you
usually have to get bitten by to find out.

Finally, read a lot of code in your language/framework of choice (critically
of course.) You'll learn a lot of tricks, and will also see a lot of traps to
avoid by doing this. If you're in Node, reading the source to Express is
probably a good place to start and is obviously applicable to your work (and
can only pay dividends in that respect.)

------
hackermailman
Use Google scholar to find papers on API design. Here's one
[https://ai.google/research/pubs/pub32713.pdf](https://ai.google/research/pubs/pub32713.pdf)

Here's many more papers
[http://www.cs.cmu.edu/~NatProg/apiusability.html](http://www.cs.cmu.edu/~NatProg/apiusability.html)
and here
[https://sites.google.com/site/apiusability/resources](https://sites.google.com/site/apiusability/resources)

Check 'cited by' to find more papers

------
mcs_
\- online curses

\- hours of youtube conferences

Sometimes learn is impossible at work, or...

i had and experience... i was working for a bizarre company, the culture was
very far from what i could consider decent, in some cases they were toxic.
Nobody could understand what i was trying to say/do. MSSQL, C# and other very
cool stuff.

But wait... they weren't able to understand what i was doing but... i was able
to understand what their business was, their special use-cases, their
customers and requirements.

Those moment are in the past now. But i learned a lot from people that could
not understand me, having a completely different background.

Everybody can teach us something...

------
lasereyes136
I suggest:

1\. Read - books and articles about what you are doing

2\. Go to conferences and meetups and ask questions

3\. Make learning and self-mentoring part of your daily flow

4\. See mistakes as learning opportunities and get your team to see it the
same way, talk about mistakes with your team

5\. If possible, find someone to mentor you externally, maybe even just an
hour or two a month, just to ask them questions

Learn how to learn and how to figure things out. A mentor is there for
perspective and pointing you in the right direction. Working with other like
minded people that can help you at least think of things from a different
perspective can go a long way.

------
grishaandrianov
There are three ways of learning

1\. by doing a job and making mistakes

2\. by studying theory

3\. by observing how more experienced colleagues do a job that is very similar
to yours (design review, code review, pair programming, daily conversations)

You are already using the 1st way.

You definitely can use the 2nd way by reading books (Martin Fowler, Bob
Martin, Eric Evans, Kent Beck etc.), watching some video courses, reading code
of open source projects, etc.

But in your case it is almost impossible to use the 3rd way. And as for as I
know the 3rd way is far more efficient then others. I would propose to quit
the job where you can't use the 3rd way.

------
meuk
Just my two cents: learning by "experience" works, but is extremely
inefficient, and you don't always get the feedback of your work. You always
learn by experience, but you do as much as you can to learn to avoid making
mistakes in practice. Compare it to learning to drive: Yes, you learn driving
by experience, but you still need driving lessons to avoid getting in
accidents.

You can try to learn on your own by reading, but if you want to make serious
progeaa, you need a teacher, it's as simple as that.

~~~
afarrell
This is a great metaphor.

------
markbirbeck
I would start with the book 'Practices of an Agile Developer: Working in the
Real World'.

That is not to go against other advice in this thread about watching videos,
reading other books, making lots of mistakes, and so on. And it's also not to
imply that there is a single 'best practice', either.

But what this book gives you is a load of solid places to start, on many
different subjects that are important for developers. Subjects like issue-
tracking, code style, how to learn and stay up-to-date, tests, infrastructure,
resilience, working in a team, sharing knowledge, and so on.

It doesn't relate to any particular language or architecture. And it has some
great tips for the situation you describe, where you are trying to do a good
job in the context of a team that doesn't have any clearly defined practices.

I'd buy the paperback, not an eBook, and scribble in every margin. When you've
read it, carry it with you and dip in and out.

Once you have read this, then a lot of other sources of material will make a
lot more sense. Some of them might contain better ideas than those in this
book, which is fine; the great thing about reading this book is that you'll be
in a good position to evaluate other ideas.

------
anthony_doan
Books & projects.

I google around for recommendation on books and get books and read them and do
projects. Books will go over a concept but it won't be enough for me to get it
in my head so I would google around for blogs about the concept and do the
examples in those blogs. Here's an example of me practicing the GenServer
concept
([https://github.com/mythicalprogrammer/elixir_genserver_pract...](https://github.com/mythicalprogrammer/elixir_genserver_practice)).
I also find code reviewing of library very helpful in writing better code. I
used to do this with Scala and Javascript.

Most of the stuff I've learned is on my free time and something I'm passionate
about. Currently it's Elixir. I spent sometime reading and then did a project.
Currently burnt out from the project but I learned a lot and I'll come back to
it.

I know many people just jump in and do stuff. What works for me is to read a
bit do project then read a little bit more. My elixir project went through 3
authentication systems btw. I started with Coherence then Guardian then
Coherence and now POW. I relearn session and learn a bit more about tokens and
API.

------
Fradow
Been there, done that. Little story time: I co-founded a startup (as technical
co-founder obviously) straight out of education, and never really had any
mentor. 6 years later, I've certainly done lots of mistake, but no critical
one, and I can count on one hand the mistakes that had important consequences.

Now, here are what I think is the most important: experience, planning and
critical thinking. Experience you gain overtime, there is no shortcut. But you
can plan from the beginning, and think hard before you commit.

You're already asking yourself the questions. The internet is vast, there are
lots of answers. And guess what, someone's best practices are someone's else
bad practices. It's about your company trade-offs.

Since you are in a startup, you'll probably need to do lots of modifications
on your business logic. That means for you, API development best practices
includes planning for the future, so probably having versionned API. Is your
business logic mostly about CRUD? Read up about REST. Or mostly about RPC?
Might want to read up about SOAP.

You also need to know what's the time expectency of your code. Is it just a
POC? Go ahead with the fastest, dirtiest way to do it. Is it a MVP that is
going to change quite a bit? A bit cleaner, but you can get away with a few
shortcuts. Or are you building a well-defined product that isn't going to
change much? Document, test, and do it as clean as you can. You are still
going to need to refactor a bit every year or two anyway, when you get more
experience.

Keep at it long enough, while thinking about better ways to do things every
day, and eventually you'll learn all you wanted to know. Don't worry, you'll
still have a ton to learn, given the opportunity.

~~~
DelightOne
> Or mostly about RPC? Might want to read up about SOAP.

Why would one use SOAP over grpc in a new stack? Understandable in an old
stack though.

Rest is gold.

~~~
dustindiamond
'Those who do not learn history are doomed to repeat it.'

Also, we don’t always get to choose the technologies of 3rd party providers
with whom we are required to interface.

------
afarrell
I was asking myself this in 2013 and in 2014 I quit my job because of it. I
thought [https://www.codementor.io/](https://www.codementor.io/) was going
after this problem.

——

If not, it pains me to know that there still isn’t an answer besides, “quit
and be skilled enough at determining that a company is good at teaching best
practices.”

> books

Are a way to absorb information that the author thought a broad audience would
want to know and be able to digest. They don’t replace being able to get
detailed individual feedback on your work and your particular questions.

> make mistakes

In my experience, mistakes have one big flaw: They don’t teach you a way to do
something _correctly_. It is possible to go into a situation thinking, “I
don’t know what to do here and I need help.” And to come out of the situation
saying, “Yep, I did my best and I failed in pretty much the way I thought I
would. New information learned: none.” Ideally, you would be able to shop for
or come up with a workable solution yourself. In reality, humans benefit
greatly by learning from the past solutions of others and from getting
personal recommendations.

------
mindcrime
Create an iterative loop with three major steps in it:

1\. Consume external knowledge by reading books, watching videos, taking
classes, etc.

2\. Apply the new knowledge, plus your intrinsic store of knowledge to
whatever problem you're working on.

3\. Note mistakes, lessons learned, synthesis of ideas between "new" and "old"
knowledge, etc. Update your bank of intrinsic knowledge.

Lather, rinse, repeat.

------
antoineMoPa
Since you are using node, a good first step is to setup ESLint. It will help
you stick to a standard and probably teach you new things. That's how I
learned about const, let and arrow functions (I think I was using airbnb
standards at that time). Otherwise, it will improve the overall consistency of
your code.

------
rifung
Personally I actually think you will gain a better understanding because you
have nobody to teach you.

If you work with people who are already experts, they will always prevent you
from making mistakes. Being able to actually make those mistakes gives you a
much better understanding of why people do things though.

~~~
tracker1
I wouldn't say that... I'll often put in "for next time, look at..." type
advice in Pull Requests from more junior coworkers. Sometimes working is more
important than ideal.

It's when a Junior-Mid dev has to add a feature that's made difficult by their
own choices and then rethink to make things better they tend to learn. That
said, plenty of Jr-Mid devs don't advance with more practice, they stay jr-
mid.

------
hombre_fatal
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.

------
anigbrowl
Fail a lot and cry yourself to sleep until you get pretty good at it. Thanks
for coming to my TED talk.

------
mooreds
Conferences.

Meetups.

Hackathons.

Reading books (google for "best software books" and you'll find some lists).

Hanging out in online communities whether general (like HN) or language/tech
specific.

Read articles.

Follow interesting people/companies on twitter.

Blog about your work.

All of the above can help, but you need to pick what works and is fun so you
can stick with it.

------
MaBeuLux88
The best place to learn about MongoDB is the MongoDB free e-learning
university website:
[https://university.mongodb.com](https://university.mongodb.com). You can
follow free courses here - MOOC style.

------
munk-a
Advocate for time, the time you'd spend making those mistakes is going to be a
loss on the company compared to convincing your manager (or their manager) to
allocate some of that senior dev time to mentorship. This isn't about walking
you through tickets step-by-step but make sure that you get smallish tickets
in these new areas of tech and ask your co-workers to vet your work (this
usually happens in the form of a PR review).

Most (really, honestly, most) developers are interested in the way they do
things and aren't opposed to teaching new people the ropes, so I don't think
it's unlikely that you'd be able to get this through.

------
samat
Self learning is one thing and being completely on your own without a way to
ask specific questions on the daily basis is totally another.

If there is no one to answer your questions in your company - try and find
some buddies on the internets or even change company, as in my experience,
ability to ask stupid questions and get answers quick is crucial in learning
programming. StackOverflow is good, but not quick enough.

——-

Ouch, sorry, misunderstood your question. I am not sure there is a book on
best practices on APIs, but it’s definitly possible to have someone
experienced help you as a company. There are good developers with experience
doing this type of contractor work.

------
dilatedmind
Keep things simple and idiomatic. Use dependency injection and hook everything
up in main. You should be able to open up your code and understand what's
going on just by looking at this setup.

Your public apis should be based on the shape of your data. I would prefer
postgres over mongodb because your data probably has a schema.

If you have the time, learn some other languages. Each language has their own
ecosystem where problems are approached slightly differently. You'll pick up
patterns and be able to apply them to your work. I would recommend elixir,
which has a very focused ecosystem and a standard library with well thought
out apis.

------
morazow
Read code reviews of senior developers.

I follow several public and private projects that I do not contribute at all.
Any time there is a review comment on a pull request from senior devs, I try
to check if it is new to me. If so, I note down the problem and suggestions.

Here are some examples:

\- Aleks suggested to limit the try to the places where exceptions can be
thrown and move everything else out of the try.

\- Thomas suggested to use =StringBuilder= instead of =String.format=. The
former is faster and more robust.

\- Oscar suggested to use a =parameter object= or a =builder= when there are
many (more than 3-4) parameters.

------
brianm
Reach outside your company. Genuine appeals for focused help are rarely
dismissed.

You don't need to know almost everything (and derive what you don't from first
principles), that is unreasonable. You do need to have a network of folks you
can ask help or feedback from.

Being on a small team without much support will force either very fast growth
or failure, and your ability to be intellectually honest (is this true or do I
want it to be true?) and identify folks who can and are willing to genuinely
help are important factors.

~~~
j88439h84
I'm having trouble imagining how to do this. What does it look like? Emailing
a friend at another company to ask for code review?

~~~
brianm
I am old fashioned, so I use IM to say things like "Hey, Martin, I'm thinking
about ... Does it make sense?"

Not so much mailing out code reviews, but sharing design ideas, approaches,
etc. Former coworkers you are still friends with, open source collaborators
you have become close to, etc all work.

Basically, build and maintain relationships with people who have good
judgement. Help them out, ask for help yourself.

------
grigjd3
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.

------
drallison
By the time things have been reduced to "best practices" the intellectual rush
of discovery has been cooked out. If you a still fishing for best practices:
experiment, make mistakes, fix, learn how things work, run tests, try things
that make sense first, talk through problems with smart friends, and enjoy the
fruits of discovery. It is often helpful to find a mentor, someone who can
help structure the search for "best practices" and who will give advice.

------
karakrakow
Learn from your own mistakes. But that doesn't scale too well, therefore,
learn from other people's mistakes.

\- ex-boss

Also,find out why something is or isn't a good/bad thing to do.

------
modzu
you're already doing the right thing by thinking about best practises. your
question is pretty vague though, which is probably what invites so many
comments about "experience" being the best teacher. just saying to "learn the
hard way" is doing you a bit of a disservice though, because there is a ton of
material out there!! read it. oreilly my friend. and be sure to share it with
your team

------
edouard-harris
See if you can find someone external to your company to mentor you. Easier
said than done, it's true, but most people who are currently employed can find
someone in their social graph within one or two degrees of separation that's
able and willing.

In most cases, the leverage you'll get from this, compared to trying to learn
everything yourself, tends to be overwhelmingly greater than the cost of
searching.

------
hartator
Books. IMO, Books is the best way of aquiring knowledge.

It’s dense and visual. It’s also more carefully crafted and corrected through
time then say blog posts, online videos or podcasts. Compared to a coach or a
teacher, you also are getting the actual root of the information and not a
distilled and approximate version of it. Even when the person teaching is the
one who actually wrote the book!

------
caseydm
I'm in the same boat as a solo developer. I recommend subscribing to Safari
Books Online ([https://learning.oreilly.com/](https://learning.oreilly.com/)).
As your first action, watch the video series for Clean Code. It's just
incredible and has helped me grow as a developer more than any other resource.

------
crashbunny
Talk to your workmates and boss about the advantages of doing regular code
reviews. You review their code, they review your code. Nothing too formal or
in-depth, best done frequently before additions get too large, but I guess you
also don't need to review every since added line.

"This is the feature I worked on, I chose this approach, any suggestions?"

------
zokier
Everyone is already piling with sources to learn from, so my biggest advise is
avoid falling into the trap of cargo culting and overfollowing the internet
echo chamber. Personal experience is worth so much more than reading something
from a blog post somewhere, even if that somewhere would really be good
information which is not at all such a given

------
austhrow743
"when you have no one to teach you?"

Isn't this likely to change for you one way or the other reasonably quickly
given that you're at the earliest (most volatile) stage of a startup? Unless
you drag things out longer than they need to in denial of failure, you're
going to either be building a team or joining one shortly enough.

------
bahmboo
Lots of good advice, I will add: revisit your own code from a previous
project. Best place to learn about your own habits.

------
karvalhus
Look up node.js best practices at GitHub. It's a great repository with some
real nice tips on production ready node.

------
z3t4
Use a lot of API's to experience the pain points. Read a lot of other peoples
source code. For example the code of your dependencies. Learn by failure, but
also other peoples failures. Read blog post and articles about what you are
doing. Participate in chats and forums. And be persitant and have good
confidence.

------
dewey
Usually if you are the smartest person in the room it's time to move on to a
new job, otherwise you are only hurting yourself especially when you are still
in the early stages of your career where you'd want to learn fast.

Otherwise I'd suggest to look at projects that the "community" deems well
written.

------
euph0ria
There are a lot of articles here on HN explaining problems other people ran
into, solutions and best practices. Just keep reading. I read for 30 min every
day on new tech and ideas even if I don't use them regularly. Keeps me in the
loop and a lot of the ideas and principles are portable to other projects.

------
njepa
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.

~~~
scarface74
Speaking of which, my list:

[https://news.ycombinator.com/item?id=18794561](https://news.ycombinator.com/item?id=18794561)

------
mattlondon
Today's best practices are tomorrow's legacy codebase. Don't get hung up on
"doing it right" if your code works & your comfortable with it, i.e it is
maintainable and it is reliable.

My best advice would be to try and use one of the publicly published coding
standards from a big company as there is usually a lot of good
knowledge/experience baked into those. Use a linter religiously and do not
commit code with lint errors. For every commit, take a step back and think "is
this code shit?" If I had to explain it to someone who I thought was a '
_better_ ' or _more experienced_ coder than me, would I be embarrassed about
it?

Generally you'll get a gut feeling about code being good or bad - how reliable
it is, how often you have to tweak it, how easy it is to change etc. If it is
_hard_ to make changes to some code or its really buggy or brittle then trust
your gut: You Are (probably) Doing It Wrong. That is when you can go and read
around different approaches online to see what other people have done to
approach the same/similar issue and learn from them. Some approaches will
resonate with you, some won't. Make a professional judgement on which (if any)
you want to learn from/emulate in your codebase and why you made that decision
(the thought process helps - sometimes you just need an 'ah ha' moment to work
out your own approach)

tl;dr - beyond fundamentals, everyone does things differently. Do what works
for you and what is reliable and maintainable.

------
slifin
I recommend:

[https://github.com/tallesl/Rich-Hickey-
fanclub/blob/master/R...](https://github.com/tallesl/Rich-Hickey-
fanclub/blob/master/README.md#talks)

I find I learn a lot as a developer who doesn't use Clojure

------
namank
See if you can work with them to plan your code before you guys write it. And
afterwards, if you can do a code review for each other. This is hard in
startups but it can avoid a lot of bugs downstream; cuz I'm guessing you don't
really have any QA either.

------
gashaw
Direct your learning by what you need for your work. You can watch videos on
the frameworks and tools you're using, read blog posts on issues you might
have etc.

After you have some more experience (and confidence) start reading books. Your
first one should be Code Complete 2.

------
csteubs
This approach is definitely up for debate but I stay abreast of emerging "best
practices" by reading the blogs of the tools I use. I'm a software tester
interested in project management and find myself reading Atlassian's QA blog
quite a bit.

------
thecrumb
No one to teach you? Google, Udemy, GitHub, YouTube, Dev.to, etc. etc. When I
started there was no internet and all I had was a book and 'phone a friend' if
I broke something :)

Break stuff. Fix it. If you can't fix it ask for help. Rinse and repeat.

------
rooam-dev
Human evolution at single person scale :)

The key here is your journey to get experience. Every time you try something,
you will be using your past knowledge. To speedup things you should learn from
others' mistakes _too_, but don't forget to learn from yours.

Just my 2 cents.

PS: Good luck!

------
smilebot
1\. Reading and learning from other people's work is certainly a good way to
learn new approaches. 2\. Learning to measure how your code/application
performs will let you test various approaches so you can decide for yourself.

------
jic94
Got to relevant industry/community forums or Slack channels, and participate
in the discussions. You'd be surprised at how willing people are willing to
share insider secrets when you're participating in the community.

------
agoldis
Go to GitHub and start contributing to open source projects that use the same
stack.

------
aloisdg
Read and if possible contribute to an Open Source project you are using
everyday.

------
jrockway
I learned a lot by working on open source projects in my younger days. People
were always around on IRC to answer questions, especially when answering my
questions got them closer to their own goals for the project.

------
eskatonic
There are a lot of famous books on the subject of best practices: "Code
Complete" and "Clean Code" are the first to come to mind, but I'm sure the
folks here can recommend others.

~~~
chrisgoman
These are the _timeless_ books and should be required reading

Pragmatic Programmer: [http://amzn.com/020161622X](http://amzn.com/020161622X)

Code Complete 2: [http://amzn.com/0735619670](http://amzn.com/0735619670)

~~~
rcavezza
Refactoring by Martin Fowler is a great one
[https://www.amazon.com/Refactoring-Improving-Existing-
Addiso...](https://www.amazon.com/Refactoring-Improving-Existing-Addison-
Wesley-Signature/dp/0134757599/)

Design Patterns is also very well known [https://www.amazon.com/Design-
Patterns-Elements-Reusable-Obj...](https://www.amazon.com/Design-Patterns-
Elements-Reusable-Object-Oriented/dp/0201633612)

------
satisfice
Best practices is a marketing term. Put it aside. Your problem isn’t that you
lack some particular practice, but rather that you feel incompetent and
inferior. New techniques won’t fix that.

------
crispyambulance
I sympathize with the situation of having "no one to teach you".

I don't know why, but in my experience software practitioners are apt to be
incurious and beginner-hostile. They tend to expect questions to be absurdly
well-formed-- almost to the point of answering themselves. I believe this is
part of the reason why stackoverflow seems like it is overrun by assholes.

The fact is, the best way to learn anything is by having a good teacher or
mentor. A truly good teacher won't merely answer questions. A good teacher
ASKS QUESTIONS and provokes the student into discovery. Good teachers are
rare, but they aren't necessarily subject-matter experts, they just need to be
a few steps further than the student along the path.

Even if you don't have someone that you can call a mentor, you can get on a
rewarding path to learning new stuff by forming a workshop to learn a subject
with colleagues. Exploring new subjects and solving new problems together with
another person is an amazing and energizing way to learn things. It almost
doesn't matter what skills you have relative to others, if you're far ahead in
some topic, you will get better in it by teaching it to someone. If you're far
behind, you can depend on the other to give you some clues for proceeding. If
the chemistry is good and the environment allows it (not a sweatshop) this
will work just fine.

------
acconrad
I haven't seen this advice yet but follow thought leaders on Twitter. They'll
post blogs and offer advice to keep you up-to-date on what the zeitgeist of
your lingua franca is.

------
aboutruby
You can always find people to help you. I'm not a node + express specialist
but I do a fair share of JS, you can contact me at
localhostdotdev@protonmail.com if you want.

------
theprotocol
I did my best ever learning working with a peer who had about the same skill
level as me. We grew together and exchanged notes about things we learned.

------
djohnston
I would say contributing to a popular project would be a good starting point
if you want to see the end result of conventions.

------
dansman
Look up github repositories that with desirable implementations. Follow people
on twitter posting about their experience.

------
gpsx
Wait until the next engineer, however experienced, inherits your code and he
will tell you everything you did wrong.

------
karvalhus
Look up node.js best practices on GitHub. Great repository with a lot of tips
for writing production ready node.

------
segmondy
Read engineering blogs, most big companies have it. Follow HN topics Read
books Go to conferences

------
stackzero
Some practical things that have helped me, by no means an expert:

1\. Practice writing new project's from scratch. not so much todo apps but
challenge yourself e.g. I wrote my own function as a service engine

The main point of the exercise is to show: \- Best practice is contextual, so
first you need context ;) \- Think about the big picture and all the pieces to
get there \- Repetition. It will help you improve your development flow and
process, and become better at your craft

You can borrow design/implementation ideas from current projects that you're
familiar with or use a design pattern you found on a blog etc. it will help
you recognize when certain practices are the "best".

2\. Rewrite this code continually. Is there a better way? more concise?
faster? easier to test? It seems there's many ways to do the same thing. Which
one is best depends on the situation.

3\. Optimize last. No seriously. If I could count, the amount of times I've
thrown away code because I optimized to early...

tl;dr best practice needs context. This requires big picture thinking. Learn
to recognize contexts and the best practices are alot clearer

------
1337shadow
Try to contribute to open source projects

------
mychael
Join a programming Slack group.

------
funkjunky
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/](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.

------
xiaodai
Use common sense and think through

------
BucketSort
Blog posts other developers make detailing the way they've built a particular
project have helped me gain some perspective when looking to understand how
people are working in a particular stack. Learning from other projects is good
for understanding how people are using contemporary tools. Github is also a
great source for this, you can search with those tags to find relevant
projects. As for software engineering in general, there is more academic
materials which cover various methodologies ( you can just search software
engineering and find many resources ). There are so many resources out there;
I don't personally have a systematic way of navigating it. Once I find a good
resource, I tend to look at what else the author has done and who else is
connected to that author and then I walk around what that social circle's body
of work, picking up various things. Finding the sages in a particular area,
finding out who really knows about the area I'm studying at the moment, then
learning from them... all starting from Google searches and some sleuthing.

~~~
reaperducer
_Blog posts other developers make detailing the way they 've built a
particular project_

The hard part is finding the _right_ blog. There are a ton of blogs out there
from developers with little experience who are convinced that their way of
doing things is the best/only/right way. The blogs are often nothing more than
SEO for their resumes.

For that reason, I'd lean heavier on books. At least with books there is
_some_ filter. Yes, it can be incomplete and sporadic, but it's often better
than the wild west of bad information out there, especially in web dev blogs.

~~~
BucketSort
Yes, good point. Usually you can filter blogs by reading the comments and
seeing the reception it got as well as the popularity. If it is an open source
project, you can see the stars on GH and read through the issues on the repo
to further filter. Books get outdated very quickly for modern tech stacks. I
would recommend them for the fundamentals, but not contemporary stuff. You
obviously have to do your due diligence here. Researching the author is also
important obviously if you are going to truly heed their advice.

------
diminoten
I recommend participating, daily, in communities, particularly ##programming
or #python (if that's the language you're learning) on Freenode.

It's less that you'll learn best practices, but you will expose yourself to
the zeitgeist, which I feel is important to being a good dev. Again, not to
blindly follow it or even agree with it, but to understand it and why it's
pushing in one direction or another.

------
crimsonalucard
Stackoverflow. No joke. I'm not saying look up stuff on stack. I'm saying
literally ask your expert level questions on the site. The wealth of experts
willing to answer obscure questions is incredible.

