When your program runs abnormally, do not use the debug tool.

Source: Internet
Author: User

I recently want to understand some things. Best writeProgramIs not in front of your computer, rather than using your compiler, IDE, or other tools. The best thing about this is a place to stay away from these tools-a place where you can think seriously. You are familiarProgramming LanguageIt is easy for you to convert a program that has been conceived in your mind into a program that can be compiled/interpreted by the compiler/interpreter-it is difficult to compile the program first in your mind.

One day I travel by train. I have a laptop but no network. Unfortunately, I am using a commercial programming language (IDL, unfortunately) that requires a license on my college website. Because I cannot connect to the Internet, and I cannot get a license, my compiler and IDE cannot run. You may like to use a commercial programming language that requires expensive licenses, but it does make me unable to write anything in the editorCode. And You guess so... This made me start thinking!

I think this blog confirms the content of a blog, which says:

One of the biggest lessons I learned from my first boss is: "When your program runs abnormally, do not use the debug tool or your brain ."

This is what will force you to do after you stay away from your computer. It is usually easy for you to enter such a programming habit:

 

Write some programs (messy)

Compile and run

Use simple test cases for testing

Problems Found

Slightly change the program, maybe it can solve this problem

Repeat...

Of course, this will cause the program to be messy and unreadable. It is very likely that there are many problems and there is no good test.

Keeping away from the computer forces you to think about all the problems in your brain-it may take longer to compile and run your program with your computer (at least for small programs). However, after doing so, you will not change the program at and try to run them over and over again. You are actually thinking about what the code is. On that day, before I got on the train, I never planned any program on paper.

Since then, I have worked hard to draw ideas on paper before writing a program, think about it, implement it with code step by step, and make high-quality, efficient, and non-problematic programs, finally, it runs on the compiler. The program is finally copied from the paper to the compiler.

The task is well completed-I think, I hope this is a useful suggestion.

Robin's blog

 

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.