The front five pit, the pit hope you can know

As we are entering the workplace, in learning and work, always encountered different setbacks. Although some errors related to certain specific acts, but some error is challenge all Web developers have to face. Therefore, through research, experience and observation, Xiao Bian summarizes Web developers often committed five errors - and how to avoid these mistakes to others.

image

Piece of code called a wrong turn, "should do" a
mistake: whether it is Java, or code, developers running on servers need to test and verify that it works correctly, rather than after the deployment, they think it should single-mindedness can run.
Impact: without appropriate error checking website is bullying the end user. Not only it will greatly affect the user experience, but also the type of error message content may give clues to hackers infiltrate this site.
✧ Here I recommend to you a whole stack of front-end development - Communication :( front-end information-sharing ), overcome technical bottlenecks, improve thinking ability
How to avoid: To err is human, this philosophy also applies to coding. Using Java, good technology must be implemented to prevent and catch errors. Although this article depicts in Java coding Windows applications, but most of the content also applies to web development, many tips are very good! Another allow code becomes reliable and can survive in the future is to change unit test.
If we look closely, you will be able to capture the server-side code fails, the user without being discovered. Show only the necessary information, and make sure to set a friendly error page, such as HTTP 404s.

image

Error two forked write the code
error: In the version supported by all browsers and lofty idea, developers determined to create code that can respond to any possible situation. Code if statement piles, all directions are divergent.

Impact: With the new version of the browser update, code files will become increasingly unwieldy and difficult to manage.

如何避免:实现代码的功能检测和浏览器/版本检测。功能检测技术不仅可以显著减少代码量,还更易于阅读和管理。不妨考虑使用如Modernizr这样的库,不仅有助于功能检测,还能自动帮助提供不能跟上HTML5和CSS3速度的旧版浏览器的反馈支持。
错误三非响应式设计
错误:假设开发/设计人员在相同尺寸的显示器上开发网站。
影响:当在移动设备或在非常大的屏幕查看网站时,用户体验要么很难看到页面的重要方面,要么甚至要时刻注意着不导航至其他网页。
如何避免:响应式的思维方式。在网站中使用响应式设计。这里有一些关于这方面的实用教程,包括响应式图片,还有一个非常受欢迎的库,那就是Bootstrap。

image

错误四网站过多刷新
错误:创建的网站需要为每一个互动而全面刷新页面。
影响:类似于页面臃肿(参见#4),页面加载时间的性能会受到影响。用户体验缺乏流畅性,并且每次互动都可能导致网页短暂(或长时间)的复位。

如何避免:快速避免这种情况的一个方法就是,通过测定回发到服务器的内容是否是真正需要的。例如,当不依赖服务器端资源的时候,客户端脚本可用于提供直接结果。你也可以应用AJAX技术或进一步使用单页的应用程序“SPA”方法。流行的Java库/框架,如JQuery、KnockoutJS和AngularJS,能让这些方法的采用变得容易得多。

image

错误五做了太多的无用功

错误:开发人员花了很长的时间来创建web内容。大量的时间花在了重复的任务上,或者自己敲代码写了很多。

影响:初始网站的发布和后续的更新时间过于冗长。如果其他开发人员也在在做同样的工作,却用了更少的时间和精力,那么你的开发价值显然就低了。手动劳动很容易出现错误,而排除故障错误需要更多的时间。

How to avoid: explore your options. Considered at every stage of the development of new tools and new process technologies. For example, you currently use code editor compared SublimeText and Visual Studio, how? Whether you use what kind of code editor, you have a good recent study its function? Maybe just put a little bit of time to read the document carefully , you can find new ways of doing things in order to save hours and hours of time in the future. For example, in this article, Visual Studio extensions can increase productivity as a web developer.
Do not miss the online tools available to help! For example, checks on dev.modern.ie tools to simplify testing (across multiple platforms and devices), and troubleshooting.

✧ In this I recommend a full stack development front-end to the exchange of rings :( we front-end information-sharing ) overcome technical bottlenecks, improve thinking ability

image

You can also automate processes to reduce the time and errors. An example of this is the use of Grunt tool, such as its automation reduce the file (see point 4). Another example is Bower, can assist in managing library / frame (see page 9). As for the web server itself? In such as helping Microsoft Azure Web Apps, you can quickly create a website, almost all development scenarios can be very easy to scale to your business!
By identifying these common errors, web so that developers can avoid a lot of other people are suffering setbacks. Not only do we need to admit mistakes, should also be clear that the effects of errors and take measures to avoid errors, in order to have better development performance - and have the confidence to complete the task!

Guess you like

Origin blog.csdn.net/tianduantoutiao/article/details/90723503