Chapter 10 Recent Trends in Programminggg
Chapter 10 Recent Trends in Programminggg
i
Chapter 10
2. Encapsulation:
3. Abstraction:
4. Inheritance:
5. Polymorphism:
int main() {
// Object instantiation
© iamsspoudel
3
Car myCar;
// Assign values to the object’s attributes
myCar.brand = ”Toyota”;
myCar.model = ”Camry”;
// Call the method to display information about the car
myCar.displayInfo();
return 0;
}
In this example:
• The ‘Car‘ class has two attributes (‘brand‘ and ‘model‘) and a method (‘dis-
playInfo‘) that displays information about the car.
• Values are assigned to the ‘brand‘ and ‘model‘ attributes of the ‘myCar‘ object.
Output
Car: Toyota Camry
Benefits of OOP:
2. Reusability: Code reuse is facilitated through the creation of classes and inher-
itance, reducing redundancy.
4. Improved Code Organization: OOP mirrors real-world entities, making the code
more intuitive and closely aligned with problem domains.
OOP is employed in languages like Python, Java, C++, and many others. It provides
a powerful and flexible approach to software development, enabling developers to
create scalable and maintainable applications.
© iamsspoudel
4
• Purpose: Classes provide a way to structure and model the properties and
behaviors of real-world entities or abstract concepts in a software system.
2. Method
3. Object
In summary, a class serves as a blueprint for creating objects, defining their attributes
and behaviors. Methods are the functions associated with a class, specifying the
operations that objects of that class can perform. Objects are instances of classes,
embodying the properties and behaviors defined by the class. Together, these concepts
enable the principles of encapsulation, abstraction, inheritance, and polymorphism in
Object-Oriented Programming.
© iamsspoudel
5
© iamsspoudel
6
2. JavaScript: Essential for web development, and its popularity extends to server-
side development.
6. Rust: Gaining traction for systems programming, known for memory safety and
performance.
Trends:
1. Machine Learning and AI: Python is widely used for machine learning, and
languages like Julia and R are gaining popularity.
1. Python:
Key Features:
© iamsspoudel
7
Use Cases:
• Network programming.
2. JavaScript:
Key Features:
Use Cases:
3. Java:
Key Features:
Use Cases:
• Enterprise-level applications.
4. C#:
Key Features:
© iamsspoudel
8
• Developed by Microsoft.
Use Cases:
5. C++:
Key Features:
Use Cases:
• Systems programming.
• Game development.
• Embedded systems.
6. Ruby:
Key Features:
• Elegant syntax.
Use Cases:
7. TypeScript:
Key Features:
© iamsspoudel
9
Use Cases:
• Front-end development.
8. Go (Golang):
Key Features:
• Developed by Google.
• Concurrency support.
Use Cases:
• Cloud-based services.
• Network programming.
• Containerization (Docker).
9. Rust:
Key Features:
Use Cases:
• Systems programming.
• Game development.
• WebAssembly.
10. Swift:
Key Features:
© iamsspoudel
10
• Developed by Apple.
Use Cases:
© iamsspoudel