首页> 外文期刊>Software Engineering, IEEE Transactions on >Data structured programming: Program design without arrays and pointers
【24h】

Data structured programming: Program design without arrays and pointers

机译:数据结构化编程:不带数组和指针的程序设计

获取原文
获取原文并翻译 | 示例
           

摘要

Structured programming introduced a new discipline for accessing the instructions of a program. In suitable programming languages, this discipline can be described in terms of program design without gotos. It can be shown, for example, that any functional result achievable in a programming language with gotos, can be achieved in that same language without gotos if sequence, selection, and iteration control constructs are present. The gotos permit random access to the instructions while sequence, selection, and iteration provide much more limited and disciplined access. We now introduce a new discipline for accessing the data of a program. In suitable programming languages, this discipline can be described in terms of program design without arrays and pointers. Any functional result achievable in a programming language with arrays and pointers can be achieved in that same language without arrays and pointers if set, stack, and queue data types are present. The arrays and pointers permit random access to the data while sets, stacks, and queues provide much more limited and disciplined access. The decisive factor in structured programming was not in the theoretical possibilities, although that was certainly necessary. It was in the engineering design realities that made intellectual control of programs more effective. Structured programming literally permits functional programming in procedural languages. Proofs of correctness are simpler, but even more importantly, proofs and programs can be designed together in an algebra of functions to achieve correctness by construction in a stepwise refinement process. We expect the decisive factor in program design with sets, stacks, and queues to be in the engineering design realities, as well. With structured programming, the intellectual leverage is achieved by reducing procedural issues to functional issues, but even more leverage is possible by limiting the ways data can be named and reached. As a result, programs without - rrays and pointers are shorter, simpler, and easier to prove. As with programs without gotos, they take more design planning and thinking, in this case about the interaction between data and control, but the results are worth the extra effort.
机译:结构化编程引入了访问程序指令的新学科。在适当的编程语言中,可以根据没有gotos的程序设计来描述该学科。例如,可以证明,如果存在序列,选择和迭代控制结构,则可以使用具有gotos的编程语言实现的任何功能结果都可以用没有gotos的相同语言来实现。指令允许随机访问指令,而顺序,选择和迭代则提供了更多受限和严格的访问方式。现在,我们介​​绍一种用于访问程序数据的新学科。在合适的编程语言中,可以根据没有数组和指针的程序设计来描述该学科。如果存在设置,堆栈和队列数据类型,则使用数组和指针的编程语言可实现的任何功能结果都可以以相同的语言实现,而无需数组和指针。数组和指针允许对数据的随机访问,而集合,堆栈和队列则提供了更多受限和严格的访问。尽管肯定有必要,但结构化编程中的决定性因素不是理论上的可能性。正是在工程设计现实中,才使程序的智力控制更有效。结构化编程实际上允许使用过程语言进行功能性编程。正确性的证明较为简单,但更重要的是,可以在功能代数中一起设计证明和程序,以通过逐步完善的过程构造来实现正确性。我们希望具有集合,堆栈和队列的程序设计中的决定性因素也将出现在工程设计现实中。通过结构化编程,可以通过将程序问题减少为功能性问题来实现智力上的杠杆作用,但通过限制数据的命名和访问方式,甚至可以发挥更大的杠杆作用。结果,没有-rray和指针的程序更短,更简单并且更容易证明。与没有getos的程序一样,它们需要更多的设计计划和思考,在这种情况下,它们是关于数据和控件之间的交互的,但是结果值得付出额外的精力。

著录项

相似文献

  • 外文文献
  • 中文文献
  • 专利
获取原文

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号