Hello everyone, I am Han Cao 😈, a grass code ape 🐒. Intermittent warm blood 🔥, continuous sand sculpture 🌟 if you like my article, you can pay attention to ➕ like, and grow with me ~

Small knowledge, big challenge! This paper is participating in theEssentials for programmers”Creative activities

preface

In the design phase of development, I often like to make a component too complex:

At this time, my leader and I proposed a principle: KISS principle, which briefly introduced to us. Roughly speaking, it meant that we should design components more simply, and also showed our understanding of my young idea, showing the kind eyes of the elders to the younger generation.

Therefore, I decided to learn what the KISS principle is, which resulted in this article.

KISS principle

concept

When I searched for the KISS principle, there were conflicting opinions about its origins:

  • Film Theory by David Mamet
  • Kelly, skunk Works, Roxy, USA. Kelly Johnson
  • Software development for the U.S. Military

But this is not important, the important thing is to understand its spiritual core.

KISS is an acronym for Keep it Simple and Stupid.

The following content is from Baidu Baike

The KISS principle states that the design of a product is as simple as possible, and any unnecessary complexity should be avoided. The perfect example of this is the point-and-shoot camera, which is so simple that even a fool can seem to use it to take accurately exposed, sharp pictures.

KISS is a descriptive principle that recognizes two things:

  • People usually like simple things that are easy to learn and use.
  • Companies that manufacture products or provide services will find that simplicity has an advantage for the company as it reduces time and costs.

While it may take longer and cost more for companies to design where they try to use this principle from the user’s perspective, the practical effect will be very beneficial because in the long run, a product or service that is easy to learn and use will cost much less to produce and service in the future.

Applications in various fields

The following content is from Baidu Baike

Advertising design

Advertising ideas must be simple, pure and simple, to the point, to make people remember, impressive.

“It’s not enough to be new and different when it comes to creative expression,” says Advertising guru Bern Barker. Outstanding advertising is neither exaggerated, nor pretentious, but to try your best to make the advertising information simple, clear, dramatic, so that it leaves a deep and indelible memory in the minds of consumers. If too much pursuit of creative performance of the plot, advertising information is bound to be ambiguous, making people unintelligible.

The enterprise management

  • Simpler systems are easier to build, run, and maintain;
  • Simpler solutions are always more flexible and flexible;
  • Simpler systems are cheaper;
  • Simpler systems are more likely to be implemented faster, with faster returns;
  • Simpler methods are preferred by users;
  • Simpler systems are easier to implement in phases;
  • Simpler systems are easier for users to understand.

Management by objectives

  • Make it simple enough for a fool to understand
  • Good goals are not as complex as possible, but as simple as possible
  • Goals that conform to KISS principles are critical, not all-encompassing
  • Goals must be prioritized, and key goals are the focus of resources and effort

Web design

  • The web page should not take more than 10 seconds to download
  • Use text links to minimize the use of large images and animations (Cold grass can not understand)
  • The operation design should be as simple as possible, and there are clear operation tips
  • All content and services on the site are clearly explained to users

The product design

KISS principle is one of the most important design principles and ideas in DFMA, which almost runs through every DESIGN guide of DFMA. Reducing the number of parts is the main embodiment of KISS principle in DFMA.

Generally speaking, the more parts in the product, the more complex and difficult the product manufacturing and assembly, the higher the product manufacturing cost and assembly cost, the longer the product development cycle, and the higher the possibility of product manufacturing and assembly quality problems. On the premise of ensuring product function and quality, simplified design and fewer parts can reduce product cost, shorten product development cycle and improve product development quality. The KISS principle can also be applied when high-level mechanical engineers design complex things very simply, while low-level mechanical engineers design simple things very complicated.

For mechanical engineers, reducing the number of parts and simplifying product design can greatly reduce the workload. The tasks of a part in its development cycle include part design, two-dimensional engineering drawing generation, sample making, part trial production, part assembly, part quality and function verification, etc., all of which are onerous tasks. Reducing the number of parts and simplifying product design is a tangible benefit to engineers, who can spend more time and energy on improving product design quality.

