Modern front-end development Note

Source: Internet
Author: User

Web development is divided into front and back. As a backend engineer or front-end engineer, front-end development may be a headache.
Along the way, candelease was able to record the experience of modern front-end development.

Front-end development in the Dark Age

In this era, the frontend development process may be like this: the latest masterpiece of the UI front-end framework! Trial with prize!

. Code
  1. * Write various HTML, CSS, and JS
  2. * Go to the website of various front-end modules to manually download various libraries
  3. * Refresh the browser over and over again to view the effect
  4. * Final compression of various static files

 

Problem. Code
  1. * The HTML code is repeated. For example, for a header and footer, it is very likely to violate dry,
  2. It will definitely be analgesia during later maintenance.
  3. * You cannot view the results in real time. You need to refresh them manually. For example, if you are a Java Server with some pain points, writing an API cannot be automatically loaded.
  4. Manual restart is required. Several bugs cannot be called in one hour (Life is too short, please use Python ).
  5. * Many people will not compress this task.
  6. * The code is very inefficient. jquery is indeed flexible, but after a long time, the code will overgrow, especially when there are
  7. When someone else takes over your code, it is very likely that you don't understand it, and then refactor it. That's why the front-end displays various
  8. Reasons for the MVC Framework
The latest UI front-end framework! Trial with prize! Modern front-end development

This age is no longer an age of farming.

First, let's talk about MVC.

MVC has been in the backend for more than N years, and the front-end has also appeared, but does the front-end use MVC
Things are open to discussion. My personal experience is that if your project is small, only you 1 ~ 2 Engineers
The MVC framework is not required for maintenance. The reason is simple: learning cost, time is precious, and learning cost.
It is definitely a hard injury. For example, when you choose backbone angular, steep learning curves will not only affect
You will experience this pain when new people use your project on their own.

The advantages of MVC seem to be worth mentioning.

My practices

There are many excellent open-source projects on GitHub, and there are also many front-end tools. Make good use of the tools and make good use of the excellent libraries.

A scaffolding project UI front-end framework of my brunch is the latest masterpiece! Trial with prize!

. Code
  1. Check to use different branches, or directly download release
  2. * If you use coffee to write JavaScript code, coffee will help you avoid various pitfalls in JavaScript code and use Python-like syntax.
  3. * The HTML and CSS template engines allow you to write fewer letters
  4. I chose jade for HTML. You can use the include syntax to reduce the possibility of dry.
  5. Css I select stylus
  6. * Using build tools, I use brunch, NPM, Bower
  7. Brunch solves the problem of manual refresh and Automatic Engine coffee, Jade, and compilation in the dark age.
  8. Bower makes the installation method of JS and CSS libraries very simple.
  9. NPM is similar to Bower
  10. * For Bootstrap or purecss (Yui), you may prefer to use purecss (IE7 +). For IE6, You need to manually write CSS.
  11. * If you do not need MVC and are not familiar with JS, you can use zarkfx, which will definitely save your development time,
  12. For details about how to use brunch + jade for zarkfx, refer to the Br-coffee-jade branch of my simple project.
  13. * If you use MVC, select backbone + Chaplin or angular. Pay attention to the limitations in MVC,
  14. For example, after using MVC, they have their own driver mechanism, which imposes restrictions on Dom operations, especially when they cannot be used.
  15. This is annoying because of zarkfx.

 

Remember, there will always be ways to solve repeated operations, improve your development efficiency, and use tools for modern web development.


Modern front-end development Note

Related Article

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.