python programming

Object-Oriented Programming

Before we learn or start coding a program especially in python, I suggest you to understand a few thing about Object-oriented program. Object-oriented means functionally directed towards modeling objects. And this is one of the many techniques used for modeling complex systems by describing a collection of interacting objects via their data and behavior. In terms, object oriented divide as object-oriented analysis, object-oriented design, object-oriented analysis and design, and object-oriented programming. fact, analysis, design, and programming are all stages of software development. Object-Oriented Analysis (OOA) is the process of looking at a problem, system, or task (that somebody wants to turn into an application) and identifying the objects and interactions between those objects. The analysis stage is all about what needs to be done .The output of the analysis stage is a set of requirements. For example: (italic represents actions, bold represents objects)

* looking for teaching materials.

* browse for the history of  making sate ayam.

Object-Oriented Design (OOD) is the process of converting such requirements into an implementation specification. The designer must name the objects, define the behaviors, and formally specify which objects can activate specific behaviors on other objects. The design stage is all about how things should be done. The output of the design stage is an implementation specification. Object-Oriented Programming (OOP) is the process of converting this perfectly defined design into a working program that does exactly what the CEO originally requested. Each developer is unique with individual strength, weakness, preferences, and dislikes. That environment will reflect the programmer’s individuality just as forcefully as his or her hobbies, clothing, or haircut. However, if we are Pragmatic Programmer, we must have the following of this characteristics:

  • Early adopter/fast adapter. An instinct for technologies and techniques, and love trying things out. When given something new,  we can grasp it quickly and integrate it with the rest of our knowledge. Our confidence is born of experience.
  • Inquisitive. You tend to ask questions. That’s neat—how did you do that? Did you have problems with that library? What’s this BeOS I’ve heard about? How are symbolic links implemented? You are a pack rat for little facts, each of which may affect some decision years from now.
  • Critical thinker. You rarely take things as given without first getting the facts. When colleagues or schools say “because that’s the way it’s done,” or a vendor promises the solution to all your problems, you smell a challenge.
  • Realistic. You try to understand the underlying nature of each problem you face. This realism gives you a good feel for how difficult things are, and how long things will take. Understanding for yourself that a process should be difficult or will take a while to complete gives you the stamina to keep at it.
  • Jack of all trades. You try hard to be familiar with a broad range of technologies and environments, and you work to keep abreast of new developments. Although your current job may require you to be a specialist, you will always be able to move on to new areas and new challenges.

Program Design consists of the steps a programmer should do before they start coding the program in a specic language. These steps when properly documented will make the completed program easier for other programmers to maintain in the future. There are three broad areas of activity:

  • Understanding the Program
  • Using Design Tools to Create a Model
  • Develop Test Data

Understanding the Program. When  we are working on a project as a one of many programmers, the system analyst may have created a variety of documentation items that will help to understand what the program is to do. These could include screen layouts, narrative descriptions, documentation showing the processing steps, etc. If we are not on a project and while we are creating a simple program we might be given only a simple description of the purpose of the program. Understanding the purpose of a program usually involves understanding it’s:

  • Inputs
  • Processing
  • Outputs

This IPO approach works very well for beginning programmers. Sometimes, it might help to visualize the programming running on the computer. So we can imagine what the monitor will look like, what the user must enter on the keyboard and what processing or manipulations will be done.

Using Design Tools to Create a Model. At first we will not need a hierarchy chart because our first programs will not be complex. But as the grow and become more complex, we should divide our program into several functions. The first modeling tool we will usually learn is pseudocode  ( statements used to convey the steps of an algorithm or function) . We will document the logic or algorithm of each function in our program. First, we will have only one function, and thus your pseudocode will follow closely the IPO approach above.There are several methods or tools for planning the logic of a program. They include: flowcharting, hierarchy or structure charts, pseudocode, HIPO, Nassi-Schneiderman charts, Warnier-Orr diagrams, etc. Programmers are expected to be able to understand and do flowcharting and pseudocode. These methods of developing the model of a program are usually taught in most computer courses. Several standards exist for flowcharting and pseudocode and most are very similar to each other. However, most companies have their own documentation standards and styles. Programmers are expected to be able to quickly adapt to any flowcharting or pseudocode standards for the company at which they work. The others methods that are less universal require some training which is generally provided by the employer that chooses to use them. Later in our programming career, we will learn about using applications software that helps create an information system and/or programs. This type of software is called Computer-aided Software Engineering. Understanding the logic and planning the algorithm on paper before you start to code is very important concept. Many students develop poor habits and skipping this step is one of them.

Develop Test Data. Test data consists of the user providing some input values and predicting the outputs. This can be quite easy for a simple program and the test data can be used to check the model to see if it produces the correct results.

I think some of these things need to be known by new programmers

References :

  1. Hunt, Andrew, 1964 – The Pragmatic Programmer / Andrew Hunt, David Thomas. p.cm.
  2. Philips, Dusti, 2010 -Python 3 Object-oriented Programming; Second Edition.

1 COMMENT

LEAVE A REPLY

Please enter your comment!
Please enter your name here