This Research problem is aiming to compare and contrast four programming languages according to programming paradigms and the features with the purpose of determining the suitability and applicability of the languages for each criterion, distinguish them with their pros and cons, evaluate and explore the related features on those languages.
For this I have selected one language from each programming paradigm (imperative, object-oriented, functional, logic) and compared it with the Iterative statements feature. The comparing and contrasting is based on the following design characteristics:
• Syntax
• Semantics
• Readability, writeability, reliability
• Implementation (i.e., how the feature is compiled and executed)
• Evolution …show more content…
It is very easy to understand most especially in the beginners of programming. It has incredibly compact language syntax for iterative statements, and in that functions tend to take very little vertical space. The indented statements makes it more readable. And it is an easy writing language too. It has an ability for the function to return more than one parameter. It also has a very clear flow from top to bottom that allows easy writing of the code. It is also a highly reliable language as it is highly able to debug an error creep into the …show more content…
The loop predicate is defined as loop from N, the Statements loop is executed until the condition get false. Increment(N) is used to increment or decrement the loop count. And loop(n) is again called to attain the loop concept recursively. And when the value N becomes ‘0’ the loop stops.
• In Prolog, only few statements can be combined in complex ways. Therefore, it is simple and it is not as readable as written logic. When comes to writablity, it is easy to write for basic programs, for advance programming it lacks simplicity and data types. For loops compared to other programming languages which provides looping facility, Prolog is hard to implement the logic. And also the lack of imperative design limits its scope. Prolog is not reliable too. It is easy to write endless loops due to its “left-to-right depth-first order of evaluation”. Also, Prolog does not recognize the information outside of its limited amount of internal information. If there is insufficient information in the database, Prolog will assume goals to be false even if they are really