Unlike other disciplines that are more rigid and regulated like Civil Engineering, Software Engineering doesn't have a set of rules to follow by law enforcement.
You won't go to jail if you don't do TDD (Test-Driven Design), or even write tests for your code.
Your system can work just fine if you don't follow any agile method.
You could deploy your next app in a bare-metal Linux machine instead of setting up Kubernetes on a cloud provider to auto-scale your pods, and no one will complain about performance and such.
We have all read Clean Code, Clean Architecture, and some other "bibles" of the software development world which tell us what are the "best practices".
We have all spent hours learning about Scrum or some similar methodology to manage a software project as opposed to old-fashioned cascade-like project management because that's what works "best".
We do tons of meetings, in Scrum alone we have: sprint planning, daily scrum, sprint review, and sprint retrospective.
There are days when I wonder if I attend meetings for a living instead of developing software.
So, what is all this rant about?
It is about not following blindly the so-called "best practices".
I do X because Google does, I use Y because Facebook uses it.
This is a silly reason to do or use anything.
If you are not working with lots of people, in a huge project, with thousands of simultaneous users, following all the "best practices" can be a drawback instead of an advantage.
If you are working alone, in a small app with a handful of users, it is ok to commit directly into the main branch in your GitHub repo.
If your project is not database intensive, or only has to deal with very little data, you can use an embedded H2 database stored directly in your file system and it will work more than fine.
There are projects and teams where it makes sense to follow every single piece of advanced architecture and people management processes there are, but that's totally not the case for your startup of three people.
It is easy to be misled by reading about the latest tech and thinking "everybody is using this", when in fact they are not.
FOMO (Fear Of Missing Out) as a Developer is real and you should be aware of this.
Choose the right tech for the right context in a rational way.
Choose the right project methodology for the right context in a rational way.
You don't have to ditch Scrum in its entirety, you can adapt it and do only 2 of the meetings described instead of all of them.
You can spawn a cheap Linux VM and deploy your app by hand instead of spending hours setting up CI/CD for something you can do manually in 2 minutes.
If your app screen is a simple feature with one text field and a button (like Google's home page), React/Angular/Vue is an overkill.
Learn all of those things, read the books, but use your best judgment to adapt the "best practices" to take advantage of what makes sense to your project and team, and not just because someone else said you should use it.
You also can subscribe to my newsletter.
Latest comments (30)
Thanks for sharing your own thoughts not general opinion.... Source
Thats true, choose what suits your project
If the only reason you do branching and tests because of external factors and not because you know it's the only right thing to do, I dear hope I'm not trusting my information with any of your systems (one can hope)
It doesn't take long to setup branching and ci/cd pipelines, tdd helps you execute working code and not run your app to check IF your code is working.
There are no "best practices", only "good practices in context". Also, Clean Code and Clean Architecture, at least in the circles I travel, aren't considered "bibles". They have some good ideas, but those ideas (and more) are available from other sources.
I also learned XP before Scrum, and I too find the number of meetings onerous. That said, a core tenet of Scrum is "inspect and adapt"... if you're doing Scrum the same way a year after you started, then you aren't doing Scrum! š If the meetings aren't providing value, then seriously consider dropping them and finding a different way to accomplish the same goal.
And, related to XP, I don't use TDD all the time for all the things. I do write tests pretty much all the time, but especially when working with legacy code written without test, it can be difficult. When I'm working on fun stuff away from work like Raspberry Pi or Arduino, I often don't write tests at all, though I've been looking at changing that approach.
All that to say that, in the 40 years since I wrote my first line of code, I've realized that there are no absolutes in software development. What is considered a best practice today could be obsolete tomorrow.
I think the title is misleading here and is kinda a bad advice. Use best practices when they will help you and your team. Or sometimes best practice are part of the framework. Best practices exists for keeping our heads clean when it's the code that is scaling in size. You know where to find things and where to create them.
Just use your judgment when creating a project. Is it one that you just create to learn or one you intend on maintaining for years to come? Good practices help understanding and on-boarding as new developers can use their knowledge to understand the code. If reading code is like reading hieroglyphs everyone loses, even yourself months later when you come back to it.
Designing a system for 50 live users is not the same as for 1 million but using the proper foundation, the language and tooling, can save you lot of work later on. There's no best practice for this. Agile is also not a best practice. It's a tool for project management, you can use as you see fit.
The FOMO is mainly a Javascipt problem called Javascript fatigue. How many packages do you need to learn, install and keep updated? How long and often did you spend testing them making sure they do still work together so your project can run in prod?
If the software is mission critical or can cause serious damage to people it is good to learn and implement the so called ābest practicesā in order to avoid errors, overflow, human fails etc. On the opposite, everybody today wants software shipped as soon as possible, so, we have to balance the use of these ābest practicesā approaches with the delivery schedule.
While I understand the motivation of this article, I need to add a disclaimer:
Best practices have a context each.
By this means let's pick a piece of your example to see the reason behind "best practices":
āļø Sure you can "spawn" a cheap Linux VM, there's nothing wrong with that nor there's a "best practice" that tells you otherwise. It's perfect for any starting project and many start ups go this path at the beginning. You can even start with a shared hosting and promote it to VM as soon as you need it -unless you need configs or tools not covered in shared hosting plans-.
But the second part... ā
IRL you'll be wasting more than 2 minutes, because to set it up manually you'll probably need to -let's say- make a production build, pick any FTP tool, make the connection, then find the folder in both sides, push the build to your server, and finally test that it started correctly, let's say 5min at least (being quick).
Building a simple CI script will cost you like... 10 minutes? 15?
You'll amortize the time in just 3 deploys, at this point, from now on you'll be saving time.
The use-case for using CI Scripts instead manually updating your code as best practice not only covers this situation but also any step that you need to add in your pipeline.
Once it's written and tested, adding steps is just typing few characters in the CI script instead manually executing things in sequence.
Think on running some tests before the deploy;
If you do it manually, you'll probably be starring at your screen for some other minutes waiting for them to finish.
If you automate it instead, it's just a
yarn test &&ornpm test &&in the middle of your already existing CI script.Just try to understand at least the basics about what CI and CD are and how they work and apply what you need after analysing your project stage.
TL;DR: Not knowing how to discern which best practices can be applied to your project or to simplify those best practices and apply them to your current use case is something negative for both you and your code and probably for your career as developer as well as it implies that you don't understand those best practices nor the reasons behind them.
I agree, we should know why' we do things., and sometimes best practices are not the best practice. :)
But for beginners, I highly encourage them to follow best practices blindly to get used to them. Leave the exceptions to people that have the experience to know when they do not apply. :)
Great take! I was listening to someone recently as I was talking about what I read in "Clean Code". He's a senior engineer. He said "study the book, obsess over writing the cleanest code, then let it go. Realize it's just a tool to solve a problem. It is not the end all be all, that's for you to decide."
Best practices relate to a specific context, if that context doesn't really apply than maybe that best practice doesn't apply.