今日推荐开源项目:《条条大路通罗马 awesome-roadmaps》
今日推荐英文原文:《The KISS of Simplicity》
今日推荐开源项目:《条条大路通罗马 awesome-roadmaps》传送门:GitHub链接
推荐理由:一个关于各种学习路线图的合集。一个职业或者说一个技术方向里包含了各种不同的技术,而路线图就是指导初学者应当学习什么的方向标,尽管多学总不会有错,但是南辕北辙终究还是缺少效率的。路线图的作者们眼界更广,见到的东西更多,借助他们的知识来作为自己下一步的参考自然不是个坏事,如果对接下来要学习什么感到迷茫的话,兴许这些路线图会帮到你。
今日推荐英文原文:《The KISS of Simplicity》作者:Piotr Gaczkowski
原文链接:https://towardsdatascience.com/the-kiss-of-simplicity-b8153a69048e
推荐理由:简单比复杂更容易操纵,尽可能让成果变得简单些
The KISS of Simplicity
Do less but do it better
Imagine a man appearing at a formal ball. He is wearing a perfectly tailored suit, the jacket of which is bright pink with a red checkerboard pattern. His pants are green with purple vertical stripes. The suit is the creation of a renowned designer and it cost quite a bit. The man also has a gold chain around his neck and ruby rings on both hands. Behind him, however, is a woman wearing a black dress and no accessories save for a pair of pearl earrings. Think about the two guests for a moment.Which of the two would you consider elegant?
The IT industry knows the first type very well. The man in the suit is the equivalent of a system that cost a company millions. The system is made up of several components from different providers that often can’t communicate properly, and more often than not, freeze just at the moment you need to deliver an urgent message to your boss.
Elegance in Tech
Unix philosophy is closer to the lady in the black dress, with a focus on using tools or writing programs that do one thing but do it perfectly.When we ask Google the definition of “elegance.” it offers two.
- “the quality of being graceful and stylish in appearance or manner.”
- “the quality of being pleasingly ingenious and simple; neatness.”
“Elegance is beauty that shows unusual effectiveness and simplicity.”Why am I getting into elegance on a tech blog? Because it is we engineers who are to be blamed for over-complicated systems, a project going over budget, and the general ugliness (better known as “the technical debt”) that surrounds our work. Most of us know the KISS principle, but we often forget about it each time there is a need to implement just one more feature in our code.
Photo by Dan Gold on Unsplash
What Hinders Elegance?
Tight time constraints are the main killers of elegant solutions. Simple does not equal “quick” or “easy.” Usually, it is the opposite. Simple design requires careful thought and analysis of all expected use cases, to come up with an idea that is clear and concise.While you can build software without a proper design and without putting much thought into the scope of possible functions, maintaining that code will be a pain. Because each time there is a bug, it will most likely be caused by your lack of proper edge-case handling. And without a clear scope of what one function should or shouldn’t do, you’ll most likely end up adding a conditional clause somewhere in the code.
But after ten such cases, your code no longer looks like it did after the initial release. It’s now a soup of obscure conditionals and nobody knows what is the desired behavior of the application. Sometimes a change in something totally unrelated at first sight causes errors in a different subsystem. Everybody then scratches their heads and quietly reverts the last commit. Time for another approach.
Why Complex Is Easier to Implement
Elegant solutions require focus and observation. They require analysis, good communication with the client, and a well-thought scope. If you don’t have time to figure out all the possible input arguments or if you just can’t figure them out because you lack a proper design and the customer is unsure about how he will use the product, you end up skipping a few steps in the process of solving the problem.But there is also another source of complexity. And this one is much harder to overcome. It’s the abundance of ready-made components and abstractions waiting for you to use. Front-End development is especially vulnerable. Writing an appealing web application using plain HTML5, CSS and Javascript is not an easy task.
That’s why we decide to trust a third-party to implement all the nitty-gritty details so we can focus on the important matters. We choose a framework, look out for a few more modules, and end up with the infamous 3GB node_modules directory. All should be quite alright as long as the abstraction layers in those modules align with our way of using them. More often than not, there is something we can’t agree on with our framework so we end up writing a terrible workaround or a special case just to make it work.
I wish I could share a viable way to deal with leaky abstractions, but I can’t. I don’t have one! But I’m aware we can’t just stop using them. This would be a huge waste of resources.
Photo by John Barkiple on Unsplash
How to Keep it Simple
You write a mobile application? Instead of creating your own backend, use a Backend-as-a-Service such as Firebase.You want to host a landing page or a blog? Go with a static site generator (like Jekyll or Gatsby) and static file hosting (like Netlify).
You want a CMS with that? Check out Contentful or DatoCMS.
Tired of keeping track of SSL certificates for your web service? Go with an automated refresher like AWS ACM, Traefik, Caddy or Zombie Nginx.
Want your code to run “on demand” instead of paying fixed price of a VPC instance? Try a Function-as-a-Service (or Serverless) solution.
Oh, by the way, unless you have a very refined taste, it’s a good idea to use a managed database service like AWS RDS/Cloud SQL/Azure SQL.
To achieve simplicity is to reduce the number of components instead of accumulating them.
The Benefits of Keeping it Simple
More moving parts often mean more errors. In a classic blog engine example, you can expect at least the following problems:- Poor database performance.
- Poor blog engine performance (insufficient memory/CPU).
- Insufficient network throughput.
- Disk space running out.
- You overprovision for the most pessimistic use-case thus you overpay the rest of the time.
- Broken deployments.
- Database migration can run wild.
- The VPC may disappear without a trace along with backups.
下载开源日报APP:https://openingsource.org/2579/
加入我们:https://openingsource.org/about/join/
关注我们:https://openingsource.org/about/love/