answersLogoWhite

0

What else can I help you with?

Continue Learning about Engineering

What is the need of object oriented programming?

Structured programming is task-centric, object oriented programming is data-centric.Task-centric vs. Data-centricStructured programming is based around data structures and subroutines. The subroutines are where stuff actually "happens", and the data structures are simply containers for the information needed by those subroutines. Object oriented programming, on the other hand, shifts your primary focus to the data itself. Instead of asking "what do I want to do and what will I need to know to do it", you ask "what kind of things do I want to have and what can those things do for me". Instead of designing your functions first and then coming up with data structures to support them, you design types first and then come up with the operations needed to work with them.Three OOP PrinciplesPerhaps the most important feature of OOP is polymorphism, the ability to identify certain aspects that several data types have in common, and write code that works equally well with all of them by ignoring the differences in situations where they don't matter. For example, consider a simple drawing program where you have a set of shapes (circles, rectangles, etc.) that share certain things in common (they all have a location, size, and color) but are different in other ways (how they look or whether they can be rotated). In a structured program, you'd write a function to draw a shape, containing logic like "if the shape is a circle, do ABC; if it's a rectangle, do XYZ" and so on.But in an OO program, you'd simply tell the shape to draw itself, and the shape would know, based on its own type, what to do: you write a specialized drawing function when you define each shape, and when you send a "draw" message to any shape, it automatically calls the one for the correct shape type. Polymorphism eliminates the need for you to check what kind of shape it is: you just have to know that shapes can draw themselves, and let the shape worry about how it actually happens.Another important OO principle is encapsulation, the ability to bundle code and data together in one place and hide that data from the outside world, forcing anyone who wants to access it to go through the associated code. For example, all shapes have a location and a size, but the best representation might be different. A circle only needs three numbers (center X, center Y, and radius) but a rectangle needs four (top, bottom, left, right). Structured programming encourages code everywhere to deal directly with the innards of data structures, so most likely you'd need to use the same representation for all shapes in order to avoid checking the type every time you wanted to measure a shape, even though that representation is wasteful for circles.Object oriented programming addresses that problem two ways: first, encapsulation says that the internal representation of a shape is off-limits to anyone else, so if you want to know how big a shape is, you have to call its getSize() method instead of reading its size directly out of memory. Second, polymorphism allows different shapes to implement their getSize() methods differently, allowing circles to use a more efficient version while presenting the same interface to the outside world.Finally, there's inheritance, which makes it easy to extend existing structures to produce new structures with slightly different behavior. For example, a filled circle is mostly the same as a regular circle, but it draws itself differently and also has a fill color. In a structured program, you'd probably handle filled circles by adding a fill color to all shapes and a flag that indicates whether the shape is filled or not, and the fill color would simply go unused (wasting memory) in unfilled shapes. In an object-oriented program, you can make FilledCircle a subclass of Circle, inheriting all the existing circle behavior, and then replace the draw() method and add a place to store the fill color. Then if you changed something about Circle later, the change would automatically propagate to FilledCircle, while changes you made to FilledCircle would not affect any other shapes.Design vs. LanguageWhether your code is object oriented or merely structured depends partly on your choice of language, but also on your design. For example, the C language doesn't offer any features for object oriented programming, but with enough discipline you can still write object-oriented code in C, such as the GTK windowing library. On the other hand, you can write a Java program that completely fails to take advantage of Java's OOP features, by putting all your code in a single class and using classes with public members just as you'd use structs in C. One organizes code by comprehensiveness while the other organizes code by the data affected.Structured programming consists of breaking big problems into smaller problems, then further breaking those into still smaller problems, and so on, until a level of such simplicity is reached that the implementation is obvious to the programmer expected to do the coding. Object-oriented programming consists of grouping code with the data on which it operates so that this "object" can function independently of the rest of the software system. Structured programming and object-oriented programming are not mutually exclusive. You can structure the code in an object, and you can use objects to implement the modules of code in a structured program. Procedural (Structure) vs. OO programming require different approachesSimilarities: Both require a rudimentary understanding of programming concepts and basic control flow. Loops, conditional statements, and variables are concepts that are important whether you are using a procedural language or an object oriented language. Differences: Typically object oriented is viewed as more difficult. This is because an entirely different problem solving approach must be taking. In addition, there are a variety of object-oriented-only concepts such as classes and inheritance. For simple programs, procedural is often preferred. The more complicated the project, the easier it is to leverage the strengths of object oriented design.Other notes: Not all languages fall strictly into procedural or object oriented baskets. In actuality, it is more of a spectrum. Languages like Basic and C are pretty much entirely procedural. Languages like C++ and Pascal can be written in either procedural or object oriented styles. Languages like Java and Python adhere much more strictly to object oriented design (although some programmers argue these aren't TRUE object oriented languages).


