• web前端编程编程 I've never met a perfect developer, but I've met several who have taken significant steps towards becoming one! Use the following tips to develop better, faster applicati...


    I've never met a perfect developer, but I've met several who have taken significant steps towards becoming one! Use the following tips to develop better, faster applications:

    我从未见过一个完美的开发人员,但是我遇到了几个迈出重要一步的人! 使用以下技巧来开发更好,更快的应用程序:

    Step #1: Write for Lots of Visitors


    A common mistake for most developers is to focus so much on making something work that they don't think about how it will work when 100 people hit it all at once. Sometimes 100 simultaneous visitors seems SO far away that developers just figure they'll fix that problem when it comes up. That's the wrong attitude to have - there often is no simple, magic patch to fix the problem. If that's the case and if you're the developer, then you might as well start looking for another job, because you may have just torpedo-ed the whole project.

    对于大多数开发人员来说,一个常见的错误是过于专注于使某项工作正常工作,以至于他们没有想到当100个人一次全部完成这些工作时,它将如何工作。 有时候,同时出现100位访问者似乎太遥远,以至于开发人员认为他们会在问题解决时解决。 那是错误的态度-通常没有简单的魔术补丁可以解决问题。 如果是这样,并且您是开发人员,那么您不妨开始寻找其他工作,因为您可能刚刚对整个项目进行了鱼雷处理。

    There's no need to be extreme, either. You don't need to start off with a replica of Google's server farm. As a developer, you just need to plan for a few things. Plan on the application being copied onto another server to split the load, or pieces of the application being served remotely, or even multiple copies of the application running for different customers with separate databases.

    也不需要极端。 您无需从Google服务器场的副本开始。 作为开发人员,您只需要计划一些事情。 计划将要复制的应用程序复制到另一台服务器上,以分散负载,或者远程管理该应用程序的各个部分,甚至为具有不同数据库的不同客户运行该应用程序的多个副本。

    A good example from my own experience is thumbnailing. It's extremely easy to write a quick script in PHP that will take a JPEG and resize it by 50% and write out the resulting file. If 100 people are doing it at the same time, you can reasonably expect that the server is going to be really busy. What I did in one of my projects was to write the thumbnailing code so that it was a standalone application. Then, once more and more people used the product, we were able to easily move the thumbnailer application over to another server without rewriting lots of code or worrying about tearing out vital chunks from the main application.

    根据我自己的经验,一个很好的例子是缩略图。 用PHP编写一个快速脚本的过程非常容易,该脚本将采用JPEG并将其大小调整50%并写出结果文件。 如果同时有100个人这样做,则可以合理地预期服务器将非常繁忙。 我在一个项目中所做的就是编写缩略图代码,因此它是一个独立的应用程序。 然后,越来越多的人使用该产品,我们能够轻松地将缩略图应用程序移至另一台服务器,而无需重写大量代码或担心从主应用程序中删除重要的代码块。

    A hundred visitors every second is common for some projects, and some servers see tens of thousands of hits per second. If you get into the good habit of writing code that could be used by 100 people at once without crashing the server, then you'll instantly be far better than most web programmers out there.

    在某些项目中,每秒一百个访问者很常见,而某些服务器每秒看到数以万计的点击。 如果您习惯于编写一次可以让100个人使用而又不会使服务器崩溃的代码的良好习惯,那么您将立即比那里的大多数Web程序员都要好得多。

    Step #2: Become a DBA


    Okay, maybe not a FULL database administrator, but knowing the ins and outs of your database is extremely important to getting the best performance out of your applications.


    Any good PHP/MySQL developer should:

    任何优秀PHP / MySQL开发人员都应:

    - Be able to know how to use DESCRIBE and EXPLAIN to analyze tables and their indexes, as well as the queries that are being run.


    - Be familiar with the basics of how indexes and keys work.


    - Know when to use the different datatypes (example: don't use a TINYINT for an auto-incrementing primary key on a large table).


    - Should always try to avoid using the "SELECT * FROM..." query (specify the column names you want instead of the * symbol).

    -应始终尝试避免使用“ SELECT * FROM ...”查询(指定所需的列名而不是*符号)。

    There is a LOT more that can be learned (persistent connections, unsigned vs. signed integers, subqueries vs. joins, dealing with temp tables, etc), and every bit learned will enable you to make the most of every interaction your script has with the database.


    Don't fret - learning the basics does not take as long as you might think.


    Step #3: Don't Reinvent the Wheel


    I frequently see questions on Experts Exchange about how to write certain applications - shopping carts, chat programs, etc... Sometimes there is a valid need to write something from scratch, and sometimes it turns into valuable experience. Usually, if you're a developer, you just want to write it because it sounds like fun. If you are writing something for live, production use, then you should strongly consider finding an existing version of what you're trying to build. Lots of ideas sound simple at the start, but when you start adding in all the security measures, UIs, error handling, unexpected feature requests, etc, that 2-hour project can easily turn into a 200-hour mess.

    我经常在Experts Exchange上看到有关如何编写某些应用程序(购物车,聊天程序等)的问题。有时确实需要从头开始编写某些内容,有时又会变成宝贵的经验。 通常,如果您是开发人员,则只想编写它,因为听起来很有趣。 如果您要编写供生活和生产使用的东西,那么您应该强烈考虑寻找要构建的现有版本。 一开始很多想法听起来很简单,但是当您开始添加所有安全措施,UI,错误处理,意外的功能请求等时,这个2小时的项目很容易变成200小时的混乱。

    Step #4: Be Willing to Buy


    Sometimes, the "existing version" may be something you have to buy. At that point, you have to weigh your potential time against the cost of the product. Sometimes, your time IS money and $50 up-front could be saving you $5000 in the long run. I've seen some commercial apps sold for under $100 that came with their full source code and a license allowing you to do whatever you want with the code (except sell it as your own).

    有时,“现有版本”可能是您必须购买的东西。 此时,您必须权衡潜在时间与产品成本。 有时,您的时间就是金钱,从长远来看,预先支付50美元可以为您节省5000美元。 我见过一些售价不到100美元的商业应用程序,其中包含完整的源代码和许可证,可让您随心所欲地使用代码(除了自己出售)。

    Step #5: Never Trust Anyone


    Cliché, I know, but it's the best advice you can ever take when developing web applications. Sure, most of your intended users probably are not malicious hackers, but security measures are not there to protect you and the server from all of the nice people. It only takes one successful hacker to bring on the world's biggest headache. If your application is small, then the security breach might just result in your web site being defaced. If you're storing sensitive data, like credit cards, then one break-in could result in identity theft for thousands of people, and a PR nightmare.

    我知道,陈词滥调,但这是开发Web应用程序时可以接受的最佳建议。 当然,您的大多数目标用户可能不是恶意黑客,但是没有安全措施可以保护您和服务器免受所有好人的攻击。 只需一名成功的黑客,就可以带来世界上最大的麻烦。 如果您的应用程序很小,那么安全漏洞可能只会导致您的网站被破坏。 如果您要存储敏感数据(例如信用卡),那么一次闯入可能会导致成千上万人的身份盗窃和PR噩梦。

    Learn to write your applications so that you expect the majority of your users are going to try to be searching for security holes. Cross-site scripting (XSS) and SQL injection are some of the most common attacks nowadays, and they can be mostly prevented by filtering your data (e.g. strip out < and > characters out of fields that should contain someone's name), and escaping the data going into your queries. I also frequently see applications that allow files to be uploaded without any restrictions on the file extensions. This means I can write my own PHP script, upload it, and run it on your server! Easy to overlook, and extremely dangerous.

    学习编写应用程序,以便您期望大多数用户都将尝试搜索安全漏洞。 跨站点脚本(XSS)和SQL注入是当今最常见的攻击,通过过滤数据(例如,从应包含某人姓名的字段中删除<和>字符)并转义,可以大体上防止跨站脚本(XSS)和SQL注入。数据进入您的查询。 我还经常看到允许文件上传而对文件扩展名没有任何限制的应用程序。 这意味着我可以编写自己PHP脚本,将其上传并在您的服务器上运行! 容易忽视,并且非常危险。

    There are some tools like ParosProxy (good, free) and Burp Professional Suite (better, but not free) that will scan your site for vulnerabilities and give you reports. Never release a web application without running a vulnerability scan on it first.

    有一些工具,例如ParosProxy(好,免费)和Burp Professional Suite(更好,但不是免费),它们会扫描您的网站中的漏洞并为您提供报告。 在未首先对其进行漏洞扫描的情况下,切勿释放该Web应用程序。

    Step #6: Learn How to Debug Better


    It still surprises me how many people do not have good debugging skills. They rely solely on error messages, and when those aren't helpful or don't even show up, they are lost. To debug better, you should start by thinking about your program as if it were a car going from point A to point Z. I'll use PHP scripts as an example again.

    仍然令我惊讶的是,有多少人没有良好的调试技能。 它们仅依靠错误消息,而当这些消息没有帮助或什至不显示时,它们就会丢失。 为了更好地调试,您应该首先考虑程序,就好像它是从A点到Z点的汽车一样。我将再次使用PHP脚本作为示例。

    If the car starts at point A but never reaches point Z and you don't know where it stopped, then you need to go looking for it. The easiest start is to go halfway into the program, to point M, and then put up a line of code that will notify you somehow if the car passes by. Here is where things like print(), file_put_contents(), and mail() become your best friends (if you HAVE to debug a live application, then use file_put_contents() or mail() to avoid debugging information being shown to real visitors). I will frequently put in something like:

    如果汽车从A点开始但从未到达Z点并且您不知道它在哪里停下来,那么您需要去寻找它。 最简单的开始是进入程序的中间,指向M,然后放一行代码,如果汽车经过,它将以某种方式通知您。 这是print(),file_put_contents()和mail()之类的东西成为您最好的朋友(如果您必须调试实时应用程序,请使用file_put_contents()或mail()以避免将调试信息显示给实际访问者) 。 我会经常输入以下内容:


    file_put_contents(“ mydebug ging.log”, __线__。” \ n“,FILE_A PPEND);

    and copy it and put it in several key locations throughout the code, and then run the application once. When it stops, I open up the mydebugging.log file and I can see how the car progressed through the script - which points/lines it touched, and approximately where it stopped. Add in a few more debugging lines in that approximate area and continue the cycle until you've identified the exact point where the program stops.

    并将其复制并放在整个代码中的几个关键位置,然后运行该应用程序一次。 当它停止时,我打开mydebugging.log文件,可以看到汽车如何通过脚本进行前进-触摸的点/线以及大约停止的位置。 在该大致区域中添加更多调试行,并继续执行该循环,直到您确定了程序停止的确切位置为止。

    Often times, that's enough to tell you WHY the program stopped at that point and how it got there. Sometimes that's not enough, which is when I pull out print_r(), which dumps the contents of any variable (array, string, whatever). Since variables often are responsible for WHY a program goes one way and not the other, it's important to see their contents before and after the decision in question. Again, using file_put_contents() in different parts of the application can let you see how a variable was created, changed, etc...

    通常,这足以告诉您为什么程序在此时停止以及如何到达那里。 有时这还不够,这是当我取出print_r()时,它会转储任何变量(数组,字符串等)的内容。 由于变量通常是为什么一个程序负责的原因而不是另一种原因,因此在有关决策之前和之后查看其内容很重要。 同样,在应用程序的不同部分中使用file_put_contents()可以让您看到如何创建,更改变量等。

    As long as you use those two basic techniques correctly, debugging should become an easy task. Still time-consuming, but easy.

    只要正确使用了这两种基本技术,调试就应该很容易。 仍然很耗时,但是很容易。

    There are tools for almost every programming language, including PHP, which will give you more debugging capabilities (breakpoints, watches, etc). If you can get these tools and use them, then you'll have an even easier time. However, the techniques described above should be applicable to debugging almost any type of language, so learn them well.

    几乎所有的编程语言都有工具,包括PHP,它将为您提供更多的调试功能(断点,监视等)。 如果可以使用这些工具并使用它们,那么您将获得更轻松的时间。 但是,上述

    翻译自: https://www.experts-exchange.com/articles/1235/6-Steps-to-Better-Web-Programming.html


  • 其中学习web前端编程语言的更是越来越多,作为编程语言届的元老,web前端一直保持这自己独有的优势,有太多人转行跨界,想要进入这个领域,那么作为初学者的你,是不是也很困惑,非科班出生,0基础学习web前端











  • WEB前端编程规范(html,css)教程.zip 1.属性值要用双引号,而不是单引号 2.自闭合元素的发问不写斜线 3.缩进==2个空格 4.用空格代替tab,一 tab==2个空格 5.HTML5的doctype是!DOCTYPE html 2.单独的选择器单独放在一行 ...
  • 一、web前端编程规范1、命名规范:html命令、图片命名、脚本命名HTML文件命名a) 首页使用的名字:统一使用index或者homeb)其他子页面统一用英文翻译或者中文拼音取名c)一些常用的页面命名关键字:about、intro...





    a) 首页使用的名字:统一使用index或者home




    a) 图片的名称为头尾两部分,用下划线隔开

    b) 图片的头部表示此图片的大类(如:广告、标志、菜单、按钮等等)

    c) 大类的命名示例:banner(轮播图)button(链接图片)menu(菜单图片)log(标志图标)pic(普通图片)

















            特点:标签选择器会对当年页面当中所有的指定标签进行选择、标签选择器对代码的当前标签层次结构没有任何关联,只要                   是在当前页面上,都能被选中。




       特点:类选择器的正确使用方式是通过携带的方式实现、定义公共类的样式,然后再需要使用的地方,就直接携带此类名就        行了












        作用范围: 对文本样式设置的基本属性才能被继承(颜色color\样式text\字体font\行属性line)所有关于对于盒子模型           (div、span等)的属性设置(border、定位、布局)都不能被继承。





                             d) 如果权值一样,则后面覆盖前面


  • 今天和大家第一次见面了,今天给大家盘点一下对于自学web前端编程完成毕业设计和走向工作岗位的小伙伴来说,我们所需要准备的工具有哪些。对于一些零基础的学员来讲如何快速学习完成毕业设计,又快速找到专业相关的...





    对于工具小编想到了以下几个方面:1.编译器 2.书籍 3.自学资料



    想学习web前端找工作这里推荐一下我的学习交流q.u,n: 956940552 ,里面都是学习前端的,如果你想制作酷炫的网页,想学习编程。自己整理了-份201 8最全面前端学习资料,从最基础的HTML+CSS+JS [炫酷特效,游戏,插件封装,设计模式]到移动端HTML5的项目实战的学习资料都有整理,送给每一位前端小伙伴, 有想学习web前端的,或是转行,或是大学生,还有工作中想提升自己能力的,正在学习的小伙伴欢迎加入学习。


    1.Adobe dreamweaver

    2、Sublime Text





    《HTML5 CSS3 JavaScript jQuery网站建设案例实战》





  • 新入行的朋友或想转行的朋友,初学编程的朋友,可以下载,绝对值,事半功倍。可以提高代码命名规范性,英语基础不好没关系,在数以万计的英语单词中提取出编程最常用的单词,大大提升您的工作学习效率
  • WEB前端编程基础语言包括HTML,CSS,Javascript等。 就好比一个房子,HTML就是框架、房梁、结构。CSS就好比里面的装修样式,颜色等。而Javascript就好比里面的灯开关,水龙头开关等,具有交互功能。 工欲善其事必...
  • web前端编程规范

    2017-04-04 21:47:36
    二、前端编程规范性的意义 提高代码的可读性降低代码错误率提高代码的整合效率和重用性为后期的维护提供更高的便利 三、命名规范 html命名规则 统一使用小写的字母、数字和下划线组合(不得包含空格和特殊字符)...
  • 今天,是一个晴天并且是有云朵的一天,牛耳教育就告诉您想学web前端编程应该从哪个环节开始?哪个环节是最基础的学习环节?哪些是针对零基础该学习的语言? 1、学习HTML+css、JavaScript 精通HTML+css是前端最简单、...
  • web前端开发相信大家都不会很陌生,你在网页中看到的所有效果都离不开web前端开发者的努力,有同学问小千web前端工程师都用的哪些语言呢?下面小千就来给大家介绍一下。 标题1.HTML/CSS HTML可以算是前端开发的基础...
  • web前端编程 与 嵌入式编程的区别

    千次阅读 2019-01-18 17:16:28
  • 现如今说起IT行业人员,人们首先想到就是坐在电脑前,敲敲代码的程序员吧,每天只要坐在办公室里敲敲键盘却有着不菲...学java、python、web前端编程语言,自学和培训如何选择 学习软件编程: 然而对于那些刚刚软件...
  • Web 前端编程运维必备

    2019-02-19 11:40:00
    Html 1、Html 标签初知 2、Html 标签种类 3、Html 符号 4、Html Title 标签 5、Html meta 标签 6、Html Link 标签 7、Html p 标签 8、Html br 标签 9、Html h1-h6 标签 ...12、Ht...
  • 不知道该学哪一门编程语言,web 前端? C/C++? JAVA? C# pythpn? 不知道 web 前端 ,Java PHP C++之间有什么区别? 是不是学习 web 前端之前要先学 C? 学了 WEB 前端基础之后又该学什么? 如果你有这些疑问,那就...
  • 一、弹出提示框: 连接 function disp_prompt() { var name=prompt("请输入您的名字","Bill Gates") if (name!=null && name!="") { document.write("你好!" + name + " 今天过得怎么样?...
  • 福彩号码生成规则如下: 1."双色球"彩票投注区分为红色球号码区和蓝色球号码区 2."双色球"每注投注号码由6个红色球号码和1个蓝色球号码组成。 3.红色球号码从1–33中选择;蓝色球号码从1–16中选择。...
  • 编程题:小明去买橙子,水果店只能提供整袋购买,有每袋6个和每袋8个的包装(包装不能拆分)。可是小明只想购买恰好n个橙子,并且尽量少的袋数方便携带。如果不能购买恰好n个橙子,小明将不会购买。请根据此实现一个...
  • 技术体系-web前端编程

    2013-09-09 22:53:00
    这里结合个人经验,将遇到过的前端的技术整合了在一块。算是总结,也算是以后技术完善的依据,下图有不完善或者不准确的地方,欢迎指正。 转载于:...
  • 引子:Web编程深似海原计划用8天时间进行Web前端的学习,结果拖延了,原因自然是对这部分内容学习的难度估计不足。我的方法还是试图一开始了解web编程的全貌,结果发现整个链条涉及的编程语言和技术门类实在太多,...
  • &lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt;京东_曾柯伟&lt;/title&gt; &lt;link rel="stylesheet" type="...bod
  • ```jsclass SignInPage extends React.Component {// 1,设置表单值的初始statestate = {name: null,password: null}// 3,从state中获取表单数据,并做其他处理signIn(){// ...this.state;...// 做一些验证...// ...
  • 今日下午4点,web前端编程直播约吗? 我们决定2016年11月13日下午4点准时在QQ群:454796847进行web前端开发直播。 如果效果比较好,以后每周大概直播一次,欢迎大家前来吐槽!!!!! 另外,我们准备的课程有:...
  • 题目:给定一个字符串,找出其中无重复字符的最长子字符串长度。 示例一:'abcabcab'-&gt;3 示例二:'bbbbbb'-&gt;1 ...一般像这种处理字符串或者数组的问题,一般查看考生两个能力: ...第一,也是最重要的,...
  • 本人学的是java的,打算以后从事web前端,现在企业所谓的web前端... 虽然学java里也涉及到这些,以及前端编程的servlet和jsp,不过真心不想学jsp。。 真正的web前端是怎样的??? 转载于:https://blog.51cto...
  • 转载自:Web前端开发-Web前端工程师 » WEB前端工程师编程能力成长之路【转】
  • 转行学web前端,这是不少人的选择,毕竟目前互联网行业...加之web前端编程前期学习简单,入门容易。所以才有相当一部分人打算进入web前端开发行业。 随着行业的发展,技术的更新,同样对于前端人员来说也同样不怎么...



1 2 3 4 5 ... 20
收藏数 6,031
精华内容 2,412