Fundamental Philosophies Of Programming: Series [EP 1]
I am sure it is very clear by now that the whole world is evolving drastically in tech, with every company embracing tech, the need for talent in this space also grows vastly hence we see a lot of people teaching themselves tech skills to get a job, even the number of new students in tech studies in higher education has grown.
While all this is great and exciting. it also means that as a lot of people are teaching themselves these skills there will be a lot of missed fundamentals that are very crucial in writing good code, especially writing code that is meant to be efficient and be used or read by others.
This series of mini blogs are inspired by solely that, in my minimal years of experience I've seen people write beautiful applications but when you take a look under the hood you get to be shocked by how messy* the code that powers all of that is.
I hope that by reading this article you gain something useful that you will apply in your daily development.
Plan For Success
Before going ahead and diving into these principles, I just want to mention that all these principles depend on you as an individual to make sure that you keep them and take them as an oath for developers, it is also your duty to ensure that your code is regularly reviewed by others to make sure that these principles are followed, whether you are in a team or not you still have to do this, at least this is what I believe.
In this way you would assert your success, it doesn't matter if you have years of experience developing systems, or if you are new to programming, these philosophies are part of communicating a solution that is written in code, so imagine you had to read someone's code and the codebase is either too complex or overly engineered, this makes it tough for you to extend on it or even understand it.
Understanding that all of the work we do as a team is shared, making communication the cornerstone of everything we do, is essential. During a product's development, a lot can go wrong, including anticipated and unanticipated modifications.
Following good practices when developing software systems is crucial because, in the majority of cases, the software is created by a developer, reviewed by someone else, and then managed by someone else. This makes it possible for others to easily understand your code, make changes, or fix unanticipated bugs.
While innovation and talent are promoted and valued, this guide in no way takes away the fun of solving problems in your unique way it is promoted that you always think outside of the box.
You can consider all the below as a part of a code of conduct, the list will keep growing as we progress but for now, we will focus on the below.
YAGNI & KISS - Simplicity is Key [EP 1]
DRY - Do Not Repeat Yourself [EP 2]
Coherence [EP 3]
Maintainance - [EP 4]
Analyses - [EP 5]
Agility - [EP 6]
Accuracy - [EP 7]
TDD - [EP 8]
YAGNI & KISS - Simplicity Is Key [EP 1]
The way an individual writes code tells a much bigger story about their approach to solving a problem and their way of thinking in general. The code we write is how we communicate a solution to a problem, but now imagine writing code that no one understands, then the solution will not be well communicated, this raises challenges when working with a team, no one will be able to easily maintain your code and teammates may not even buy into this solution as it is complicated to them.
The YAGNI concepts help us approach programming or solving problems with simplicity in mind, the philosophy behind says if “You Ain’t Gonna Need It”, then do not include it. This principle helps us to not have a redundant and over-complicated solution using technologies that can be avoided, just don’t over-engineer a solution, stick to the goal and only bring tools that solve that goal.
This idea of coding for an imaginary future use case, and inevitably the code will become dead code or need rewriting because the future use case always turns out to work slightly differently from how you imagined it. The same is true with commenting out code; no commented code should pass the development stage, and such should be mitigated during code reviews and code refactoring. This practice is also called agile programming (https://www.kentbeck.com/)
The KISS principle is basically "Keep it Simple, Stupid Silly" 🙃😅, kidding it is "Keep It Short and Simple"! As a programmer, it's easy to get caught up in complex code, but we often forget that the simplest solution is usually the best one. Just like the KISS principle, our code should be straightforward and easy to understand.
In fact, programming languages themselves follow the KISS principle. For example, Python's syntax is simple and clean, making it easy to learn and read. We don't need to make things complicated when solving a problem- simple is often the smart solution.
So, let's take the KISS approach in all aspects of our work. Whether it's in coding or in our writing, keeping it simple, silly, and straightforward can help us achieve our goals more efficiently. Don't overcomplicate things – keep it clear, concise, and easy to understand.
Are you tired of constantly trying to add features to your project that may or may not be necessary? As a programmer, it's important to remember the principle of YAGNI- "You Ain't Gonna Need It." This means not adding in any unnecessary features or functionality to your project, but instead focusing on what is essential.
Think about it- why spend time and resources creating something that may not even be used or needed? By following the YAGNI principle, you can streamline your development process and avoid any unnecessary complications.
As a programmer, it's important to stay focused on the end goal and not get sidetracked by any unnecessary additions. So next time you're tempted to add in that cool new feature, ask yourself - do you really need it? Practice the YAGNI principle and watch your productivity soar.
Kiss and YAGNI are two powerful concepts in the world of software development. KISS, or Keep It Simple, Stupid, reminds us to build software that is easy to understand and maintain. YAGNI or You Ain't Gonna Need It, reminds us not to add unnecessary features to our software, but to focus on what is truly important.
When it comes to software development, sometimes a simple kiss and a reminder of YAGNI is all you need to stay on the right track. Remember to keep your code simple, and focus on what is truly important. Don't get bogged down in unnecessary features and complexity. Keep it simple, and stay focused on your goals.
Stay Tuned for more on this series