小程序开发的方法(Small program development method)

小程序优势:1、免安装,使用方便;2、依托流量平台,打开率高,易搜索,易发现,易分享;3、开发成本低。
开发方法:1、原生开发——直接下载官方的开发者工具,参照官方提供的文档、视频教程和语法。
优点:上手相对容易,开发语法与api均能在文档中查到;出问题更容易定位和解决。
缺点:代码量大、组件少、语法不灵活、开发效率很低,且不同小程序平台语法不同。
2、框架开发——各种界面库与框架。
优点:使用代码更少甚至是直接使用现成的代码,采用前端编程语法和框架,提高了开发效率与代码的可维护性,使得代码更简洁。
界面库如如腾讯的weui、有赞的vantUI。直接按照文档学习、引入文件,选择自己需要的组件,搬运代码即可。
框架如腾讯的wepy、uniapp、美团mpvue均可使用类似前端vue开发框架的语法。
而熟悉react的同学,可尝试阿里的remax,京东的taro。
缺点:问题的排查成本高;框架有bug或无法支持的功能时,就很被动。
3、跨端开发(最主流)——在多个平台同步发布一个小程序。跨端开发框架使得写一套代码即可自动生成支持多个平台的小程序和h5页面。如uniapp(语法简单、组件库和插件丰富、生态好,受新手与vue开发者喜爱)、remax、taro(受react开发者喜爱)和chameleon均支持,部分还支持条件编辑(针对不同平台编写特殊逻辑)。
4、低代码开发——一个可视化页面平台,通过拖拽组件、输入配置来改变组件的样式和行为,再自动生成代码。如腾讯的WeDa。
优点:几乎无代码,连cv都不用。
5、云开发
优点:不用自己搭建后台,就能使用数据库和操作数据库的函数。即使只会前端,也能开发一个完整的小程序。
小程序也是前端,也是开发界面、交互以及一些数据请求的业务逻辑,只是语法略有区别。如微信小程序,基本语法和前端三件套HTML+JS+CSS相似。所以最后先学习前端web开发的基础知识。
最好先学习一个前端框架,如vue或者react。新手应该先用原生开发打基础,了解小程序的机制

————————

Advantages of applet: 1. Installation free and easy to use; 2. Relying on the traffic platform, it has high opening rate, easy to search, find and share; 3. Low development cost.
Development methods: 1. Native development – directly download the official developer tools and refer to the official documents, video tutorials and syntax.
Advantages: it is relatively easy to get started, and the development syntax and API can be found in the document; It is easier to locate and solve problems.
Disadvantages: large amount of code, few components, inflexible syntax, low development efficiency, and different applet platforms have different syntax.
2. Framework development – various interface libraries and frameworks.
Advantages: use less code, or even directly use the ready-made code, and adopt the front-end programming syntax and framework, which improves the development efficiency and code maintainability, and makes the code more concise.
Interface libraries such as Tencent’s weui and vantui with praise. Learn and import files directly according to the documents, select the components you need, and carry the code.
Frameworks such as Tencent’s wepy, uniapp and meituan mpvue can use syntax similar to the front-end Vue development framework.
Students who are familiar with react can try REMAX of Ali and taro of JD.
Disadvantages: high troubleshooting cost; When the framework has bugs or unsupported functions, it is very passive.
3. Cross end development (the most mainstream) — release a small program synchronously on multiple platforms. Cross end development framework makes it possible to automatically generate applets and H5 pages supporting multiple platforms by writing a set of code. For example, uniapp (simple syntax, rich component libraries and plug-ins, good ecology, loved by novices and Vue developers), REMAX, taro (loved by react developers) and chameleon are supported, and some also support conditional editing (writing special logic for different platforms).
4. Low code development – a visual page platform that changes the style and behavior of components by dragging and dropping components and inputting configuration, and then automatically generates code. Such as Tencent’s weda.
Advantages: almost no code, not even cv.
5. Cloud development
Advantages: you can use the database and operate the functions of the database without setting up your own background. Even if you only know the front end, you can develop a complete applet.
The syntax of the front-end is slightly different from that of the front-end, and the logic of the data request is also slightly different. For example, the basic syntax of wechat applet is similar to that of the front-end three piece set of HTML + JS + CSS. So finally, first learn the basic knowledge of front-end web development.
It’s best to learn a front-end framework first, such as Vue or react. Novices should first use native development to lay the foundation and understand the mechanism of applet