https://github.com/nihilantropy/cpp
c++ 42school project
https://github.com/nihilantropy/cpp
42school coding cpp project
Last synced: 9 months ago
JSON representation
c++ 42school project
- Host: GitHub
- URL: https://github.com/nihilantropy/cpp
- Owner: Nihilantropy
- Created: 2024-08-28T07:48:57.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-01-22T10:58:08.000Z (about 1 year ago)
- Last Synced: 2025-01-22T11:37:16.306Z (about 1 year ago)
- Topics: 42school, coding, cpp, project
- Language: C++
- Homepage:
- Size: 3.95 MB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Transitioning to C++: Embracing the Power of Object-Oriented Programming π
Welcome to a new chapter in our programming journey! After spending considerable time mastering C, we're diving into the world of C++ β a language that offers new dimensions and features that elevate our coding experience. Hereβs an overview of what makes C++ special and how it contrasts with our previous C adventures.
## π Why C++?
C++ is not just an extension of C; itβs a paradigm shift! Here are some cool aspects that set C++ apart:
### 1. **Object-Oriented Programming (OOP)** ποΈ
C++ introduces the concepts of classes and objects, which are fundamental to OOP. This allows us to bundle data and functions into single entities, making code more modular, reusable, and easier to manage.
- **Encapsulation**: Combine data and functions into a single unit (class), which enhances data hiding and abstraction.
- **Inheritance**: Create new classes from existing ones, facilitating code reuse and extension.
- **Polymorphism**: Use a single interface to represent different underlying forms (data types).
### 2. **Standard Template Library (STL)** π
#### Modules 08 and 09 only :rotating_light:!
The STL in C++ provides a rich set of ready-to-use classes and functions for handling collections of data, algorithms, and iterators. From vectors to maps, the STL simplifies many common tasks.
- **Containers**: Such as `vector`, `list`, `map`, and `set` for efficient data storage and manipulation.
- **Algorithms**: Generic functions like `sort`, `search`, and `transform` that work seamlessly with STL containers.
- **Iterators**: Provide a unified way to traverse elements in containers.
### 3. **RAII (Resource Acquisition Is Initialization)** π
C++ manages resource allocation and deallocation using constructors and destructors. This principle helps prevent resource leaks and ensures that resources are properly cleaned up when objects go out of scope.
## π Breaking Free from C Norms
While the C norms guided us through clear and consistent code style and formatting, C++ offers more flexibility:
- **Freedom in Style**: C++ allows for a broader range of coding styles and design patterns. We can now explore modern C++ practices and idioms.
- **Enhanced Tools**: Leverage C++βs powerful language features, such as templates and exception handling, to write cleaner and more efficient code.
## π The Smooth Transition
After focusing on C for so long, transitioning to C++ can feel refreshing and surprisingly intuitive:
- **Familiar Syntax**: Many C constructs are directly applicable in C++, so there's less of a learning curve than expected.
- **New Opportunities**: The added features and abstractions in C++ make complex tasks easier and more manageable.
## π Embrace the New!
C++ opens up a world of possibilities that we can now explore with enthusiasm and creativity. Whether it's diving into object-oriented design, leveraging the STL, or using advanced C++ features, there's plenty to discover and apply.
Remember though that we are still on a learning journey with 42 School :rotating_light:, so throughout all of these projects, we will be limited to using C++98!
Now, let's go :fire:!