- 论坛徽章:
- 0
|
一. What's the best way to start writing a PHP program? 最开始写好PHP程序的方法是什么?
Design, design, design. Figure out, on paper, exactly what you want to
do. Otherwise, you'll just be coding your way around with no real goal.
设计,计划,方案,理解,手写,确切的明白你想做的,否则,你只是在毫无目标的编写你的程序。
Plan on separating content from logic, it'll always assure cleaner,
more maintainable code.
想好把内容与逻辑分开,这样有助于保证清晰的,可扩展的代码。
Usually the apps I write are DB-related, so to use that sort of
application as an example, the first step would be nailing down, with
fairly broad scope, what sort of data needs to be stored. This doesn't
have to mean tracking down every possible facet of information that
will ever be pertinent, just get a good idea. Part of the app design
may call for it to be extensible anyway, so you don't have to know
everything ahead of time.
通常我写的附录都是DB-related,所以都是使用类似于例子的应用。第一步是在适当的程度上明确
需要存储哪种类型的数据。但是这不是说一定要考虑到相关信息的各种可能,只是获得一个好的想法。
附录的一部分设计要求至少有扩展性,因此你不需要在开始的时候知道所有的东西。
Once you have a good understanding of what data needs to be stored,design your database. Flow charts are your friend. :) Having a
visualization of the structure of the DB will come in handy for
subsequent steps.
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u2/60589/showart_1994954.html |
|