The furious path of efficient programmers

Source: Internet
Author: User
Tags ssh secure shell linux mint

Do not feel that has been working for six years, recall the first day of internship scene vividly, as if yesterday. Six years has been enough for many people to change management, transfer products, testing, career change, there must be someone still sticking to the code, only because of love. Have met a variety of managers, architects, operations, performance engineers, etc., or feel that the most powerful code-writing! Share some of the personal insights you've learned over the years. may not apply to other people, but for me is the most precious treasure. Also in this article to commemorate the youth spent in the code heap ~ see these little drops of harvest, you will feel all the lost time and the sweat is worth.

1. Start: Handy Tool 1.1 Almighty IDE

With regard to the IDE, I am currently using INTELLJ idea and sublime text to cope with the development of various languages.

When I first started Java in college, I used MyEclipse, and it was a natural transition to more flexible eclipse in the early days of my career. But two years ago, after constant trial and discard, I finally managed to switch from eclipse to the IntelliJ idea camp. After that, not only heavy use of IntelliJ, but also a short trial of JetBrains's various products, phpstorm,pycharm,rubymine including the latest clion. Google also chose IntelliJ as the foundation for its Android studio. as a Java developer, of course, the most beloved or IntelliJ, its intelligence is too shocking! It is strongly recommended that the students who are still waiting to see the official web site to introduce its various operation of the small map.

As if it were easy, intellj idea became my choice for Java development. However, for other languages, especially in C + +, the right IDE has not been found. From vim+ various plugins to the IDE to Emacs to Visual Studio and Codeblocks, there was no satisfaction until I met Sublime Text. Now it is not only my IDE for all languages except Java, but also my blog authoring tools and code base, which you will see in the 3.2 codebase section later. See "Sublime Text 3 under the C + + development environment building."

1.2 UML and Design

There are many good software in the field of UML, such as Rose, EA, mostly commercial payment software. In open source free software, staruml is quite good, 2.0 version compared to 1.0 made a lot of improvements, especially the overall appearance is much more beautiful. Complementing other UML-like diagrams, such as business swimlane maps, flowcharts, topology diagrams, er diagrams, and more, with Visio and power designer, can almost meet most everyday needs.

1.3 Shell

It is unavoidable to use the Unix/linux command or to connect directly to a remote server to do some work. The emulation of the Unix/linux command on Windows, of course, is to use Cygwin, and using those useful UNIX commands on Windows can greatly improve efficiency, especially if you often need to work with text. SSH client generally use SSH Secure shell or Xshell, the former is relatively simple, the latter is more powerful but the file transfer function to install another software xftp.

Of course, if the direct use of Linux as a personal desktop is the best, the development on Linux and on Windows is not only a tool more handy, is simply a drastic change in the way of thinking! See "Linux Mint 171 Week Experience".

1.4 Virtual Environments

VirtualBox is a nice little fast virtual machine software, VMware may be more powerful, but some are too heavy. Use VirtualBox to install some common operating system and software, as well as test environment and test data, and then make a snapshot for reuse later, you can save a lot of trouble to do the environment. And how to toss in a virtual machine, reducing the risk of using a physical machine. In this regard, the current comer should be Docker bar, the benefit of the vast number of developers. Because I haven't studied it yet, I'm not going to comment.

2. Acceleration: Simple and effective methodology 2.1 think before you begin

As a programmer, the impulse to encode immediately after getting the task is normal, but in order to reduce the detours, we have to restrain the impulse. Large to large-scale product and project development, as small as an algorithm to achieve, all without prior design and thinking. Large projects to do high-level architecture design, early identification of those "pits", can effectively reduce risk, avoid rework. Small algorithm to prove its correctness, to avoid some logical thinking on the loopholes. For the correctness of a piece of code, see the Programmer's Path to Practice-(1) Basic (bottom): proof of correctness.

The degree of thinking must also grasp a "degree", or there may be "over-design" problem . This "degree" feeling is difficult to grasp, can only rely on time and experience to develop judgment and intuition, a little bit to learn to evaluate which design is now time-consuming should be put, which design now do not bother but if not to change it is time-consuming.

2.2 Concise Code

