Skip to content

cliff-de-tech/alx_be_python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🧪 Cliff-Tech-Lab

The Experimental Grounds of a Creative Technologist

Language Focus Status

👨🏾‍💻 About This Repo

Welcome to the lab! I am Clifford Opoku-Sarkodie, an aspiring Back-End Developer and Cybersecurity enthusiast.

This repository serves as my "Brag Doc" and technical work log. Here, I document my journey through the ALX Software Engineering program, tracking the systems I build, the bugs I squash, and the lessons I learn.


📅 Latest Update: Month 2 (Back-End Engineering)

Current Focus: Object-Oriented Programming (OOP), Test-Driven Development (TDD), and Data Serialization.

📝 Summary of Work

This month, I shifted gears from writing simple scripts to designing robust, class-based architectures.

  • Deep Dive into OOP: Mastered the 4 Pillars (Encapsulation, Inheritance, Polymorphism, Abstraction).
  • Test-Driven Development: Built custom test suites using Python's unittest module to validate logic and handle edge cases.
  • Data Persistence: Implemented Serialization/Deserialization (JSON & Pickle) to manage data storage and transfer.

🏆 Key Achievements

  • Polymorphism & Duck Typing: Successfully built flexible interfaces that allow different objects to communicate seamlessly, adhering to the "Is-A" vs "Has-A" relationships.
  • Unit Testing: Wrote a complete test suite achieving high code coverage. I learned to test for failures (e.g., ZeroDivisionError) just as strictly as success cases.
  • Magic Methods: Clarified the crucial difference between __str__ (user-facing) and __repr__ (developer-facing) to improve debugging workflows.

🔥 Failures & Lessons

"You don't learn from success; you learn from the bugs that keep you up at night."

  • The Challenge: I initially struggled with the Diamond Problem in Multiple Inheritance and understanding Python's MRO (Method Resolution Order).
  • The Fix: I learned to trace the C3 Linearization algorithm and realized that Composition is often a safer architectural choice than complex Inheritance.
  • Security Insight: I discovered that pickle is powerful but inherently insecure for untrusted data. This was a critical lesson connecting backend logic to my interest in Cybersecurity.

💻 Code Highlight: Factory Patterns

One of my favorite implementations this month was using @classmethod as a Factory to create cleaner instantiation logic, separating the "blueprint" from the "object."

class DataProcessor:
    """A class to handle data operations securely."""
    
    data_source = "CSV" 

    def __init__(self, data):
        self.data = data

    @classmethod
    def from_string(cls, data_string):
        """
        Factory method: Creates an instance directly from a raw string.
        Using 'cls' allows this method to be inherited and reused dynamically.
        """
        print(f"🔄 Processing stream from: {cls.data_source}")
        data_list = data_string.split(",")
        return cls(data_list)

    @staticmethod
    def is_secure_file(file_name):
        """
        Utility method: Validates file safety without needing an instance.
        """
        allowed_exts = [".csv", ".json"]
        return any(file_name.endswith(ext) for ext in allowed_exts)

📁 Project History

Month Focus Area Key Technologies Status
Month 2 Advanced OOP & Testing Python, Unittest, JSON / Pickle ✅ Completed
Month 1 Python Fundamentals Shell, Git, Basic Python ✅ Completed

🤝 Connect With Me

I’m always open to conversations about Backend Architecture, Cybersecurity, and Military Tech applications.


About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Languages