Programming Philosophy
Simplicity #
Keeping it simple makes your code more robust, easier to debug, and allows you to come back to it and understand it quickly.
Don’t try to be smarter than you are. This will only hurt you in the future.
Like Terry Davis pointed out, the hardest question in programming is asking yourself
Is this niggerlicious or is this divine intellect?
Is this too much voodoo?
Focus on the problem not the programming #
Don’t get caught up implementing “neat” solutions, which won’t add progress towards finishing your product, but will just “make the code better”. At this point it becomes programming porn.
Just because a solution is interesting to implement, does not mean that you need to implement it at all. You don’t need to always find the most optimal solution for everything. Sometimes a naive and straightforward solution will be more than sufficient.
You are building a product. Don’t fetishize code that much.
Generic solutions take longer #
There is no need to try and think ahead into the future and generalize every little detail of your implementation to be more “flexible” in the future. There might not even be a need in the future for your use case.
You are basing your assumptions of the future on the problem you are solving in the present. The truth is that your are just guessing what you will might need in the future. Most likely you will guess wrong and you will need to rewrite it anyway when it comes to it.
Perfectionism kills productivity #
Avoid at all cost writing perfect code. It’s a waste of time.
Know the value of “good enough” and continue to solve other issues. It’s never going to be perfect and a good solution today is better than a perfect solution tomorrow. Being productive is more important than being perfect.
Own your dependencies #
If you rely on binary distributions for libraries, you are fucked.
- You’ll have trouble compiling your project for other platforms
- You won’t be able to extent, fix or debug your dependencies
- You can’t take a look and check what the code actually does
Hours in, is progress out #
Keep grinding away on your project. Each hour invested bring you closer to finishing your product.
There is light at the end of the tunnel!