Week 13 - Learning Journal.

1. Your Approach and What It Revealed

I started with the card class first since deck depends on it. I didn’t really plan ahead - I opened the file and built everything from scratch. My usual approach is to figure things out as I go and adjust based on errors or what breaks.

For this project, that worked fine because card is mostly self-contained, so everything flowed naturally into Deck. That said, for more complex systems, I’d probably spend a bit more time planning how classes interact upfront instead of relying purely on trial and error.

2. The Peer Review: What You Saw and What You Learned

I worked with Eric during the review. One difference I noticed was how we handled checking opposite colors. He wrote the logic directly in the card class, while I called a method from the Suit enum.

I think my approach is better because it avoids duplicating logic. If the color rules ever change, my version only needs to be updated in one place, while his would require changes in multiple places. His approach works, but it spreads responsibility across classes and makes the code harder to maintain.

One thing we both missed was constructor input validation. Neither of us checked for null values, which could cause issues later. That’s something I’d fix going forward by validating inputs early.

3. Consolidating the OOP Concepts

Encapsulation makes the most sense to me now. It’s about keeping data protected inside a class and only allowing controlled access through methods, instead of letting anything modify it directly.

Constructors are still a weak spot, especially around input validation. I understand how they work, but I didn’t think about enforcing valid inputs. I still need to get better at deciding when constructors should strictly validate versus allowing flexibility.


4. Did You Celebrate?

I didn’t really celebrate - I just moved on. But finishing two working classes is worth acknowledging. Next time, I’ll at least take a break or do something small to recognize the progress.


Comments

Popular posts from this blog

Week 7 - Learning Journal

Week 4 - Learning Journal

Week 5 Learning Journal