In today's development environment, fast is good.
Today's popular vocabulary and terminology such as fast application development, agile software development, asynchronous JavaScript and XML (now we can't even wait for web pages to be reloaded) lets you see what kind of fast-paced world you are in.
But rushing to do things does not mean that you have to work overtime - you need to think about it when you work. This article will provide you with ten time-saving tips for shortening web application development.
1. Use the framework
The framework extracts regular code, providing you with a basic structure and foundation for writing web applications.
A very typical example of the framework is Rails, which is a web application development framework for the Ruby programming language. By providing you with pre-written code packages (for example, user input verification methods) - you not only save time writing your own code in Ruby - you are also very clear that these packages have been tested and tested by other developers, which can reduce you a lot of trouble when testing breadth, and can also avoid potential vulnerabilities caused by lack of testing.
The same benefit is also applicable for using JavaScript frameworks such as MooTools. Some of the class methods these frameworks provide to you are provided by core developers and communities, and have been tested by extensive testing in many browsers. The client scripting language framework also includes jQuery, Prototype JS, and YUI. If you want to use some non-mainstream JS frameworks, you can take a look at this list of JavaScript frameworks with great potential.
For server-side frameworks, you can consider CakePHP, CodeIgniter, Zend, or symphony. If you like VB and Microsoft-supported languages like C#, you can consider the .Net framework.
You can even use CSS frameworks like 960Grid or BluePrint to quickly write and standardize your own style of page structure.
2. Use an integrated development environment
Of course, you can create web applications and their pages with just a text editor like Notepad and FTP. But I think most people think that this is not a wise way to develop complex and robust website projects.
Integrated Development Environment (IDE), which prepares you with the collection of tools you need to create and manage large website projects. The functions of integrated development environments are changing, but they all have some common features as follows
1. Project management and team collaboration functions.
2. Debugging and diagnostic functions.
3. Syntax prompts and automatic completion functions (IDE will guess the syntax you want to write)
4. Highlighted grammar
5. Built-in FTP, can synchronize files on local and remote hosts
The word IDE may be a bit fancy, and some people are not familiar with it, but big data people should have heard of Adobe's Dreamweaver. Dreamweaver can be regarded as an integrated development environment. Because it contains some of the functions mentioned above, it helps you write code faster. (He is usually suitable for front-end production. But it also supports server-side languages like PHP and ASP.NET)
There are a lot of IDEs online nowadays, all you have to do is pick one for yourself (or your team). Like some popular, fully-featured IDEs like Eclipse, Komodo IDE, NetBeans, Visual Studio, and Aptana Studio.
3. Appropriate modularity
Modularity is the key to creating complex applications that are easy to maintain and scale. Essentially this means that the code is written in small parts, rather than writing all the code into a large file.
Modular beginnings have their own time costs (because you have to spend a lot of effort on designing file structures.) However, when you need to change a component or want to expand your application, it will save you a lot of time.
Modularity also limits bugs to modules. If there is a problem, you will quickly find the problem.
However, the abuse of modularity will cause bloat in the code and too many unnecessary include statements, which will greatly slow down the entire application. Therefore, between too high and too low modularity, we need to reach a good balance.
Some modular design patterns include MVC and PAC modes.
4. Use browser tools to efficiently troubleshoot front-end problems
There is no way to deal with something worse than cross-browser compatibility and parsing issues. This pole will make you crazy, and the frustration it brings to you almost makes you feel that it is difficult to relieve your hatred without smashing something. However, debugging tools integrated into the browser will make finding and diagnosing front-end problems apart from rapid and efficient.
Firebug and Web Developer are absolutely necessary time-saving tools, and they have become essential tools for front-end web developers. Firbug can easily view the DOM to understand its principles, and can adjust CSS/HTML/JS in operation. In addition, it can also help you debug and profile your JavaScript code, help you solve the problem of what caused your script to run interruption. Web Developer provides you with a series of useful tools. Some tools allow you to click on a page element to see which style declarations affect the element, and can also make it convenient for you to disable JavaScript and CSS, allowing you to understand how your page works without JavaScript or CSS.
If you need to debug in IE browser, you can try the IE developer toolbar. It is very similar to Firebug and Web Developer in functionality. If you want to find more IE debugging tools integrated into the browser to help you save debugging time, you can click this link.
5. Code reuse
If you find yourself always doing repetitive things, you should reflect on your code structure. Consider learning common design patterns that will help you create reusable flexible methods, functions, and objects.
For example, if you need to link to the database frequently, you may need to create a database access class to handle database links, queries and data submissions.
6. Online collaboration and tracking project status
Actually - you are not alone in your work. Whether you are working for a development team or for someone (that person may be your boss or your client), you should fully enjoy the benefits of collaborating online and tracking project status.
The less time you spend on administrative tasks, or the less time you spend on endless meetings (or, worse, the kind of in-person meetings that require a business trip) - the more time you spend on code.
Tools like Basecamp, Lighthouse, and ActiveCollab provide you with a one-stop team collaboration service that allows you to track the status of your project at any time, and you can also set project goals and milestones - so that everyone can automatically sync, saving you time to reply to emails frequently, and you don’t have to spend a lot of useless time on progress confirmation meetings.
These tools will also help you distinguish the importance of things and ensure that everything is organized and recorded in a centralized place.
7. Automatic formatting and standardization of code
You need to standardize all your code formats. This is not only a good habit to do, but it will help you understand the code quickly once you need to come back to see the code in the future.
Automatic code formatting allows you to format all your code with one click instead of doing it one line by one, which also ensures consistency in code writing. Automatic formatting also reduces the risk of manual modifications to errors.
We have many tools to help us do this, many of which are online versions of the tools. For CSS, a popular open source solution is CSSTidy (the online version of Clean CSS is an CSSTidy). For HTML we have HTML Tidy.
For scripts, we have PHP Source Code Formatter, Ruby Script Beautifier, and Code Beautifier Plus (this tool is used to format C#, ActionScript, and Java).
8. Spend more time during the requirements collection and planning stages
Prevention is far better than remedy. Perhaps some ideology figures emphasize not to waste time on planning - making sure you have collected all the information you need to know, and it is still necessary to spend the necessary time in doing your homework. If you do not do enough homework in demand collection, it will lead to feature Creep. The reason is various unexpected functional requirements.
9. Use already written code
The ancients also helped us invent the wheels, so there is no need for us to make the wheels ourselves. If you see a feature of interest somewhere, it is very likely that others have written code for you (well, not just for you, but for all of us.) For PHP, PHP Classes Repository provides you with a large number of classes and scripts for you to download and use. Hot Scripts provides various scripts in other languages. If you just want some small code snippets, you can go to devSnippets to Taobao.
Note: Only when you have sufficient experience and can distinguish good and bad codes, the above method will really help you a lot. Otherwise you will find that the code in your final product is full of bugs and the writing is messy.
10. Simplified functions
You must evaluate certain features of the web application to determine whether the time investment in this feature is worth it.
Do your users really need a content management system that is not updated frequently to provide a custom RSS output for each category of articles? You really need a website style converter to help you detect where the user is geographically and then render the website in a different style.
Writing website functions is an uphill battle. Don’t waste development time on features that are useless to end users, and these functions will complicate the user interface.