When it comes to brevity and cleanliness, I have to mention some of the great effects of classic books on me. In the university to start the "code Complete" (Codes, listen to this dog blood in the translation really thought is a variety of code encyclopedia), very fortunate to be able to see this book before the formal entry, it let me take a lot of detours, and even formed some code "neat", sometimes even a class name to want half a day, But time proves that everything is worth it.

Then I saw "clean code", which not only tells you all the tricks of the code, but also writes down the code to the height of the career manifesto. For details, see the "Code neat Way" reading notes.

The concluding paragraph in clean Code is impressive and memorable:
"In 2005, Elisabeth handed me a green wristband with the words test obsessed addicted to testing, and I was happy to be on the strip. I found myself unable to remove the wristband, not only because the wrist strap was tight, but also because it was a spiritual magic spell. That wristband is a statement of my professional ethics and a reminder that I am committed to doing my best to write my own code. When I write code, I use my peripheral vision to see it. It kept reminding me that I had made a promise to write neat code . ”

2.3 Refactoring

Although individuals do not have in-depth contact with agile development, but imperceptible in the exposure to a lot of agile development of good ideas and methods, such as the next to say refactoring.

There are many techniques for refactoring, and we may have used them unconsciously. From the simplest renaming, member variable extraction, to class extraction, inheritance hierarchy up and down move, and so on. MF's "Refactoring: improving the design of existing code" with Houtie translation is very classic! Once again, IntelliJ idea is highly recommended because its refactoring capabilities are so powerful that it can save a lot of time and greatly improve our development efficiency.

2.4 Unit Test and TDD

The methods and techniques of test-driven development (TDD) are simple, and there are many benefits to be followed. First, for very complex functions can realize the simplest function, and then gradually improve, and second, with the unit test, you can directly find the corresponding problem code through the failure of the use case, the third is through TDD constantly iterative code, design more reasonable, later easier to maintain. Any technology will inevitably have two sides, TDD is no exception, see "TDD practice sentiment".

For other tests, such as integration testing, using Selenium can also automate testing. A recorded test script can be played automatically, and the mouse keyboard is like "unmanned autopilot".

2.5 Continuous Integration

Continuous Integration (CI) is known as the heartbeat of the project . Good use of the words, not only to unify the pace of development, integration of a variety of useful plug-ins, such as Jcoverage, FindBugs, Checkstyle and various packaging deployment scripts, can effectively improve code quality and development testing speed. CI with the UAT environment can allow customers to see the current product as soon as they want to look like, to avoid the later the more difficult to modify, early exposure problems. The most popular open source CI server in the Java world should be Jenkins, reference to "Jenkins Continuous Integration Environment building".

2.6 Code Review

While TDD and CI can automate part of the work to help us improve code quality and development efficiency, manual code reviews are not. Self-examination, mutual search, together, like pairing programming, this is like a master "learn" good chance!

2.7 Domain Models

The value of a set of accurate and stable model layers is incalculable, which can be very useful for current business code and future upgrade releases. This is also the "battlefield" of methodologies such as object-oriented Analysis design (OOAD), domain-driven design (DDD). Although there is not much practical experience on DDD, it is recommended not to accept the whole thing, but to draw the best ideas from it. DDD Sample application is a good learning material to get started. In addition, the domain language (DSL) with domain model customization is also a trend that deserves attention.

3. pressurization: Continuous knowledge accumulation 3.1 knowledge system

The first two sections have introduced tools and methodologies that allow us to quickly accelerate to hundred kilometres. However, most of this knowledge can be obtained from the Internet. Like a tool who can install, unless you have a "private" plug-in, like the methodology also has a lot of books to learn. If you want to 200 miles, only thick thin hair, forming a personal style and routines. Therefore, must have their own long-term plan, and firmly implement, after all, slow work out deliberately. This is my long-term plan, "the path of Programmer's cultivation":

    • Computer Mathematics : Discrete Mathematics and concrete mathematics.
    • Algorithmic Analysis Design : Common design techniques and data structures.
    • System Platform : Architecture, operating system, network, compiling principle and database.
    • Code Design : Architecture design, design pattern, methodology.
    • Code Implementation : Development tools and mainstream programming languages.
    • Test Validation : unit testing, performance testing, and optimization.
3.2 Codebase

legend has it that every master has its own set of code libraries . In order to become a master, I also continue to accumulate their own code base. My codebase comes mainly from working on project practice and programming exercises for business hours. For the two most common development tools, my codebase is divided into two parts: Java code and LINUXC system programming code.

