At work, I found that many classmates did not pay enough attention to how to "improve their work efficiency".
For example, when a student logs in to the server, he always enters the password manually, which makes me anxious.
My point is that must find ways to improve their work efficiency in order to set aside more time for lazy sheep .
Today, on a whim, I sorted out some of my own experiences, and I hope to see you share your own experiences and learn from each other how to be more lazy.
dynamic programming
There are N items and a backpack of capacity V. The cost of the i-th item is c[i] and the value is w[i]. Find which items to put into the backpack maximize the sum of the values.
-- "Nine Lectures on Backpacks: 01 Backpacks"
Modify the title slightly:
- Change "Item" to "Task", "Cost" to "Time-consuming", and "Value" to "Performance"
- Change "backpack capacity" to "time"
——It is the problem that we need to solve in our daily work.
Time is always not enough, but by optimizing the allocation of time, students who like to roll can get better performance, and students who like to lie down can put sheep for longer.
Of course, there is a problem here, how to predict the time-consuming and performance of a task; for students with less work experience, it is recommended to ask the old fritters.
Fail Fast
Essentially, fail fast (a.k.a. fail early) is to code your software such that, when there is a problem, the software fails as soon as and as visibly as possible, rather than trying to proceed in a possibly unstable state.
When coding, the "Fail Fast" principle requires us to expose the problem as soon as possible, such as throwing an exception immediately, and the closer to the error scene, the more relevant information can be retained, thereby improving the efficiency of troubleshooting.
Unit testing is a typical application of the "Fail Fast" principle. There is this data from Microsoft in "Unit Testing - The Fun of "Simple" , which fully illustrates this point:
Average time to find bugs in different testing stages:
Unit testing phase, which takes an average of 3.25 hours
The integration testing phase took an average of 6.25 hours (+92%)
System testing phase, the average time is 11.5 hours (+254%)
Similarly, in daily work, if we can expose problems as early as possible, we can continue to trial and error with minimal cost, so as to better optimize the plan and achieve the goal faster.
DRY
Students who are pursuing their own code should understand the DRY principle: Don't Repeat Yourself.
Similarly, in day-to-day work, efforts should be made to avoid duplication of effort.
However, Only when you realize that you are doing "repetitive work" can you possibly look for a solution.
For example, the "hand input password" mentioned at the beginning has nothing to gain except to increase the typing speed. So when you find that you may need to execute multiple times, you should find a way to optimize it.
A simple solution is to use the ssh-copy-id command to establish a trust relationship, so as to achieve password-free login; in an environment where a trust relationship cannot be established (such as some springboard machines), you can also use expect to simulate input and free yourself.
Use good tools
If a worker wants to do a good job, he must first sharpen his tools.
——"The Analects of Confucius, Duke Ling of Wei"
Use the right tool and use it right.
As a heavy user of vim for fifteen years, I still sigh about the power of vim, and it is worthy of being called the "God of Editor". By flexibly combining various shortcut keys, vim users can move through the text like water, completely getting rid of the distant mouse and ↑ ↓ ← →; they can also replace repetitive work by various methods such as regular expressions, macros, and custom functions.
Imagine how mad I am when a classmate presses the i, →, and Backspace keys, just to delete a character under the current cursor (so I should not be suitable for O&M). Just press the x key next time.
For another example, I often need to type commands in the linux terminal at work. So things like <Ctrl+A>, <Ctrl+E>, <Ctrl+R>, <CTRL+]>, <Ctrl+W>, <Alt+F>, <Alt+B>, <Alt+.>, <Alt Shortcuts such as +Backspace> are the ones I use heavily. Unfortunately, many terminals (such as item2 under mac) do not open the alt key (ie the option key under mac) by default, and need to be opened manually.
In addition, a new artifact was discovered this year: copilot. Since installing it in IDEA / VSCode, a large part of the coding work has become code review, which deserves a special recommendation here.
As shown in the figure below, the red boxes are automatically generated by copilot, I only need to be responsible for pressing tab:
(There is a bug in it, did you find it?)
spend money on time
Paying for good products and services can save a lot of time.
As a 13-year-old SecureCRT user, I find its genuine license (99$) to be typical value for money. Its built-in Session Manager, zmodem (rz/sz), Logon Action/Script, Command Manager and other functions have significantly improved work efficiency.
Another example that is not entirely appropriate is that I always choose to live near the company and increase the rent cost by 1~2k. Compared with many other students, I can save 1~2 hours of commuting time per day. Although the time saved cannot be directly converted into wages, but you can lie down and live, a little more freedom, and a little more possibility.
receive
The above is relatively fragmented, but it is indeed an experience that I find very useful. I hope that in this tossing year of 2022, we can exchange strategic diligence for tactical laziness; further, we can use tactical diligence to exchange for more laziness.
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。