StudentShare
Contact Us
Sign In / Sign Up for FREE
Search
Go to advanced search...
Free

Programming Paradigms Comparison - Essay Example

Cite this document
Summary
The essay "Programming Paradigms Comparison" focuses on the critical analysis of the major issues in the comparison between programming paradigms. C+ objects are members of its classes. OOP possesses the feature of ‘Inheritance’, which enables it to import classes or subclasses…
Download full paper File format: .doc, available for editing
GRAB THE BEST PAPER97.1% of users find it useful
Programming Paradigms Comparison
Read Text Preview

Extract of sample "Programming Paradigms Comparison"

______________ ID: __________ ID: __________ Programming Paradigms: Compare and Contrast C++ has the following characteristics: C++ objects are members of its classes. OOP possess the feature of 'Inheritance', which enables it to import classes or sub classes from the base class to the super class. Reusability: Reusability allows the programmers to utilize the original program written and can modify as their requirement. OOP gives freedom to the programmer to construct new data types. C++ enjoys the benefit of 'Polymorphism' according to which a function or an operator acts in different manner on different data types. Pointers: the use of pointers is more common in C++ than in other languages. Due to pointers, a C++ program easily access array elements. It passes arrays, arguments and strings to a function, pointers helps a C++ program to obtain the preloaded memory from the system. Pointers help in creating complex data structures such as 'linked lists'. C++ possess the facility of using local and global variables, due to which a C++ program has the right to declare every method and function outside or within a class, local variables are often declared and initialized in C++ rather than global ones. C++ supports multiple inheritance of method implementations from more than one superclass at a time. While it seems like a very useful feature, adding it to the language turns out to introduce many complexities. (2006a) We have versions of C++ compilers that can be used to create 16-bit or 32-bit applications. The program compiled by a c++ compiler, is platform dependent. This means, a source file in C++ when compiled is converted into obj file, which contains machine codes and function calls for the built-in library functions. After this, the obj file is processed by the c++ linker utility, which patches the code of the library functions in order to resolve the library function calls and convert the obj file into exe file. More specifically this code patching is only for unregistered library functions, which are local to the C++ development environment. But when an external registered dll file is used in the source code, then the function calls in the obj file would not be resolved in the exe file and those function calls would be dynamically resolved at runtime of the executable file. Remember the executable file, executes standalone. The only dependency would be the external dll files. C++ supports templates that allow you, for example, to implement a Stack and then instantiate it as Stack < int > or Stack < double > to produce two separate types: a stack of integers and a stack of floating point values. (2006a) C++ allows you to define operators that perform arbitrary operations on instances of your class. In effect, it allows extending the syntax of the language. This is a nifty feature, called operator overloading, tat makes for very elegant examples. (2006a) C++ has the ability to include preprocessor directive in the beginning of a program. (import file name from the library). Java possess the following characteristics: Java does not have any concept of pointers. The Java Runtime Environment by default reference the objects for the programmer. Java does not allow programmer to manipulate pointers or memory addresses of any kind and imposes certain restrictions in this respect (2006a): It does not allow casting object or arraying references into integers or vice versa. It does not allow you to do pointer arithmetic. It does not allow you to compute the size in bytes of any primitive type or object. Some of the reasons are: Pointers are a source of bugs. Eliminating them simplifies the language and eliminates many potential bugs (2006a). Pointers and pointer arithmetic could be used to sidestep Java's run-time checks and security mechanisms. Removing pointers allows Java to provide the security guarantees that it does (2006a). No Global Variables: In Java, every field and method is declared within a class and forms part of that class. The fields and methods of a class are known as the members of a class. (2006b) No Multiple Inheritance: The Java language designers chose to avoid the added complexity by using interfaces instead. Thus, a class in Java can only inherit method implementations from a single superclass, but it can inherit method declarations from any number of interfaces. In practice, this is not any particular hardship. (2006b) Java does not support templates. However, the fact that every class in Java is a subclass of Object means that every object can be cast to an instance of Object. Thus, in Java, it is often sufficient to define a data structure (such as a Stack class) that operates on Object values, the objects can be cast back to their actual type whenever necessary (2006b). Java does not support any type of operator overloading, however it supports method overloading. Java does not include any kind or preprocessor directive. All versions of java compiler only create 32-bit applications The program compiled by java compiler, is platform independent. This means, a source file in java when compiled by the java compiler, is translated into in byte code (intermediate code) and saved as class file. Since this class file does not contain the machine code, so it would not be able to execute as a standalone application. In order to run a java class, the JVM (java virtual machine) is required. This JVM contains the required library of classes contained in jar and zip file formats. The JVM also contains the java interpreter, which converts byte codes of class file into machine code and execute it. The java interpreter resolve every function call by looking up into the JVM built in library. A feature that Java has borrowed from C++ is the ability to declare and initialize local variables anywhere in a method body or other block of code. Declarations and their initializers no longer have to be the first statements in any block - you can declare them where it is convenient and fits well with the structure of your code. A technique that Java borrows from C++ is called method overloading. Overloaded methods are methods that have the same name, but have different signatures. In other words, they take different types of arguments, a different number of arguments, or the same type of arguments in different positions in the argument list. You cannot overload a method by changing only its return type. Two methods with the same name may have different return types, but only if the method arguments also differ. Similarly, two overloaded methods may throw different exceptions, but only if their arguments differ as well. Method overloading is commonly used in Java to define a number of related functions with the same name, but different arguments. Overloaded methods usually perform the same basic operation, but allow the programmer to specify arguments in different ways depending on what is convenient in a given situation. The main difference between C++ and Java is the concept of 'Object Manipulation'. " In Java, every function must be an instance method or a static function of a class. C++ supports instance methods and static functions of classes, but it also permits functions that are not a part of any class. Such functions are called global functions. As in Java, function arguments are passed by value. In Java, functions were nevertheless able to modify objects. However, since C++ object values are not references to actual objects, a function receives a copy of the actual argument and hence can never modify the original. Therefore, C++ has two parameter passing mechanisms, call by value (as in Java) and call by reference. When a parameter is passed by reference, the function can modify the original. Call by reference is indcated by an & behind the parameter type". (2006b) Haskell Haskell is a modern, standard and a pure functional programming language that refers to those developmental applications that require shorter, clearer and maintainable code. Unlike C++, it does not actually based upon programming, rather it emphasizes upon specification, design and maintenance of application. Haskell is more like Java than C++ because of the reason that Java is an imperative language. It supports strong typing like Pascal however; Haskell's type system is much less restrictive than, Pascal's, because it uses polymorphism, which enhances the feature of reusability. Haskell has the following features: No Mutable Variables: One of the most common programming habits in imperative programming is to assign a variable one value, then assign it a different value; perhaps along the way we test whether the variable has obtained certain key values. In Haskell, by contrast, variables of this sort do not exist at all. A name can be bound to a value, but once assigned, the name simply stands for that value throughout the program. Nothing is allowed to change. In Haskell, 'variables' are much like the variables in mathematical equations. They may need to satisfy certain rules, but they are not 'counters' or 'containers' in the style of imperative programming. No Loops: Another interesting feature of Haskell is its lack of any loop construct. There is no for and no while loop. There is no GOTO or branch or jmp or break. No Program Order: Another thing Haskell lacks or does not need is program order. The set of definitions that make up a program can occur in any order whatsoever. This might seem strange when definitions look a great deal like assignments in imperative languages. Recursion: Absent loop structures, flow in Haskell programs is usually expressed as recursion. Thinking about all flow in terms of recursion takes some work, but it turns out to be just as expressive and powerful as the while and for constructs in other languages. Prolog PROLOG is an AI (Artificial Intelligence) language. Its basic idea is to express statements of logic as statements in programming language. Because a PROLOG program is a series of statements in logic, it can be understood declaratively that is it can be understood separately from considerations of how it will be executed. " It originally became popular with AI researchers, who know more about 'what' and 'how' intelligent behaviour is achieved. The philosophy behind it deals with the logical and declarative aspects. Prolog represents a fundamentally new approach to computing and became a serious competitor to LISP". (Rana Omer, 2006d) It has the following features: Intelligent Systems - programs which perform useful tasks by utilizing artificial Intelligence techniques. (2006d) Expert Systems - intelligent systems which reproduce decision-making at the level of a human expert. (2006d) Natural Language Systems - which can analyze and respond to statements made in ordinary language as opposed to approved keywords or menu selections. (2006d) Relational Database Systems. (2006d) "Prolog is interpreted, declarative and contains a series of definitions, which are accessed as required by the program during execution. In Prolog there can be only two conditions, either true or false. Prolog programs contain a set of facts and rules. Aspects of the problem, which are true or false, are described (defined), rather than the method to achieve a result, while Pascal programs contains a series of Instructions given to the computer as procedures to perform. The order of doing things is specified and a number of actions are performed as a consequence". (Rana Omer, 2006d) Pascal "Pascal is a strongly typed, block structured programming language. The 'type' of a Pascal variable consists of its semantic nature and its range of values, and can be expressed by a type name, an explicit value range, or a combination thereof. The range of values for a type is defined by the language itself for built-in types, or by the programmer for programmer defined types. Programmer-defined types are unique data types defined within the Pascal TYPE declaration section, and can consist of enumerated types, arrays, records, pointers, sets, and more, as well as combinations thereof. When variables are declared as one type, the compiler can assume that the variable will be used as that type throughout the life of the variable (whether it is global to the program, or local to a function or procedure). This consistent usage of variables makes the code easier to maintain. The compiler detects type inconsistency errors at compile time, catching many errors and reducing the need to run the code through a debugger". (Catambay Bill) Additionally, it allows an optimizer to make assumptions during compilation, thereby providing more efficient executables. As John Reagan, the architect of Compaq Pascal, writes, "it was easy to write Pascal programs that would generate better code than their C equivalents" because the compiler was able to optimize based on the strict typing. Recursion: Pascal also supports recursion, a powerful computing tool that allows a function or procedure within a program to make calls to itself. This allows for elegant and efficient coding solutions, eliminating the need for tedious loops. (Catambay Bill, The Pascal Programming Language) C++ and Pascal are similar languages, and as Catambay has said, "I have converted several C source code projects, and even a few C++ projects, to Pascal and Object Pascal, and I've seen a variety of coding styles. The process of converting a C program to a Pascal program provides first hand experience in the differences between the two languages. In Pascal, declarations must be moved to the top of a block, and often a lot of investigation is required to decipher many of the C data structures. During the conversion process, I reorganize the code, changing and indenting it to make it more readable, so that the actual translation process is much easier. It's a significant amount of work, however, and in some cases the difficulty was so extreme that I canceled the task." (Catambay Bill, The Pascal Programming Language) Squeak Smalltalk is a programming environment within which the boundaries among operating systems, compilers, editors, utilities, data and application programs become blurred. Hundreds of classes and methods are provided with an extensive use of icons, windows and a mouse. Related products are Smalltalk 80 and Smalltalk V. Like C++ and Java, Smalltalk comes under the category of an OOP language. "Squeak is a modern, open source, highly portable, fast and full-featured implementation of the Small talk programming language, which is based upon the grounds of object, oriented technology. Smalltalk influenced most of the modern object-oriented languages, although most of the time they missed Smalltalk's elegance and simplicity". (2006c) Smalltalk is based upon the following concepts: Everything is an object, which communicate via message passing. Classes describe in terms of state (instance variables) and behavior (methods) the objects they generate. (2006c) When an object receives a message, the corresponding method is looked up in the class (and superclass) of the receiver. (2006c) Methods and Instance variables are public. Classes inherit via single inheritance. (2006c) Work Cited 2006a < http://www.sci.brooklyn.cuny.edu/cis22/java/jvcpp.html > 2006b < http://www.horstmann.com/ccj2/ccjapp3.html > 2006c, < http://www.squeak.org/ > 2006d, Rana Omer < http://users.cs.cf.ac.uk/O.F.Rana/prolog/lectureP1/node7.html > Catambay Bill, "The Pascal Programming Language". Kim, Steven H. (1991). Knowledge Systems through Prolog. New York, New York: Oxford University Press, Inc. Moss, Chris. (1994). Prolog++: The power of Object-Oriented and Logic Programming. Addison-Wesley Publishing Company Inc. Read More
Cite this document
  • APA
  • MLA
  • CHICAGO
