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 Security  
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter 
 
Developer Updates  
Free Website Content 
ASP Web Hosting  
ASP.NET Web Hosting 
Budget Hosting 
Coldfusion 
Colocation 
Mobile Linux 
APP Generation ROI 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Reseller Web Hosting 
Shared Hosting 
Small Business Hosting 
Virtual Private Servers 
Windows Web Hosting
 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
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 / 8
    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
     
     
    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


       · And then there's Prolog ...
     

    WEB HOSTING HOW-TOS ARTICLES

    - Choosing a Web Host for Your WordPress Blog
    - Connecting to a Server using SSH: the Fundam...
    - How to Expand a Simple Website
    - Practical Virtualization with VirtualBox
    - Other Uses for Your Web Hosting Server
    - Hosting Your Own Website: Reliability
    - Introduction to Hosting Websites
    - Choosing a Website Host
    - How to Choose a Budget Web Host
    - URL Redirection
    - How to Link a Domain Name to a Dynamic IP
    - How to Set up a Simple Website
    - Choosing the Right Kind of Web Hosting
    - Introduction to Choosing the Right Web Host
    - Strategies for Creating Domain Names






    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 4 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek