30 Responses to a bug when the programmer encounters it

Source: Internet
Author: User

Developing applications is a very stressful job. No one is perfect, so in this industry, bugs in the code are quite common. In the face of bugs, some programmers will be angry, frustrated, distracted, and even discouraged, while others will remain calm. Therefore, how to deal with fixing bugs is also worth pondering.
I want to share some of the ideas that programmers experience when they fix their source code. This is the easy humor that triggers when things get tense. Generally speaking, the application will eventually work, and then you can go to the next great task.
I believe that a lot of web developers and software engineers have experienced these hardships and then laughed afterwards.

1. "I don't know if I want to delete or rewrite it."

Looking back at the old source code, there will be an impulse and temptation to rework it into a larger block of clusters. Ugly logic statements, and lengthy syntax, make the code very difficult to read! But then again, if the code is not broken, then don't fix it. This battle of the raging worship is what I often have to face, and obviously it bothers many software developers.

2. "I should check GitHub for the starter frame"

I think most developers know about GitHub, which has a staggering number of open source projects published every day. Programmers in any language can use the Internet to draw on existing projects, join Wiki discussions, or create their own code repositories. It is a great resource for plugins and templates required for various projects.

3. "Why does this script require so many libraries?" ”

Especially in some of the more popular languages, such as Java and Objective-c, the number of libraries can become unusually ferocious. When building a framework that requires a lot of foundation, the number of libraries required becomes much more obvious. Even some plugins for JavaScript will require countless additional files. Sometimes, it makes people feel chores annoying--but at least it's useful!

4. "There must have been a solution somewhere on the Internet. ”

My first response to the thorny problem was to surf the internet. The programmer will post the issues they encounter through the post to the forum, then the problem is finally resolved and archived. Google search problem keyword good helper, you can guide you to the right direction of discussion. Unfortunately, there are times when there is too much information on hand that doesn't have a specific problem to find North.

5. "Is there a plugin for this feature?" ”

Why reinvent the wheel? Plugins are great resources for extending the user interface of any program or website. In addition, they provide some customization and unique options for developers. In case there is no plug-in really available, there is nothing to build one yourself?

6. "Although the website can work, but I am afraid of IE browser. ”

The history of rendering Web pages in Internet Explorer is a testament to the hardships that we have witnessed or experienced. Upgrading from version 5.5 to Ie9-ie10 always requires the support of a more advanced browser. Web developers may be afraid to debug Web pages because opening a page in IE6 is a rendering nightmare. Thankfully, such days are slowly becoming the past.

7. "This does not seem logical in terms of logical expressions. ”

For If/else loops, for loops, while loops, do loops, and so on, there are logical expressions. As I explore the sample code, I try to point out how my logic works. The NOT operator and the number of comparison tokens are so many. I often go back and update my own logic to make it better suited to future practice.

8. "I write the function in 30 minutes and spend 2 hours making it work." ”

Isn't it like our own programming story? You are happily building something, but suddenly, the function outputs a fatal error. So now you have to go back and delete some blocks of code to find out the line number where the error occurred. When you finally find the culprit, and solve it, although a feeling of exhaustion, but also filled with comfort.

9. "After reading a number of blog posts, I realized that I was all wrong before," he wrote. ”

I often start with my own programming ideas and go into the research, but this can lead to trouble if things are not as smooth as originally thought. There have been many times when I started a project and got into trouble, and then had to seek support from blogs and other papers. Then I found out my whole method was actually wrong, and it was easier to start over! If I could do some research first, I would save time in the long run.

"The kind people on the Stack overflow may be willing to help me." ”

I can't count how many times I've solved the problem through stack overflow. The community is a kind and intelligent person who is very willing to help if you take the first step. In all online forums, Stack overflow is definitely the most widely supported network for software programming and front-end/back-end Web development.

11. "It took a lot of effort to figure out the problem because of the lack of a closing parenthesis. ”

Debugging is the step you have to take. Two steps, one step back. Staring at the code for several hours, think of the function name or variable scope where there is wrong, and finally found that is missing a parenthesis, this taste, acid cool not to. All this time is wasted by a small grammatical error.

2. "Have a cup of coffee and have a rest!" ”

Sometimes, you just need to stand up and stay away from the monitor. Hover your mouse over the keyboard for a few hours to help break the routine. Most health guides will advise us to take a break every 30-60 minutes. But it all depends on your needs, so don't interrupt if you feel more annoyed with the rest of the program.

3. "I should put the project on the shelf and deal with it later." ”

Another option for rest is to leave your project, not just away from your computer. If you have other work to do, you might want to do other work. It would be better to allocate time and resources than it would have taken for 5 hours to solve the problem.

14. "I wonder if classical music can inspire my ability to program. ”

It is said that classical music can promote the growth of plants in the early stages of life. I personally enjoy listening to classical music when writing complex notes. Jazz, piano, big orchestra, and elegant music have a place in human culture all over the world. So is it really possible for you to debug smarter when you're programming and listening to the music? Probably not, but hopefully it won't make you any more awkward.

15. "Drinking a bit of a bar may now be a good time to test the theory of Bauer's peak." ”

Many readers have heard of Ballmer's peak theory, according to a special xkcd comic. To put it simply, the theory is that the programmer's coding ability reaches a peak after drinking a certain amount of wine. The author's name is Steve Ballmer, and his antics, like a drunken man, are ironic because Mr. Ballmer has never been a real programmer at Microsoft. Maybe we need to wait for someone else to prove the theory.

