JAVA, C++, Python, Object-C, Delphi , and Ruby are all Object Oriented Programming languages. As Object-Oriented Programming languages they share certain essential components/features such as: objects, classes, encapsulation, inheritance, and polymorphism. Objects in OOP (Object Oriented Programming) are data and the methods (operations) that are performed on the data. An object combines the two into a single unit. Classes are user defined blueprints for objects. They contain all of the properties, attributes, variables, functions, and methods of an object. Encapsulation in OOP refers to the protection of an object’s attributes, status, and variables from anything outside the object. The object has a sort of “capsule” that will block outside influences or code from affecting or modifying it. Inheritance in OOP refers to the way classes can be derived from other classes. The derived class inherits all attributes and methods from its super class, the class from which it is derived. It then becomes a sub class. This inheritance feature facilitates reusability of the code. The polymorphism in OOP is the ability of objects of different data types to work with methods of the same name, yet do the correct type specific action.
Although JAVA, C++, Python, Object-C, Delphi and Ruby share the same general features based on being a part of the OOP methodology they do have differences. For example, Ruby and Python are both dynamically typed languages that are interpreted rather than compiled. This increases productivity for some programs because the development cycle is quicker. When a change is made, it doesn’t have to be compiled again. On the other hand, JAVA, C++, Objective-C, and Delphi are all statically typed languages which decreases productivity initially but may contribute to more correctly written code. JAVA, Objective-C, and C++ are compiled languages. The development cycle for complied languages may be longer, but the execution is faster. Another interesting difference is that they all have different inheritance rules. C++ and Python allow for multiple inheritances and JAVA, Objective-C, and Ruby only allow for single inheritance.
Additionally, Ruby and Objective-C are especially suited for specific purposes. Ruby is primarily used for websites and web applications. Objective-C is primarily used for Apple’s Cocoa framework in the iPhone and iPad. Then there is ease of use and learning. From my research, C++ is by far the hardest of the six to learn. Ruby and Python claim to be the easiest.
When researching these languages, I was surprised to find how emphatic some programmers are in their preference to one OOP program over another. I came across a really enlightening article by Steve Ferg, Python and Java: A Side by Side Comparison, not only did it really help me to understand Python better, but the following quote really struck me as simple and noteworthy,
“Programming languages are tools, and different tools are appropriate for different jobs. It is a poor workman whose toolbox contains only a hammer (no matter how big it is!), and it is a poor programmer (or software development organization) whose development toolkit contains only one programming language.”
Being a novice in this field, these are words of wisdom. Some languages are better than other but it all depends on what you are trying to do. This is very simple concept and I’ll keep it in mind in the future.
References:
http://delphi.about.com/gi/o.htm?zi=1/XJ&zTi=1&sdn=delphi&cdn=compute&tm=328&gps=246_67_1362_537&f=00&su=p284.9.336.ip_p504.1.336.ip_&tt=2&bt=0&bts=0&zu=http%3A//www.gekko-software.nl/DotNet/Art01.htm
No comments:
Post a Comment