首页 | 本学科首页   官方微博 | 高级检索  
相似文献
 共查询到20条相似文献,搜索用时 46 毫秒
1.
At a fundamental level, functional and object-oriented programming languages are all ‘higher-order’, in the sense that they support computing with values that are themselves pieces of program code encapsulated with a local environment. In functional languages these ‘active’ values are functions, while in object-oriented languages they are objects. Both styles of higher-order language claim to provide good support for writing adaptable programs, but functional and object-oriented languages achieve this adaptability in different ways: functional programs rely on parameterisation at the value, type and module level, while object-oriented languages rely primarily on subtyping and implementation inheritance. Here we compare these two approaches, mainly in terms of the features and properties of their type systems, and consider the benefits and disadvantages of unifying (or merging) the two paradigms by adding object-oriented features to ML as a base language. We argue that while some of the simpler aspects of object-oriented languages are compatible with ML, adding a full- edged class-based object system to ML leads to an excessively complex type system and relatively little expressive gain, especially if we aim to preserve that mostly functional style of programming that is a major advantage of ML. Received March 2002 / Accepted in revised form April 2002  相似文献   

2.
In object programming languages, the Visitor design pattern allows separation of algorithms and data structures. When applying this pattern to tree‐like structures, programmers are always confronted with the difficulty of making their code evolve. One reason is that the code implementing the algorithm is interwound with the code implementing the traversal inside the visitor. When implementing algorithms such as data analyses or transformations, encoding the traversal directly into the algorithm turns out to be cumbersome as this type of algorithm only focuses on a small part of the data‐structure model (e.g., program optimization). Unfortunately, typed programming languages like Java do not offer simple solutions for expressing generic traversals. Rewrite‐based languages like ELAN or Stratego have introduced the notion of strategies to express both generic traversal and rule application control in a declarative way. Starting from this approach, our goal was to make the notion of strategic programming available in a widely used language such as Java and thus to offer generic traversals in typed Java structures. In this paper, we present the strategy language SL that provides programming support for strategies in Java. Copyright © 2012 John Wiley & Sons, Ltd.  相似文献   

