Father of jQuery: code written every day, father of jquery

Source: Internet
Author: User

Father of jQuery: code written every day, father of jquery

Last fall, I encountered some problems with the branch code project, the project was not working properly, and I could not find a way to complete more code.

I mainly run my branch line on weekends, and sometimes at night. This method does not work well for me. I am under too much pressure. I need to work hard to do as much work as possible on weekends (if not, I will feel frustrated ). Another problem is that I cannot guarantee that every weekend is free, and I don't want to spend all the weekend's time programming (losing all the opportunity to relax and entertain ).

In addition, if encoding is performed every week, the gap is too long. It's too easy to forget what you are doing or what you still need to do (even if you have notes ). If you miss a weekend, the problem becomes more serious, and the interval suddenly becomes two weeks. Context switching for multiple weeks may be fatal (I have many branch projects that have died due to such a lack of attention ).

Last year, Jennifer Dewalt created 180 websites on 180 days to learn programming by herself. Her practice inspired me. I decided to adopt a simple policy: daily encoding. A front-end UI framework that can improve development efficiency by 500%!

I decided to set some rules for myself:

  1. Code must be written every day. I can write documents, blogs, or other things, but these cannot be used to write code.
  2. The code must actually work. Adjusting indentation and re-layout is not counted. If possible, refactoring is not counted. (These tasks can be performed, but they cannot be the only code of a day .)
  3. All code must be completed before midnight.
  4. The code must be open-source and put on Github.

Some rules are relatively arbitrary. For example, you don't need to write the code before midnight. But I am worried that staying up late will cause the code quality to drop. Similarly, the Code does not need to be open-source or stored on GitHub. I want to force myself to write code (consider readability, and consider modularity earlier ).

This policy has been effective so far. I have been working for almost 20 weeks. The reason why I wrote this blog is that it completely changed the way I wrote code, and more importantly, it affected my life and my mind.

This change in habits produces some interesting results:

Minimum feasible encoding.I forced myself to spend less than half an hour writing code every day (if it was less than that time, it would be difficult to write valuable code, especially to recall what was written the day before and it would take a little time ). On workdays, I sometimes write a little more (generally less than an hour), and on weekends I sometimes write code all day.

Writing code becomes a habit.It is worth mentioning that I do not particularly care about the above Github images. I think this is the most useful thing for this experiment: this is a change you have made for yourself, not to satisfy others' comments on your work. Diet and exercise are also a truth: If you don't care about improving yourself, you will never succeed.

Fight against anxiety.Before I started this experiment, I often felt anxious about not finishing enough work or making enough progress (work and progress were difficult to quantify because my branch projects were not dead-end ). I realized that progress is equally important as actually advancing. This opened my eyes. Once I continue to push forward the project every day, my anxiety begins to dissipate. I am very happy with my work, and I have no longer had that kind of unbearable desire to push forward the project in a sudden storm.

Weekend.In the past, the completion of work over the weekend was definitely the key driving force for progress (because it is usually the only opportunity for me to push forward the work of a large number of regional projects .) This is a good thing. It is expected that I will only be disappointed to finish all the work for one week on a weekend. I seldom finish my work, so I refused other weekend activities (such as dim sum, museum tours, Park tours, and my companion) to do more work ). I deeply feel that although branch projects are very important, they should not be the whole of life. A front-end UI framework that can improve development efficiency by 500%!

Background processing.One of the interesting side effects of coding the branch project code every day is that your current task is often run in the background of your brain. So when I go for a walk or bath, or do other brainless activities, I am thinking about what code I will do next and find a good solution to the problem. This is not the case when I coded it once a week or two weeks ago. At that time, time was spent thinking about other things, and it was usually anxious to be unable to complete any branch projects.

Context switch.When you pick up the branch project, there will always be context overhead. Unfortunately, it is extremely difficult to rethink the entire week ago. It is very helpful to do this every day, because the interval is greatly shortened, which makes it easy for me to remember what I am doing.

Balance Work.One of the most important aspects of this change is that I have simply learned how to better balance work, life, and branch projects. I know that I have to do branch projects every day, so I need to better manage the time. If I plan to go out at night and can only go home very late, I need to work for the branch project in the morning and before I start working for my main business Khan Academy. Similarly, if I am out, and I have not finished my work, it is very late, then I need to rush home as soon as possible to finish my work (so as not to miss a day ). I need to point out that I found myself spending less time On Hobbies (for example, wood prints), but this is a reasonable price and I have to accept it.

External communication.It is good to communicate with the outside world about your new habits. My partner understands that everything has to be done, so there are activities that sometimes need to be adjusted accordingly. In this way, I can easily say, "Yes, we can go out, watch a movie, and so on. But I need to write code later ." My partner will understand me and take this into consideration when arranging activities.

How much code have I written?It is hard to believe that I have written so much code in the past few months. I have created several websites, rewritten some frameworks, and created a large number of node modules. I 've written so much code that sometimes I forget what I did-a few weeks ago, my work was a long memory. I am very happy to write so much code myself.

I think the change in this habit is a huge success. I hope I can keep this habit. At the same time, I try my best to recommend this strategy to other people who want to complete a large number of regional projects. Tell me whether this policy is valid or not for you. I hope to hear something interesting from you.


Where jquery code is written

<Script src = "jQuery. js" type = "text/javascript"> </script>
<Script type = "text/javascript" language = "javascript">
$ (Document). ready (function (){
Var mm = $ ("# mydiv ");
Alert (mm. text ());
Alert(mm.html (); // The trim method will display other tags in the div. You can try to <div id = "mydiv"> <font stle = 'color: red; '> aaaa </font> </div> you can experience the differences.

});
</Script>
<Div id = "mydiv"> aaaa </div>

What software can be used to standardize self-written jquery code?

What does a standard mean?
If you only want to standardize the format of eclipse, you should be able
If this is not the case, you need another EVJT plug-in.
 

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.