What are the Main differences between object oriented programming and generations 1-4 programming language?

Object oriented computer programming and design methodology has become popular as a way of modeling and solving many programming problems. Traditionally, the implementation of such systems has been performed using an object oriented programming language such as C++. Those skilled in the art know that object oriented programming languages share at least five unique and defining concepts or notions. These concepts, which are discussed fully in the relevant literature pertaining to object oriented programming, are known as: CLASSES, OBJECTS; INHERITANCE; POLYMORPHISM, and ENCAPSULATION. Objects communicate with one another via "message passing." A "message" is texts string such as "redraw you". When an object receives a message, a corresponding class method is executed. It is well-known that in object oriented programming, different objects of an object oriented programming language will respond to messages differently.Shift from top-down to OOP could be called going from fourth to fifth generation, in that what it enables programmers to do better or more conveniently than they could with the more primitive languages resembles what the higher generation languages enabled them to do over the lower generation ones. OOP, however, is a paradigm shift as significant as that from first to second or, arguably, from second to third -- but far more radical than the from third to fourth. Of course, it is impossible to quantify this, but in terms of ease of programming and what OOP enables, it might be fair to say the leap from fourth-generation languages to OOP, especially what OOP has now become, can be likened to the span between binary code and BASIC. OOP supercharges the program environment.At each generational jump from binary to assembly language, to third-generation, to fourth-generation, the leap made programming easier and enabled more complex tasks by adding layers around the central core of binary code and its next outer layer, assembly. All programming languages including the advanced OOP iterations that are out now, are parsed down to binary to be executed by the computer. It's all fundamentally the same.OOP packaged the laborious and error-prone systems of calling subroutines with variable parameters we used in the old days with a very slick interface, an envelope of error-checking and ease of use.Object Oriented Programming organizes programming logic around objects instead of processes (as is the case with non-OOP). Some widely used third generation, object-oriented programming languages include C++, Java, and Smalltalk. In OOP, data, and the processes that can be performed on the data, are combined into an object. In addition, objects with similar characteristics may be combined into something called a class. So when an OOP programmer creates a class and wants to categorize certain files they are able to create a sub-class. Sub-classes inherit all the characteristics and processes from the original class file that it is derived from. Inheritance is one of the most powerful features of OOP. Once a programmer creates the subclass, he can add to or change the characteristics and processes to meet the precise needs of the subclass. An example of an OOP is Microsoft Office Suite products (Word, Excel, PowerPoint, Access). First Generation Programming is a machine language. It only understands zeros and ones, so we say machine languages are binary. Second Generation Programming is also called assembly languages; it uses simple words in place of zeroes and ones. The programmer associates each assembly language statement with a specific machine language command. Third Generation Programming uses source codes that could then convert into machine language. A special computer program, called a compiler, would handle the conversion. A compiler is a computer program that translates a specific third generation language (3GL) into machine language. Forth Generation Programming languages are closer to natural language. People who have little or no programming skills can use them to write simple programs. One example of a 4GL is structured query language (SQL). Structured query language is a standard language for manipulating databases. Users can write simple SQL programs to create a database, enter data, retrieve data, and delete data. How are they similar? All programming languages still go back to the First Generation Programming language, Each generation has become more advance, with better tools and features. But each language resorts to machine language.


What kind of programs is it used to create procedural programming?

Procedural programming has been used for thousands of graphical applications, The most well known application it has been used for is the creation of the operating system known as Linux. despite there being numerous variations of Linux that are available for anyone to use free of charge due to it's open source nature, each of these variations uses procedural programming to create the kernel that is runs from. The kernel itself is created in the procedural programming language known as Python.I hope this is a better answer than the one before it :)


What common programming language statement in your opinion is most detrimental to readability?

Well-written well-commented code should be perfectly readable by anyone fluent in the language being used. Poorly-written and undocumented code will be extremely hard to follow.


Name of the latest programming language?

Programming languages are invented all the time. The vast majority are simply not used by anyone except the author or a small team with a specific need. If you are looking for the "best" or "most popular" programming language, you are probably going to start an almighty debate! Tiobe compile a list of most popular programming languages at http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html. Currently, this is Java, C, C++ then PHP and so on.

Related Questions

Describe windows programming architecture?

which is not known by anyone


Does anyone offer PHP Programming services for free?

Most online programming services will charge for PHP programming service. However, there are many free PHP programming tutorials available.


Does anyone have the code for programming a direct tv remote to an apex LD4086?

11531


Who are the persons involve in computer programming?

Anyone can be a programmer. You don't have to be a big corporation.


I am 14 years old and have some basic knowledge about computers and is greatly interested in programming but there are too many to choose from so can anyone maybe show me what language to learn first?

I would recommend learning C# as a first language. It is a great introduction into the world of Object Oriented Programming. I would then progress to C++. Many client side games are programmed in this. It is also used in a large portion of major projects, such as Google Chrome.


If i am a fresher then to can i do sap abap?

yes Its a programming language and anyone with a basic programming knowledge can learn ABAP easily. As a fresher its better to do a course from ant good institute and get certified.


What is a language in video game programming?

Most general-purpose programming languages can be used for video games. Lazyfoo's tutorials are excellent resources for anyone interested in game programming. They are written in the C++ programming language, but the same concepts can easily be applied to C, Ruby, Python, Perl, or any other general-purpose language.


What is open-source programming?

It is programming that is licensed in such a way that it provides the source code for everyone to view and suggest changes to, and is usually at no cost or a very lost cost to anyone that wants the program and its source code.


What is python computer programming?

Python is a computer programming language that runs on almost all computer platforms, such as Linux or Windows. It is free for anyone to use, and helps various computer systems integrate more quickly.


Anyone knows a programming code to look for nth word in a string using string.h?

Function strtok can help you to separate the words.


What are some limitations imposed by a fixed array size?

The most reasonable assumption I can make is that you are referring to the data structures used when programming - some specification is, perhaps, in order. In such case, the name itself says what - fixed arrays cannot accomodate a growing numbers of values beyond their initial limitations. Though I'm highly inexperience in programming, I can't imagine that, without context, any more definite answer can be given... But hey, if anyone disagrees with me, don't take my word.


What is the need of object oriented programming?