First look at my personal Java library orchestration, after several modifications to the following structure: CS algorithm/compiler principle and other computer Science Foundation, Java Basic API, framework mainstream framework, mobile mobile development, Bigdata Big Data hadoop/cache/machine learning, etc. UI user interface, architecture architecture design, Project amateur and open source program code, verification test validation code, and more. The most comfortable maven is used for dependency management.

"target|*.iml|pom.xml"1 codebase/codebase/|-- 01-cs|-- 02-java|-- 03-framework|-- 04-mobile|-- 05-bigdata|-- 06-ui|-- 07-architecture|-- 08-project|-- 09-verification|-- autobak.sh`-- README.md

At present, I use sublime text to manage a variety of knowledge and code outside of the Java domain, whose choreography is divided into the following systems: assembly language, C language (Foundation, algorithm, System, practice, open source software), scripts (batch processing, shell scripts, cheatsheet), Other languages ( Golang and Python, etc.).

$ Tree -L 2 SyspaceSyspace|-- 1-Assembly|-- 2-Ccpp|   |--  +-Basic|   |--  A-algorithm|   |--  at-system|   |--  --Pragmatic|   `--  --opensource|-- 3-Batch|   |--  to-Bat|   |--  +-Shell|   `--  --Cheatsheet|-- 4-Lang|   |--  A-Golang|   |--  the-python|   `--  +-PHP|-- Autobak.SH`-- Index.MD

In addition, not only to organize their own code, but also to collect some small and lean open source software to learn, such as through the Nginx Code Learning Network programming, through the Redis Learning C language and data structure, through the Lua Learning compiler interpretation principle, through libevent learning concurrent programming.

Linus said: RTFSC (Read the f***ing Source Code). Internship in OPENJPA source search, because can not find a function of extension point and changed the source and replace the jar bag, finally really good. Then it went out of hand, immersed in the spring source of the sea. Sometimes Yimapingchuan, from top to bottom, such as OSGi has an open-source small kernel Felix. Sometimes it will hit the wall and halfway, remember to see Derby, always see the storage layer, remember as if using Antrl generated SQL interpreter, because the skill is not enough and stranded. Now, regardless of C, Java or other mainstream programming language open source code, can not say effortlessly, but very quickly can see a general process, have to say is also the result of constant reading. In a word, reading the great source of the harvest is not in the language to describe.

3.3 Cheatsheet

Cheatsheet small copy, that is, some from the daily routine operation of the Quick check table, mainly by the common Configuration, command, shortcut keys and so on. I am currently divided into databases, Ides, various languages, middleware, operating systems and so on. Online There are some ready-made online cheatsheet, but it is more familiar with their own collation. It also helps me save a lot of repetitive query work and valuable time in the actual work.

$ Tree  --cheatsheet/ --cheatsheet/|-- DB|-- IDE|-- Lang|-- Midware|-- OS`-- Revctl

On this part, everyone may have saved some useful little scripts. However, it is important to note that some of the work is inappropriate or not worth using for scripting automation. "Effective programmers," said: "Do not let the efforts of automation into cutting yak hair." Cutting yak hair is a very dangerous thing, it will eat you a lot of time, get is just a not practical, only a few times or a large hidden script tool.

3.4 Scaffolding

Scaffolding (Scaffold) is a good thing, it helps us to automatically generate the "skeleton" of the code. Then we use the accumulation of our code base to fine-tune the skeleton, adding functionality on top of it to quickly form an available application. The archetype plugin provided by Maven is a good scaffold, and many projects are based on it providing code templates. Of course, if you want to customize your own template is also very simple, specific reference to the MAVEN prototype skeleton and frequently asked questions.

In addition to MAVEN's build tool, the IDE typically provides a variety of small scaffolding to generate small pieces of code. The most common is the IDE's code templates and completion functions, if you feel that you can write your own templates and IDE extension, just like the rubymine of rails scaffolding support. See "Intellij Idea Plugin Development Primer" for details.

3.5 Blog

