Web Hosting How-Tos

  Home arrow Web Hosting How-Tos arrow Page 2 - Learning a New Programming Language Pa...
Web Hosting Articles  
Web Hosting FAQs  
Web Hosting How-Tos  
Web Hosting News  
Web Hosting Reviews  
Web Hosting Security  
Weekly Newsletter 
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
WEB HOSTING HOW-TOS

Learning a New Programming Language Part 2: Language Types
By: Chris Root
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 13
    2005-05-04

    Table of Contents:
  • Learning a New Programming Language Part 2: Language Types
  • Code reuse and inheritance
  • Procedural Languages
  • Functional Languages

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     

    SEARCH WEB HOSTERS

    TOOLS YOU CAN USE

    advertisement

    Learning a New Programming Language Part 2: Language Types - Code reuse and inheritance


    (Page 2 of 4 )

    Object oriented languages are designed around the idea of reusing code. Careful coding can allow a class (which is a template for making objects) or hierarchical group of classes (often called a package) to be used in multiple projects by providing a generic service to the application, such as interfacing with a network protocol or parsing and processing any XML file. Every time you have a project that needs that type of functionality, you use that class or group of classes to provide it. There is no need to write that code again and again.

    Java and C# are both examples of languages that were designed with object orientation from the start. In both languages, even the main application code is contained in a class.

    PHP and Perl are examples of procedural languages that have had OO features added on. Both can be used in an object oriented fashion. However, in the case of PHP, for instance, there is no such thing as a private method. In OO private methods are for use internally by the class or object made from a class. Other code or objects are generally not allowed access to private methods.

    Inheritance is considered another key OO feature. In an OO language classes are arranged in a hierarchy. Superclasses, which are at the top of the hierarchy, are very generic basic templates of objects. Below this are subclasses that inherit properties and methods from the superclass. A motorcycle superclass, for instance, could contain properties and methods that are common to all motorcycles. Subclasses of this class could represent different types of motorcycles.

    We could drill down as far as we needed to in this example. In fact our motorcycle Superclass could actually be a subclass of a vehicle class that contains properties and methods that are common to all vehicles.

    The details of inheritance, polymorphism and interfaces are beyond the scope of this article, but this should give you a start. In order to get your head around OO you will need to understand the concepts that make it unique. Moving from a procedural language to OO is not as hard as it sounds, but it is more than just syntax. Try to find material that demonstrates the concepts in a visual manner and don't let the buzzwords bother you.

    Languages that are generally considered object oriented by design include C++, Objective C (an object oriented subset of C), Smalltalk and Java to name a just a few.

    More Web Hosting How-Tos Articles
    More By Chris Root

    WEB HOSTING HOW-TOS ARTICLES

    - Phishing Scams: An Overview and How to Detec...
    - Tips for Safe Downloading Online
    - How To Avoid Spam
    - How to Get Into Ethical Hacking
    - How to Prevent Drive-by Downloads
    - Facebook Timeline Tips and Tricks
    - How to Keep Up with Facebook`s Changes
    - Wi-Fi Network Security Tips
    - Tips for Safe Online Holiday Shopping
    - Facebook Privacy: Keeping Up with the Const...
    - Tips for Facebook Privacy
    - How to Cover Your Tracks on the Web
    - SSH Keys for FileZilla and Putty in Cpanel
    - How to Create a Filezilla FTP User
    - How to Install FileZilla Server

    Developer Shed Affiliates

     




    © 2003-2017 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap