There have been many approaches to programming over the years. Two that are relevant to Java and that you'll probably hear of are:
* Structured Programming
A program is a piece of code with the flow of execution jumping all over the place. Structured programming tried to remove this "spaghetti logic" and enforce a rule where one routine (chunk of code) was responsible for one piece on computation. A program was written by successively invoking a number of these "subroutines".
* Object-Oriented Programming (acronym OOP)
In OOP you can create objects that are a combination of code and data. An object holds its data and knows how to perform various computations on it. For example, a school database program might contain a "Student" type of object. A given student object might hold information about the student's name, age, home address, grade level, test results, etc. The student object might also contain code that could calculate the end-of-year grade, current GPA, and years left until graduation.
Smalltalk was one of the first object-oriented languages. While it is still in use today, Java and C++ are the more currently favored object-oriented languages.
* Structured Programming
A program is a piece of code with the flow of execution jumping all over the place. Structured programming tried to remove this "spaghetti logic" and enforce a rule where one routine (chunk of code) was responsible for one piece on computation. A program was written by successively invoking a number of these "subroutines".
* Object-Oriented Programming (acronym OOP)
In OOP you can create objects that are a combination of code and data. An object holds its data and knows how to perform various computations on it. For example, a school database program might contain a "Student" type of object. A given student object might hold information about the student's name, age, home address, grade level, test results, etc. The student object might also contain code that could calculate the end-of-year grade, current GPA, and years left until graduation.
Smalltalk was one of the first object-oriented languages. While it is still in use today, Java and C++ are the more currently favored object-oriented languages.
No comments:
Post a Comment