Application of KISS principle in programming

KISS: 60 years ago, the PROGRAMMING principles of the United States Military

The problem with software engineers and developers today is that they slowly complicate things. When a developer has a problem, break it down into manageable pieces and start coding.

You need to figure out how to solve the problem in several steps before you start coding. Instead of taking a requirement and writing code to meet it. The advantage of this is that your code will be easy to understand and clear enough.

What can be gained by applying the KISS principle?

  • You can solve more problems better.
  • You’ll be able to solve complex problems with very few lines of code.
  • You’ll be able to produce high-quality code.
  • You’ll be able to build larger and more maintainable systems.
  • As new requirements come in, your code will be more flexible and easy to extend, modify, and refactor.
  • You will accomplish more than you ever thought possible.
  • You’ll be able to work on a large development team and a large project because all the code is stupid Simple.

How do I apply the KISS principle to my work? There are a few simple steps to take, but there are challenges. As simple as it sounds, keep it simple, mainly requires patience and more on your own.

  • Be humble and don’t think of yourself as a genius. Only by being humble can you truly reach the level of super genius. Your code is stupid simple, so you don’t need to be a genius!
  • Break your task down into 4-12 hour sub-tasks.
  • Break your problem into smaller pieces. Each problem is solved with one or a few classes.
  • Keep your methods small, never more than 30-40 lines of code per method. Each method should only deal with one small problem and not too many uses cases. If you have multiple branches in your method, try breaking them up into smaller methods. This is not only easier to read and maintain, but also faster to find bugs. Slowly you will learn to love.
  • Keep your class small, too. The principle is the same as above.
  • Solve the problem first, then start coding. Don’t code and solve problems at the same time. There’s nothing wrong with that, but it’s probably better to have the ability to cut things into smaller chunks ahead of time and start coding. But don’t be afraid to refactor your code over and over again. In addition, the number of lines is not a measure of quality, just a basic ruler.
  • Don’t be afraid to kill code. Refactoring and redoing are two very important areas. If you follow the advice above, the amount of rewritten code will be minimized, and if you don’t, the code will most likely be rewritten.
  • In any other scenario, try to make it as simple as possible. Simple is the hardest part, but once you have it, you’ll look back and say, that was shit.

Many great problem Solvers weren’t great programmers, but they produced great code! Programming is about solving problems, we’re not just programmers, we’re not just producing code, let’s grow into great problem solvers.

Thoughts on the KISS principle

I am also a learner of this principle, and since I used to like to add a bit of work to complicate the components, I can’t say THAT I am completely ignorant of this principle, just that I am nothing. But by learning the concept, I also get some insights of my own.

I tried to think about whether some of the classic examples were successful because of their simple design, such as:

  • Apple products and operating systems
  • Brain Kim’s AD
  • .

It may be that they are all in line with this principle, which makes them have unprecedented influence. However, it is also a big problem for me to make good use of KISS principle in my work. I think of the following aspects:

  • Preparation before development
  • Component responsibility design
  • The working process

Specifically, in combination with those above, FROM now on I’ll probably try not to be keen on a powerful component or class that can do more, but to decouple and unbundle capabilities to make them easier to use and clearer in responsibilities.

I wonder if I need to give an example:

Earlier in the chat, I mentioned that one such requirement, such as a form component, might be used by the editor and addler components, but the viewer might also need to display information.

I suggested: “Add a view type to the form component. When the form type is View, add a CSS, remove the border of the form item and readonly it.”

Sounds like a weird idea

However, now that viewing information is not a form capability, I will now add an xxxLayout component.

conclusion

The front end is not just technology, but ideas and principles are also soft power. This time, I don’t want to talk about the end of the speech, but I want to ask for attention directly, like, like attention is the biggest support for me. If you have any questions or different opinions, please leave a comment at ✨

Information:

  • Baidu encyclopedia
  • Every programmer should know:KISS: Us military programming 60 years agoThe principle of

Add our wechat: Hancao97, invite you to join the group, learn the front end of communication together, and become a better engineer ~ (because the group number is more than 200, can not scan code into the group, can only add wechat ha)