Kevin Tran

Just A developer | About me

How to learn thing smarter by knowing architecture design

Sep 10, 2016

It’s been a while since my last post. I was busy learning so many stuffs that I can’t remember them all. Well, it means I am wasting my time. And not only me, it happens to all of us. We learn so many things that we don’t have a chance to use, then we forgot. I realize that finally, after spending too many time on these stuffs.

You may say, developers must learn new things continuously. It’s true, but don’t learn hard; learn smarter. We know that we’ll forget many things soon, so we need to choose thing to learn carefully. I know that we all start a new project by looking at which database fulfills business requirements, which css framework is suitable, which monitor tools should be used in this project, etc.

We spend a lot of time to study these tools to see which one is the most suitable. The problem is, these tools are all good, or are all bad, so it’s very difficult to pick the best. We start searching and reading many blog posts to see their opinions.

It happens very often for me. Although I already use a different tool, when I start a new project, I still want to research about others again thinking maybe they have already been updated.

I am following Uncle Bob Clean code series, and there is one video about architecture. While I was watching it, I was shocked. I thought architecture is about the stack that we are gonna use, all kind of tools like database, storage…, but actually, it isn’t.

According to Uncle Bob, these examples aren’t related to architecture. “A good architecture allows you to defer framework decisions. A good architecture allows frameworks to act as plugins to the app.” https://twitter.com/unclebobmartin/status/118403913937453056

He explained why sticking to a framework is a bad idea. The architecture of a software should isolate it from the framework as much as possible. The same thing with databases. He also introduced some better architecture models we should use.

I think it is a great thing to do or keep in mind. If our applications depend on specific tools or framework, which means we can’t change the framework later, and if we want to change, we need to spend a lot of time fixing the broken codes. Even when we tried to upgrade rails 3 -> 4, it’s so painful, many features were dropped, conventions were changed and so on. The cost is quite high. Sometimes people try to rewrite the app in newer version of framework or using different tools because they aren’t able to upgrade these tools and framework.

Maybe his idea about the new architecture is too ideal and a little bit paranoid, there is a good thing to keep in mind: everything will change, from framework, database, web server to monitor tools.

That is the idea about good architecture. We know that we’ll forget many things soon, so we need to choose thing to learn carefully.

Keep in mind that these decision can be deferred to later, we don’t need to decide right away. This helps us learn these tools in an easier way. No need to waste too much time on them, and no need to make the best stack ever.

For me, I stop learning deeply and stick to these tools. There is a website that shares the stack: http://stackshare.io/. We can search by companies name, then see how they use different technology in their projects, then decide. Again, these decisions don’t need to be made right away.

That is everything I want to share in this post. Remember that these tools will be replaced, or they will change very soon. The best tool you are using today may not fit tomorrow. Architecture design matters. If you design the system well, you can change the tool easily without breaking the system. You can use the time that you can save by not learning too much to learn how to design a better architecture. I believe that is the key to success in this area.