3.
Stroustrup  B. 《Software, IEEE》1988,5(3):10-20
The meaning of the term `object oriented' is examined in the context of the general-purpose programming language C++. This choice is made partly to introduce C++ and partly because C++ is one of the few languages that supports data abstraction, object-oriented programming, and traditional programming techniques. The support of programming paradigms by languages is discussed and four paradigms are examined: procedural, data hiding, data abstraction, and object-oriented programming. The support of the latter two by C++ is discussed in some detail  相似文献   

4.
More and more aspects of concurrency and concurrent programming are becoming part of mainstream programming and software engineering, due to several factors such as the widespread availability of multi-core/parallel architectures and Internet-based systems. This leads to the extension of mainstream object-oriented programming languages and platforms-Java is a main example-with libraries providing fine-grained mechanisms and idioms to support concurrent programming, in particular for building efficient programs. Besides this fine-grained support, a main research goal in this context is to devise higher-level, coarse-grained abstractions that would help building concurrent programs, as pure object-oriented abstractions help building large component-based programs. To this end, in this paper we present simpA, a Java-based framework that provides programmers with agent-oriented abstractions on top of the basic OO layer, as a means to organize and structure concurrent applications. We first describe the application programming interface (API) and annotation framework provided to Java programmers for building simpA applications, and then we discuss the main features of the approach from a software engineering point of view, by showing some programming examples. Finally, we define an operational semantics formalizing the main aspects of this programming model.  相似文献   

5.
In this article, an ongoing research project held in the Computer Science department of the University of Vigo is described. Its main objective is to develop an interactive object-oriented environment, serving as a vehicle for learning object-oriented programming. It currently consists of a virtual machine, an assembler, compilers for two high-level programming languages, and an educational visual programming environment. Its main characteristics are (a) the support of prototype-based object orientation, which is a model of object orientation that actually wraps the class-based model; (b) the support for object persistence, which simplifies all input/output issues to the minimum, and (c) the availability of a new visual programming environment is an invaluable help. We the authors think that the combination of all of these possibilities, will lead to an interesting, useful tool that would be recommended for object-oriented teaching. The whole system has been successfully employed in a number of different courses, allowing students to concentrate on objects and their relationships from the very beginning, and thus helping them to achieve a high degree of knowledge about the object-oriented programming paradigm.  相似文献   

6.
The arrival of multicore systems, along with the speed‐up potential available in graphics processing units, has given us unprecedented low‐cost computing power. These systems address some of the known architecture problems but at the expense of considerably increased programming complexity. Heterogeneity, at both the architectural and programming levels, poses a great challenge to programmers. Many proposals have been put forth to facilitate the job of programmers. Leaving aside proposals based on the development of new programming languages because of the effort this represents for the user (effort to learn and reuse code), the remaining proposals are based on transforming sequential code into parallel code, or on transforming parallel code designed for one architecture into parallel code designed for another. A different approach relies on the use of skeletons. The programmer has available set of parallel standards that comprise the basis for developing parallel code while programming sequential code. In this context, we propose a methodology for developing an automatic source‐to‐source transformation in a specific domain. This methodology is instantiated in a framework aimed at solving dynamic programming problems. Using this framework, the final user (a physician, mathematician, biologist, etc.) can express her problem using an equation in Latex, and the system will automatically generate the optimal parallel code for homogeneous or heterogeneous architectures. This approach allows for great portability toward these new emerging architectures and for great productivity, as evidenced by the computational results.Copyright © 2012 John Wiley & Sons, Ltd.  相似文献   

7.
Software development is moving from procedural programming towards object-oriented programming (OOP). Past studies in cognitive aspects of programming have focused primarily on procedural programming languages. Object-oriented programming is a new paradigm for computing. Industry is finding that programmers are having difficulty shifting to this new programming paradigm. Findings in prior research revealed that procedural programming requires Piaget's formal operation cognitive level. New from this research is that OOP also requires Piaget's formal operation cognitive level. Also new is that OOP appears to be unrelated to hemispheric cognitive style. OOP appears to be hemispheric style friendly, while procedural programming is preferential to left hemispheric cognitive style. The conclusion is that cognitive requirements are not the cause for the difficulty in shifting from procedural to OOP. An alternative possibility to the difficulty is proactive interference of learning procedural programming prior to learning object oriented programming.  相似文献   

8.
In current-day software development, programmers often use programming patterns to clarify their intents and to increase the understandability of their programs. Unfortunately, most software development environments do not adequately support the declaration and use of such patterns. To explicitly codify these patterns, we adopt a declarative meta programming approach. In this approach, we reify the structure of a (object-oriented) program in terms of logic clauses. We declare programming patterns as logic rules on top of these clauses. By querying the logic system, these rules allow us to check, enforce and search for occurrences of certain patterns in the software. As such, the programming patterns become an active part of the software development and maintenance environment.  相似文献   

9.
Visual languages have been widely used to help people create animation programs. However, current programming environments lack features supporting efficient code exploration and program comprehension, particularly for understanding relationships among parts of animation programs. In this paper, we present novel interactive visualizations aimed at helping people to understand animation programs. We conducted an empirical study to evaluate the impact of these visualizations on programmer comprehension of the code, showing that our approach enabled programmers to comprehend more information with less effort and in less time. This result is potentially significant because it demonstrates an approach for helping users to explore and understand animation code. We anticipate that this approach could be applied in a wide variety of animation programming tools, which could ease common animation programming tasks that require understanding code.  相似文献   

10.
This paper presents one experiment to explain why and under which circumstances visual programming languages would be easier to understand than textual programming languages. Towards this goal we bring together research from psychology of programming and image processing. According to current theories of imagery processing imagery facilitates a quicker access to semantic information. Thus, visual programming languages should allow for quicker construction of a mental representation based on data flow relationships of a program than procedural languages. To test this hypothesis the mental models of C and spreadsheet programmers were assessed in different program comprehension situations. The results showed that spreadsheet programmers developed data flow based mental representations in all situations, while C programmers seemed to access first a control flow and then data flow based mental representations. These results could help to expand theories of mental models from psychology of programming to account for the effect of imagery.  相似文献   

11.
R++: adding path-based rules to C++   总被引:1,自引:0,他引:1  
Object-oriented languages and rule-based languages offer two distinct and useful programming abstractions. However, previous attempts to integrate data-driven rules into object-oriented languages have typically achieved an uneasy union at best. R++ is a new, closer integration of the rule-based and object-oriented paradigms that extends C++ with a single programming construct, the path-based rule, as a new kind of class member. Path-based rules-data-driven rules that are restricted to following pointers between objects-are like automatic methods that are triggered by changes to the objects they monitor. Path-based rules provide a useful level of abstraction that encourages a more declarative style of programming and are valuable in object-oriented designs as a means of modeling dynamic collections of interdependent objects. Unlike more traditional pattern-matching rules, path-based rules are not at odds with the object-oriented paradigm and offer performance advantages for many natural applications  相似文献   

12.
作为面向对象程序设计语言后继的新一代编程语言,面向方面程序设计语言早先主要应用于软件设计领域。基于AspecC++和SystemC,本文提出了一种新的在系统层次构建硬件模块原型的方法。该方法可以用于硬件系统的快速设计空间搜索。本文以一个32位加法器的例子显示了该方法的有效性。  相似文献   

13.
14.
Model-based development (MBD) holds the promise to capture potential timing problems in embedded software during the early phases of the development, securing the production of bug-free embedded software. For most MBD approaches, the source code is just an intermediate artifact that can be generated automatically from the models. This assumption clashes with an undeniable fact: a large share of the commercial embedded software exploits existing libraries or is developed using C/C++ natively. A way to reconcile the ambitions of MBD with the use of a programming language is by offering new language constructs and an innovative compilation tool-chain that prevents model error and timing problems “by construction.” However, the persistent popularity of C/C++ among embedded programmers and the limited availability of tools have severely limited the uptake of alternative programming languages for embedded software. Therefore, we propose an original route. Our language proposal, named Tice, has been shaped as a C++ active library. Tice retains full compatibility with existing C++ code, which can be integrated easily into new Tice-based projects. The enforcement of Tice syntax and semantics can be made by a standard C++ compiler, forgoing the need for new tools. In this article, we describe Tice's syntax, semantics, and model of computation and communication. We demonstrate Tice's practical applicability on an industrial scale use-case and give ample evidence for Tice's efficient compilation using off-the-shelf C++ compilers. Finally, we show Tice's code generation process.  相似文献   

15.
A message-passing class library C++ for portable parallel programming   总被引:1,自引:1,他引:0  
An object-oriented message-passing class library in C++, called PPI++, for portable parallel programming has been developed. PPI++ (parallel portability interface in C++) is designed to serve as a stable (unchanging) interface between the client parallel code and the rapidly evolving distributed computing environments. By taking advantage of encapsulation, inheritance, and polymorphism supported by C++, PPI++ provides a clean and consistent programming interface, which helps improve the clarity and expressiveness of client parallel codes and hides implementation details and complexity from the user to ease parallel programming tasks. In addition, the use of strong type-checking in C++ allows the detection of potential misuses of the library at compile time, and thus promotes code reliability. This paper describes the object-oriented design and implementation of PPI++. Evaluation of PPI++ on important performance issues, such as portability, ease-of-use, extensibility, and efficiency, is also discussed.  相似文献   

16.
Several studies have suggested that the mental structures of programmers of procedural languages have a close relationship with a model of structural knowledge related to functional information known as programming Plans. It also has been claimed that experienced programmers organize this representation in a hierarchical structure where some elements of Plans are focal or central to them. However, it is not clear that this is the case for other types of programming languages, especially for those which are significantly different from the procedural paradigm.The study reported in this paper investigates whether these claims are true for Prolog, a language which has important differences to procedural languages. Prolog does not have obvious syntactic cues to mark blocks of code (begin/end, repeat/until, etc). Also, its powerful primitives (unification and backtracking) and the extensive use of recursion might influence how programmers comprehend Prolog code in a significant way.The findings of the study suggest that Plans and functional information are important for Prolog programmers, but that there is also at least another model of structural knowledge valid for this language. This model of structural knowledge, Prolog schemas, is related to data structure information and it seems that a hierarchical organisation that highlights the relevance of some of its elements as focal is valid for Prolog. These results support the view that comprehension involves the detection of varying aspects of the code and that each of the structures related to these aspects might have their own organization and hierarchical relations.  相似文献   

17.
A widely useful technique for implementing complex programs is to use multiple threads of execution. Unfortunately, when we multithread a program we introduce the potential for bugs caused by unprotected critical sections. A widely useful technique for reducing the number of critical sections, and hence the number of bugs, is that of active objects. This paper presents a design for active objects that is easy to understand, implement and use in any sufficiently powerful object-oriented programming language. We show the implementation and use of our design in both the JavaTM and C++ programming languages. © 1998 John Wiley & Sons, Ltd.  相似文献   

18.
This paper describes an experiment in the development of a small piece of software in both the languages C and C++ in a university setting. The C++ codes were found to be more modular than the corresponding C codes. Some of the other effects of C++ on program quality are very briefly discussed. The paper also discusses some of the errors that C programmers may make as novice C++ programmers, and the testing of object-oriented programs. Some of the error types possible in C++, but not in C, include delays in the flushing of output buffers and polymorphism.  相似文献   

19.
20.
C++语言是当前十分流行的、面向对象程序设计语言。通过对C++语言的深入研究以及较多的编程实践,总结归纳了C++语言的知识体系和编程中的几个常见问题,比如构造函数、对象指针、const数据和成员的访问属性等,对这些容易搞混淆的问题逐一进行详尽的分析和说明,并解释了其原因所在。通过阅读该文可为编程者带来有益的帮助,以便编程中碰到同类问题时能够解决。  相似文献   

设为首页 | 免责声明 | 关于勤云 | 加入收藏

Copyright©北京勤云科技发展有限公司  京ICP备09084417号