Home  >  Article  >  Novice sharing experience in developing small programs

Novice sharing experience in developing small programs

小云云
小云云Original
2018-01-27 15:12:285019browse

Comes from the experience of novices. I hope this sharing of experience in developing small programs for novices can help friends who are just preparing to develop small programs.

It has been a long time since mini programs came out, and I just started to come into contact with them for the first time. I don’t feel that I am late at all in learning, because after I made my first mini program project, I found that this thing is not difficult. I won’t use it in the future. I will make a small program and then go out to show off!

Why do mini programs still have shortcomings?

No matter how good the mini program is, it still has its shortcomings.

1. The mini program framework is not easy to understand

There is no problem with its project structure. The problem lies in the rewriting of file names, css => wxss, HTML => wxml, which is very awkward Ah, because I am a programmer who likes native development very much, and it was difficult to accept such a weird file for a while. When I first saw wxss, I was still wondering if this thing was to prevent cross-site attacks.

2. There are too many configuration files, and it is difficult to learn.

There are json files everywhere, which is quite uncomfortable to see.

3. The js writing is awkward

There is a global App({}) and a single page Page({}). Do you think you are Vue? It doesn’t feel like it when I write it. Look at this.setData({}), do you think you are react? It doesn’t look like it either. Hey, it seems to have some shadow of jQuery. wx.API looks like jQuery when used, but not entirely. Like native? Unlike, all APIs are encapsulated using object-oriented methods. If it is functional programming, it can be written to be well connected with native js.

This is a collection of high-tech products from the Four Heavenly Kings, but there is no complete copy. Without a little foundation of the Four Heavenly Kings, it is quite difficult to write js. Fortunately, I understand them all and accept them. This knowledge becomes less difficult.

4. There is nothing to say about wxss. Let’s talk about wxml. Some people say it is like react-native, some people say it is like vue, and some people say it is like angular. If you ask me, when I see this thing, I doubt that I have learned it. Is html useless?

5. The mini program has also modified many native methods, such as event functions, using the bind-event writing method. I feel uncomfortable and want to cry. The good thing about mini programs is that there are detailed documents describing these changes. The bad thing is that it breaks the habits of native developers.

6. Only by forgetting the past can you learn small programs.

Why is the development speed of small programs so fast?

Perhaps every developer has heard that small programs are developed quickly and have high output. After my own attempts, I discovered several key points.

1. Mini programs have special development tools: WeChat Developer Tools

This set of development tools integrates the development environment required for mini programs. The advantage is that it does not need to be developed like react or vue. racking your brains to configure the webpack environment. The disadvantage is that this development tool is not so easy to use, and it feels like writing in Notepad.

2. The mini program has a set of official basic demos. You can download and modify them to use: official basic demo

I didn’t know how to build a mini program project at first, and then I found this demo , download the source code locally and you can use it directly. I don’t know if there is a cli. Afterwards, developers need to delete the source code routing, retain the homepage routing, and then proceed with development.

3. The first two steps only take a few hours to complete for novices. If you are experienced, you can complete and develop in a few minutes.

4. Mini program has its own set of component libraries: Mini Program Component Library

The advantage of the component library is that it can meet the development needs of developers without designers. Although I feel that these The components are not very easy to use, but they are enough for people who don’t pursue perfection.

5. Mini Program has a set of API: Mini Program API

Compared with component libraries, I think API is the biggest contribution of small programs. Taking advantage of WeChat APP as a carrier, it encapsulates many useful APIs. It is proficient in all kinds of martial arts, and the documentation is very well written. good.

The best way to learn small programs

is not to read tutorial blogs written by others, but to read official documents. Because the documents are very clear, I think it is better to write a tutorial than to write an article. Developing the mind is more effective.

Summary

If you haven’t played with mini programs, then open the door to the official documentation and simulate it according to the official tutorials. Oh, you will find that it is so simple (project setup, environment Configuration), and then it will be a test of whose js skills are awesome.

Related recommendations:

WeChat applet function throttling how to prevent multiple click jumps

Implementation of a conversation memo applet Method

How to implement the image compression function of the WeChat applet

The WeChat applet makes text look fancy (barrage)

Summary of problems encountered in the development of WeChat mini programs

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn