


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!



Key thing is that we need to understand object oriented are object and classes. Class can be considered as a prototype for an object that defines set off attributes and methods characterized any object of the class. Basically, class as a template, when we defined a template for a group of objects that’s shares common attributes and methods. So, programmer do not write code for individual objects, instant they defined classes. Object is a unique instance of the data structure that’s defined by class. Objects are actually copies which are created by using class template. Every object will have its own data member and methods which are defined by the class. And process of creating objects using a class called instantiation. Attributes can call data members; they are the properties which is described the particular subject. Then methods are actually function it’s implemented the behavioral of the classes. In additionally using the class creating for objects. Class variable is a data member that is shared all objects of the class, which are shared all objects of the class. Therefore, separate copies needed each and every object even created. Actually, member function is defined as inside of the classes which implements the behavior of that class. Using the base classes then creating new classes which are called as derived classes. This inherits class derived attributes and method of the base classes. Just like house officers and officer on call are inherits properties of their house office doctor. We don’t need to create all classes scratch instead we can use the class or base class only defined the unique class because it facilitates to reusing existing classes. In method overloading having two or more method for the same name but the different set of parameters actually two methods two functionality. Even we can redefine functionalities/methods we called it method overriding. That is sub class overriding or redefining method what is inherits from base class, actually this is done implement specific and unique behavior what is sub class need. Many object-oriented programming is allowing overloading that’s have two or more methods as long as their argument different in the same class. But even constructor will also be overloading, that’s why makes comment on without argument. Actually, we want to one time makes sound method to call without argument one time with an argument or sometime have default argument (argument to which value is assign actually that’s become a default argument. Also don’t have to passed it then it will get a particular value that’s called optional argument. Make sound method actually get in one argument. For the same method have a different behavior that’s by overriding, actually overloading also give different behavior but that’s called static polymorphism, dynamic polymorphism implements to overriding. Another very important thing is hiding the data because don’t want to see everything inside of the objects and classes, because objects must be encapsulated (hidden container). Normally class attributes are visible and accessible in everywhere. If somebody want to hide class attributes use it double underscore prefix it will help to no more accessing or visible your private class attributes.
Never try to code something by hiding it, always try to shows it explicitly. Don’t need to wright too many instructions, features and functionality, keeping simplicity there is principle in programming say keeping simple and Shawn. Don’t try to add more functionality because code will become more difficult and complex. When wright in the code, lay down the code is nicely. Using meaningful data name otherwise abbreviation of the data names may be difficult to read it. Don’t think always programmer who holds the program and come back and edit the program, anybody should be able to fix it that what good code. If it is good code anyone should be able to go through it and understand it and fix it. Make complex function, it’s receiving some array of arguments but it doesn’t mention what is the array of arguments are, finally returning dictionary containing all local variable. Actually, it doesn’t clearly visible to the person how many arguments to be sent and what is the return value. But the other argument basically what it would be send to this particular method and what it returns is clearly visible to first line and the last line that’s better that’s why explicit better than implicit. Using proper naming convention generally improve the readability of the program. Following are the naming conventions are using python. Variable, names, function & methods...etc. Always using them lowercase with underscore. Classes and exception used by cap words; it means every word in that class begins with the capital letter. Protected methods and internal function usually start with _single_leading_underscore. If it is hidden methods, we can use double underscore. All constant should have to wright All_caps_with_underscores. Don’t use variables are from any part of the program, therefore never using single letters. Avoid the redundant variables means repletely using variables must be avoided. Get the words in different to the front rather than using differed functions which means bring the reverse notation in and front. Directly access to attributes rather than using get and setter method. Better use always spaces for indentations, never import individuals’ member/function therefore better to import whole module. When using comments don’t try to use too much of comments because it will make more combo sum therefore prefer to improve often small method which are more effective than comment. Make short code it will leads to improve the readability of the code but comments can be given but don’t try to overused the comments and don’t think adding comments improve the readability of programming, comments must be used for appropriately.
Declarative programming paradigms – In this case we don’t need to algorithm which means doesn’t need to give step by step procedures, no algorithms which namely in other way is non procedural/imperative. Don’t give control flow, don’t tell how to arrive at the solution instead said what is the solution needed. In SQL we don’t say how to derived the result from table simply said what do you want. No Loops, No selection, No assignment basically no algorithm. Logic programming - It’s also the declarative programming style, it’s actually defined what we know about the problem. Basically, it’s defined in to the facts and rules then problem solve by the interpreter/mechanism which is called unification and backtracking. Unification mean line an algebra like instead of this we can substitutes something equivalent to this and backtracking means more backward, reverse and go back to previous step and try in different direction until different solution are obtain. Functional programming - Against there are no variables, no states and everything defined as function. There is no state change’s function return the value, when called the functioned can return the value. That return values depend on the parameters which passed. Therefore, result will never immutable which means never changes the state always functioned only derived the result. Referential transparency means it guarantee is that when a function called it always give it end result. However, this may change it procedural programming because sometime when it called function one time give it result correctly, another time give it result incorrectly as it depends on value of memory variables. Event driven programming paradigms – In event driven programming it’s a programming paradigm basically which the event in respond to the event some action will come from the system. So, system doesn’t start from the beginning and keep on doing thing when some action happens from the system then only system respond. Let’s assume if somebody click the button (Close, minimize or whatever) then some response will come that’s how event driven programming works. These are the key terminology for event driven programming.