Structured programming is task-centric, object oriented programming is data-centric.Task-centric vs. Data-centricStructured programming is based around data structures and subroutines. The subroutines are where stuff actually "happens", and the data structures are simply containers for the information needed by those subroutines. Object oriented programming, on the other hand, shifts your primary focus to the data itself. Instead of asking "what do I want to do and what will I need to know to do it", you ask "what kind of things do I want to have and what can those things do for me". Instead of designing your functions first and then coming up with data structures to support them, you design types first and then come up with the operations needed to work with them.Three OOP PrinciplesPerhaps the most important feature of OOP is polymorphism, the ability to identify certain aspects that several data types have in common, and write code that works equally well with all of them by ignoring the differences in situations where they don't matter. For example, consider a simple drawing program where you have a set of shapes (circles, rectangles, etc.) that share certain things in common (they all have a location, size, and color) but are different in other ways (how they look or whether they can be rotated). In a structured program, you'd write a function to draw a shape, containing logic like "if the shape is a circle, do ABC; if it's a rectangle, do XYZ" and so on.But in an OO program, you'd simply tell the shape to draw itself, and the shape would know, based on its own type, what to do: you write a specialized drawing function when you define each shape, and when you send a "draw" message to any shape, it automatically calls the one for the correct shape type. Polymorphism eliminates the need for you to check what kind of shape it is: you just have to know that shapes can draw themselves, and let the shape worry about how it actually happens.Another important OO principle is encapsulation, the ability to bundle code and data together in one place and hide that data from the outside world, forcing anyone who wants to access it to go through the associated code. For example, all shapes have a location and a size, but the best representation might be different. A circle only needs three numbers (center X, center Y, and radius) but a rectangle needs four (top, bottom, left, right). Structured programming encourages code everywhere to deal directly with the innards of data structures, so most likely you'd need to use the same representation for all shapes in order to avoid checking the type every time you wanted to measure a shape, even though that representation is wasteful for circles.Object oriented programming addresses that problem two ways: first, encapsulation says that the internal representation of a shape is off-limits to anyone else, so if you want to know how big a shape is, you have to call its getSize() method instead of reading its size directly out of memory. Second, polymorphism allows different shapes to implement their getSize() methods differently, allowing circles to use a more efficient version while presenting the same interface to the outside world.Finally, there's inheritance, which makes it easy to extend existing structures to produce new structures with slightly different behavior. For example, a filled circle is mostly the same as a regular circle, but it draws itself differently and also has a fill color. In a structured program, you'd probably handle filled circles by adding a fill color to all shapes and a flag that indicates whether the shape is filled or not, and the fill color would simply go unused (wasting memory) in unfilled shapes. In an object-oriented program, you can make FilledCircle a subclass of Circle, inheriting all the existing circle behavior, and then replace the draw() method and add a place to store the fill color. Then if you changed something about Circle later, the change would automatically propagate to FilledCircle, while changes you made to FilledCircle would not affect any other shapes.Design vs. LanguageWhether your code is object oriented or merely structured depends partly on your choice of language, but also on your design. For example, the C language doesn't offer any features for object oriented programming, but with enough discipline you can still write object-oriented code in C, such as the GTK windowing library. On the other hand, you can write a Java program that completely fails to take advantage of Java's OOP features, by putting all your code in a single class and using classes with public members just as you'd use structs in C. One organizes code by comprehensiveness while the other organizes code by the data affected.Structured programming consists of breaking big problems into smaller problems, then further breaking those into still smaller problems, and so on, until a level of such simplicity is reached that the implementation is obvious to the programmer expected to do the coding. Object-oriented programming consists of grouping code with the data on which it operates so that this "object" can function independently of the rest of the software system. Structured programming and object-oriented programming are not mutually exclusive. You can structure the code in an object, and you can use objects to implement the modules of code in a structured program. Procedural (Structure) vs. OO programming require different approachesSimilarities: Both require a rudimentary understanding of programming concepts and basic control flow. Loops, conditional statements, and variables are concepts that are important whether you are using a procedural language or an object oriented language. Differences: Typically object oriented is viewed as more difficult. This is because an entirely different problem solving approach must be taking. In addition, there are a variety of object-oriented-only concepts such as classes and inheritance. For simple programs, procedural is often preferred. The more complicated the project, the easier it is to leverage the strengths of object oriented design.Other notes: Not all languages fall strictly into procedural or object oriented baskets. In actuality, it is more of a spectrum. Languages like Basic and C are pretty much entirely procedural. Languages like C++ and Pascal can be written in either procedural or object oriented styles. Languages like Java and Python adhere much more strictly to object oriented design (although some programmers argue these aren't TRUE object oriented languages).