The Artima Developer Community
Sponsored Link

Agile Buzz Forum
The Basis of Object Oriented Programming

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
James Robertson

Posts: 29924
Nickname: jarober61
Registered: Jun, 2003

David Buck, Smalltalker at large
The Basis of Object Oriented Programming Posted: May 20, 2005 8:50 PM
Reply to this message Reply

This post originated from an RSS feed registered with Agile Buzz by James Robertson.
Original Post: The Basis of Object Oriented Programming
Feed Title: David Buck - Blog
Feed URL: http://www.cincomsmalltalk.com/rssBlog/buck-rss.xml
Feed Description: Smalltalk can do that
Latest Agile Buzz Posts
Latest Agile Buzz Posts by James Robertson
Latest Posts From David Buck - Blog

Advertisement

These days, everyone knows the foundations of object oriented programming - Encapsulation, Polymorphism, and Inheritance. Nobody (well, almost nobody) seems to argue that these concepts aren't important. But why is it that they are important? How do they help software development?

Consider encapsulation. It hides the implementation of an object behind a set of methods and only accesses the implementation through the methods. This means that we can change the implementation of a class without changing all the users of the class. So? So, it's easier to make changes to our system.

How about polymorphism? Why is polymorphism important? With polymorphism, we can treat different classes of objects in the same way. So? Well, the caller doesn't have to worry about what specific kind of object it's talking to. So? So it's easier to write the calling code.

How about inheritance? Inheritance allows you to implement a new class without having to re-implement a lot of code. So? So, it's easier to write the new class.

Do you see a pattern here? The key is ease of development. Encapsulation, polymorphism and inheritance all make it easier to write code. Software development is hard. OO techniques try to make it easier.

Now, let's look at some other programming concepts. How about static typing? The purpose of static typing is to try to prevent the programmer from making mistakes. To do so, most statically typed programming languages require the programmer to explicitly state the types of all variables. These types then act as a restriction on what the programmer is allowed to do. At times, the programmer must explicitly cast the types in order to make the system work properly. Does this make it any easier to develop software?

How about the "final" class declarations. The purpose of final is to prevent programmers from subclassing another class. The intent is to try to prevent misuse. Does it make it easier to develop software? I don't think so. In most cases, it makes it harder.

How about checked exceptions. Does that make it easier to develop software? In most cases, it's a pain declaring the throws through each method that the exception passes through. It might help ensure that the exception is handled somewhere, but does it simplify things? I don't think so.

That's why I like Smalltalk. Smalltalk lets developers to their work without throwing roadblocks in their way. It makes it easier to develop software. It doesn't try to restrict what the programmer can do to protect him from himselt. As I said, software development is hard. Why should your development tools make it harder?

Read: The Basis of Object Oriented Programming

Topic: Sci Friday returning Previous Topic   Next Topic Topic: First Syndication merger?

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use