(“Programming Paradigms Comparison Essay Example | Topics and Well Written Essays - 2500 words”, n.d.)
Retrieved from https://studentshare.org/miscellaneous/1521968-programming-paradigms-comparison
(Programming Paradigms Comparison Essay Example | Topics and Well Written Essays - 2500 Words)
https://studentshare.org/miscellaneous/1521968-programming-paradigms-comparison.
“Programming Paradigms Comparison Essay Example | Topics and Well Written Essays - 2500 Words”, n.d. https://studentshare.org/miscellaneous/1521968-programming-paradigms-comparison.
  • Cited: 0 times

CHECK THESE SAMPLES OF Programming Paradigms Comparison

Computer Programming Languages Classification

This report "Computer Programming Languages Classification" presents three (3) main categories of the computer programming languages and presents an introduction to the programming languages, types of programming languages, comparison of the programming languages.... It is pertinent to compare the programming languages based on the categories of the languages as well as predefined comparison criteria that should be used.... hellip; Computer programming languages are engineered by human beings for conveying instructions to the machines solving their problems....
5 Pages (1250 words) Report

Parallelism in Computing

This essay "Parallelism in Computing" is about technology, called Multi-programming, several programs used to run simultaneously on a single processor.... ulti-programming Vs Multi-Processing:Multi-programming:Earlier computers were able to do only one thing at a time.... ulti-Processing:As it was quite evident, processor speed was always a major bottleneck in a Multi-programming environment.... omparison:The first and quite obvious advantage that Multi-Processing systems have over Multi-programming systems is that since the work is divided between two or more processors, proportionately higher speed can be achieved....
5 Pages (1250 words) Essay

A comparison of CORBA and Web Services

Distributed Applications refer to the applications which can be distributed across different processors and computer systems.... his concept helps in deploying an application across systems on a network which might be working a common project or an application.... hellip; Distribution introduces a whole new set of semantics for ease of computing; some applications by their very nature are distributed across multiple computers because of one or more of the following reasons (Chaffee & martin, 1999):There are some applications which might need to access common data Distributed Applications refer to the applications which can be distributed across different processors and computer systems....
16 Pages (4000 words) Essay

The Future of Advanced Business Application Programming

The other objective of this paper is to identify ABAP's competition for this purpose this paper will provide a comparison with JAVA based environment of NETWEAVER.... This paper “The Future of Advanced Business Application programming” discusses the future of Advanced Business Application programming (ABAP) which is a fourth generation programming language was created by SAP.... ABAP stands in Advanced Business Application programming....
11 Pages (2750 words) Assignment

Computer Programming: The Advantages of Object Oriented Programming

As it is figured out the total cost of investments of taking expertise and effective knowledge of C-sharp computer programming training would be small enough in comparison to how much we pay for studying law or medicine in college.... The author also analyzes the statement that 'to operate' a computer is far easier, yet less powerful, than 'to program' a computer and discusses the advantages of object-oriented programming.... hellip; An entry-level programming job is preferred by the students, new graduates, and part-time workers....
6 Pages (1500 words) Assignment

