Rework repeated code into arrays.
A long stretch of similar code is often best expressed by the simplest of data structures,the array.
Encapsulate complex structures.
When you need a sophisticated data structure,define it in abstract terms,and express those operations as a class.
Use advanced tools when possible.
Hpertext,name-value pairs,spreadsheets,databases,languages and the like are powerful tools within their specialized problem domains.
Let the data structure the program.
The theme of this column is that data can structure a program by replacing complicated code with an appropriate data structure.Although the particulars change,the theme remains:before writing code,good programmers thoroughly understand the input,the output and the intermediate data strutures aroud which theri p... (查看原文)