The role of blogging can not be underestimated! Did not have to summarize the knowledge that is only other people's knowledge, has not done the reading note book soon later became to have not read the same. When you meet the summary of the knowledge, search your blog will give you the fastest answer. do not think this is the same as Google search, over and over to look at your own intentions to write things and look at other people's things is a completely different concept! and the Chinese technical article has too many shoddy content, messy typesetting and countless non-annotated source of the forwarding. So after reading a chapter of the book or after doing any useful exercises, be sure to summarize the strike!

So what do you write with? Previously tried the Orgmode under Emacs, before touching the light-weight markup language, with Emcas feel quite amazing! Later met Sublime after Ligatures blog has moved to it above, because its markdown plug-in is too easy to use. See "Markdown Grammar and Sublimetext use skills".

3.6 Multi-element

As the code is written for a long time and more insight, the means to solve the problem will be diversified. What kind of programming language is suitable for what kind of project, what kind of architecture design is suitable for what kind of scene. The diversification of programming languages, the diversification of architecture design and the diversification of development tools will ultimately lead to the diversification of our thinking in solving real problems. ThoughtWorks maintains a technical radar that regularly updates technical trends in technology, platforms, tools, and more.

4. Rage: Focus and anti-jamming

In spite of all the above assistance, it is in vain to encode everything in a quiet mind. Either look here to see where it is, or be distracted in a noisy environment. Despite the inconspicuous, this is the "last mile" to improve efficiency.

4.1 Distraction Free Mode

The various Ides generally offer full-screen mode, like the sublime text, which provides an additional "distraction free mode" anti-jamming mode, allowing you to focus on an open file editing work.

4.2 Virtual Desktops

As with the Linux desktop version, many Linux distributions offer 4 separate desktop workspaces. A workspace can be used for communication, such as sending and receiving mail, instant messaging, etc., where a workspace is used to access a remote server or FTP environment, while a workspace is focused on encoding undisturbed. Windows is also like Dexpot to implement virtual desktop software, may wish to try.

4.3 Blind hitting and typing speed

In general, we often chat online, typing speed should not be a problem. But in addition to blind dozen 26 letters, like commonly used punctuation marks, such as semicolons, numbers 1-3 and 8-0, function keys F1 and F2, Ctrl/alt/shift and so on best can also be familiar with its position, so that can be quick to knock up like the wind.

In addition, no matter what the IDE and tools, master shortcut keys, let the hands left on the keyboard out of the mouse is the basic skills. Otherwise, fast as the wind of the blind beat speed is not. Please refer to the "Ten IntelliJ Idea shortcuts" for the introduction of the keyboard shortcuts I use most often. In this part of the accumulation, don't forget to save to your own cheatsheet.

4.4 Music

about why programming to listen to music there are a lot of research, but also very interesting, that is not only anti-jamming can also promote excitement. The Almighty knows that there is really this problem, and a recommended list, see what is suitable for programming when listening to music? There's even a dedicated website http://musicforprogramming.net/. This is different from individual, I am more accustomed to this "anti-noise" way, recently listened to just read the two seasons of "Silicon Valley" OST.

4.5 Bread crumbs

Of course, being disturbed and interrupted by others is unavoidable. Before leaving the job at hand, you must leave some clues, such as the key point, where to think about, and this is "bread crumbs." This allows you to resume "live" a little faster, just like the context switch of a process.

5. Efficient programming = tool + Method + system + Focus

Based on personal experience, we have shared some personal insights to improve programming efficiency. Everyone's experience is different, I believe everyone has a list of their own in mind. But the most important thing is to stick to your input, practice, practice, practice, practice ...

Here's a quote from the recently seen self-encouragement from Bruce Lee Lee:

"I fear not that man had practiced kicks once, but I fear the man who had practiced one kick the times."
I'm not afraid to practice all 10,000 kinds of kicks, but I'm afraid to practice 10,000 times with a kick method.

"There is many paths you can follow to reach your destination. However, you'll never reach the end if you keep changing paths along the "."
There are many ways to reach your destination. But if you continue to change course along the way, you will never reach the end.

Li Huilai in "time as a friend" once said: "All the success of learning, only two things: strategy and perseverance, and adhere to itself should be one of the most important strategy ." "Stones, Wearsaway. Do not be afraid of detours, as long as the focus on the walk will be bound to the end! Bless everyone can reach the other side of the dream, to become the most powerful in their hearts that person!

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

The furious path of efficient programmers

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.