Model-Based Systems Design

The paper "Model-Based Systems Design" presents that in comparison to model-based methodologies, agile methodology is more about teamwork and communication than it is about fixed rules, fixed roles, and a linear model of project progression and completion.... It is a fairly recent development....
6 Pages (1500 words) Essay

A Comparison of Programming Languages

"A comparison of Programming Languages" paper compares three scripting languages.... Another feature comparison among the three languages is the interactive development with the interpreter.... These tasks are powered by several programming languages.... The proliferation of the internet is the main key to the emergence of the scripting programming languages, specifically designed for data and string processing, and for CGI scripts....
5 Pages (1250 words) Coursework

Lisp Programming Language

The writer of the paper “Lisp programming Language” states that as a major benefit of Lisp it is used in the explorative nature of assignments with active semantics.... Lisp is one of the oldest programming languages among Fortran and Cobol and it has also been linked to Artificial Intelligence (AI) since its inception.... It established the notion of incremental compilation in functional programming.... In 1970, LISP usage in commercial programming by AI extended to an extent that it produced the need to invent machinery, which could support unlimited functioning of it (Ivancevic, Vladimir, Tijana and Ivancevic, 139)....
8 Pages (2000 words) Article
sponsored ads
We use cookies to create the best experience for you. Keep on browsing if you are OK with that, or find out how to manage cookies.
Contact Us