January 09, 2019
There are many choices that a Developer needs to make when creating any piece of software. Each choice leads to different way of software being built. The more choices there are the more the trade-offs and each combination of those choices lead to a different result. Sounds like I am just saying something that everybody does where is the problem here?
The reasons as for why it is so could be many, but I can think of a few as to why :
The above-mentioned list is not exhaustive but I think gives us an idea as to why it is the way it is.
A sample of choices available:
So what? Having these many choices should be a good thing right? Unfortunately when we are trying to build stuff having too many choices can lead to variety of problems:
Obviously the solutions I can provide can only help with the problem but cannot elminate it, since no one can control the community as whole and nor should they. I strongly believe that the reason for such a large adoption of JS is because of its community and open source efforts put in by some really smart folks! So I am not recommending to stop innovating no, I am just trying to ease the pain that can come from having so many choices as a developer who is trying to solve some business problem!.
Solution needs to handle at both People Level and Technical Level:
From a technical perspective the aim should be to reduce the possible number of decisions that individual dev needs to be make.
For example, there are certain good practices that have been identified by the community and the industry in general which can be adopted by default using some tools. A good example of such decision is
'use strict' mode which basically avoids lots of issues by setting some sane constraints and which are enabled by default by tools like
So in that spirit here are some similar steps that will help in dealing with the decision tree by reducing the number of decisions that need to be made by individual developers:
create-react-appto setup the project which abstracts away setting up webpack and build scripts. This lets us avoid dealing with configuring
webpackand lot of choices that come with it.
create-react-appfor your organisation, so that teams starting off new projects don’t have to start from step 0.
prettierto keep the formatting consistent instead of configuring
ESLintfor different style rules and relying on developers manually fixing those style guidelines.
appand updating it as the code base grows.
I think the first and foremost thing to be understood is the fact that no matter what choices are made there is still a fair amount of chance that it will make certain things harder to do! So instead of trying to achieve perfection from the get go the aim should be do to reduce the difficulty in onboarding and try and make the best of choices to best solve the business case that we are trying to solve. And when in where we hit a case which becomes difficult to do we should go ahead and use hacky code to make it work instead of worrying about having made wrong choices (perfection is overrated!).
So here are some steps that can be helpful:
prettierto set the formatting constraints. I think the smaller decisions are where most unproductive debates can happen and many a times making these small decisions can make the bigger decisions obvious or at least easy.
Encourage incremental adoption, at a highlevel I think it should be something like this:
Reactand you are passing
propsdown to multiple levels instead of using
Reduxone can use the
Contextapi to get the job done.
Thanks for reading. Happy Coding!
Personal Blog by Varenya.
My random musings about programming!