16. "Did someone move my source code?" ”

This may sound paranoid and paranoid, but sometimes you will be tempted to wonder if someone has written this thing in your sleep. Reviewing the projects you've done over the past weeks or months will keep your heart sinking. Sometimes you'll find something you don't remember adding-even if you've just browsed this project in the last week! I'm crazy about the code, but you never know ...

17. "I don't know what this means. ”

The worst thing you can do is that you don't know exactly what to do with the source code you're browsing. It may be your own project or someone else's project, but the root cause of the problem is the same. Now you have to decide if it's worth spending more time searching for alternatives, or checking the script carefully to see how it works.

18. "I need a Google error message. ”

After working in PHP for years, I had to say that Google was the best friend I had when debugging a problem. This is true with Objective-c, C + +, Java, Python, and other major languages. The error message is very helpful, but unless you remember what different code means, it reads more like a translated computer language. Thankfully, there's a lot of online support that can help us determine what these error messages really mean.

19. "I should stop and finish ... But I really want to deal with it! ”

We all have a feeling of extreme frustration, want to give up, but always feel that the halfway is not the right choice. As a result, you continue to delve into and try out new solutions to debug. But what if it means another one hours of waste? I am not unfamiliar with such a situation, it is very frustrating.

20. "Oh, my God, why didn't I write some notes before?" ”

When it comes to comparing the underlying front-end html/css/js, we don't need to write a comment. But more complex scripts and programs need to be organized in some form, and you need to look back a few months later, or even a few years later. Sometimes you forget to annotate functions and their parameters, output formats, and other necessary data. This will undoubtedly lead to confusion over time, and when the bug begins to appear, you must debug the entire script to find the solution. Therefore, there are some helpful comments that will benefit you a lot.

21. "It can work more than 20 minutes ago ..."

Perhaps the most frustrating part of building a program is that it works from work to not working--and you don't update any parts of the code! I swear it's true. And it doesn't make any sense-maybe other programs are running the cached version? Many times you have updated a tiny number of code, but caused the entire program crash error, completely stopped working. Revert to the most recently available copy file, and then step forward from there.

22. "Just forgot a semicolon, but the whole program collapsed." ”

Almost all programming languages I use require a terminator. Although not all languages are available, they are common in C/s + +. Forgetting to add a terminator is just an obvious mistake! But the parser does not know this, it throws a fatal error. So you have to spend an extra 20 minutes searching for a technical glitch, but only 1 seconds to fill in the missing semicolon. Well, that's the fun of debugging software.

23. "I don't know how much it costs to get someone to fix my code?" ”

The idea of hiring another developer is tempting, but obviously not financially feasible. And how can you learn something from these mistakes if you don't experience them firsthand? When you finally understand a programming concept after a lot of failures, it feels really good. Still, there is a punch in my head that "let someone else fix the code."

24. "A quick tour of hackers news can improve my productivity. ”

Many programmers like to read, there are social news about software and startups, the choice is hackers news front page. It has a lot of information about freelancing, time management, software development, and launch and financing of startups. Although HN can make you feel more productive by self-education, it also wastes your time. It's not that bad to get a quick tour of hackers news every few hours.

25. "How does this API have no documentation?! ”

The most frustrating thing about using plugins or frameworks with bad documents is that you have to delve into the source code on your own. I like developers taking the time to specifically design projects that are available on document pages. All parameters and options are explained clearly and may even be used in some sample code snippets. But sadly, that is not always the case. So the simplest way is to stay away from bad documents and not trouble yourself.

26. "I wish I had saved a backup copy of that database ..."

I don't think about backing up when writing and debugging code. However, data backup provides stepping stones that allow us to go back and modify. This is especially useful in a real-time server environment, where changes are performed immediately. Just in case, we should remember to save the local copy of the website file and database! While this can be an annoying task, it is far less annoying than rebuilding a corrupted SQL database.

27. "What is the quickest solution to make it work?" ”

After spending hours trying to think about a custom solution, it's clear that you need a new approach. Before designing a nice interface, the programmer took the lead in thinking of making the function work properly. Determine the fastest and most accurate solution, and implement this solution so that its work is 100% take advantage of the time. Then, move on to beautiful beauty.

28. "I'm betting that updating my software will solve this problem. ”

Teams that manage programming language dependencies and plugins do not need to publish versions frequently. Sometimes, when you transfer files from a computer to a live server, updating the php/ruby/python/sql version resolves the debugging issue. Local updates can rarely help fix bugs in the source code unless your version is obsolete. So, it's worth a try!

29. "I should be more organized and learn git ... We'll study it next week. ”

Open source version control pack git is very popular among programmers. Compared to other competitors, it provides an easier learning curve and is used by many online code repositories, such as GitHub and BitBucket. It's easy for developers to delay learning about git because it's obviously difficult for beginners. But once you know the basic commands, Git is a piece of cake. It also makes debug version control clearer.

30. "Forget it, I'll start from the beginning." ”

Sometimes, after you've racked your brains for hours, you might want to just move your work files to the archive directory (or delete them) and start from scratch. But it's hard to make up your mind about the time you've already spent. But when I'm helpless, I tend to start from scratch, because it's possible to find the right path to complete the project.

?

30 Responses to a bug when the programmer encounters it

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.