Day #13: Hash Code Heroes: Where Collisions Meet Elegance 🗝️

Today we implemented a complete hash table data structure from scratch, focusing on proper collision handling and clean code practices. The code changes from this session can be found here. Day 13 Summary Overview Built a generic hash table implementation with chaining-based collision resolution while maintaining clean code principles and comprehensive testing practices. Environment & Tools Maven project structure JUnit 5 testing framework Clean package organization Proper Git workflow Concepts Covered Hash Table Implementation Generic type support for keys and values Collision resolution through chaining Dynamic resizing based on load factor Proper null handling Clean API design Core Operations Put with collision handling Get with chain traversal Remove with chain maintenance ContainsKey implementation Size and clear operations Iterator Implementation Bucket and chain traversal Complete collection iteration Proper exception handling Clean iterator pattern Testing Practices Comprehensive test coverage Edge case handling Collision testing Iterator verification Clear test organization Implementation Progress Created complete HashTable interface Implemented SimpleHashTable with all operations Added proper collision handling Established iterator support Built comprehensive test suite Key Takeaways Hash table fundamentals and collision handling Clean code in data structure implementation Importance of comprehensive testing Iterator pattern implementation Generic type constraints and usage Next Steps Ready to explore: ...

February 21, 2025 · 2 min · 277 words · Çağlar Turalı

Day #12: Swing Revival: Where Native Meets Clean Architecture 🎨

Today marked a significant shift in our Library Management System’s UI approach, moving from JavaFX to Swing while establishing clean architectural patterns. The code changes from this session can be found here. Day 12 Summary Overview Transitioned our Library Management System from JavaFX to Swing, focusing on native look and feel while implementing clean architectural patterns and modular design. Environment & Tools Removed JavaFX dependencies Switched to Swing for UI components Utilized system look and feel capabilities Implemented native font detection Concepts Covered Swing Architecture Basic window and component setup System look and feel integration Menu system implementation Layout management principles Clean Architecture Component separation Callback patterns Event handling Modular design approach Font Management System font detection Font size controls Global UI updates Event-driven UI refresh Modern Java Features Switch expressions with pattern matching Method references Lambda expressions Callback implementations Implementation Progress Created basic Swing window structure Implemented font management system Added view customization options Established modular component base Key Takeaways Swing’s superior native integration capabilities Importance of clean architectural boundaries Value of dedicated component management Benefits of callback-driven updates Modern Java features in traditional frameworks Next Steps Ready to explore: ...

February 20, 2025 · 2 min · 264 words · Çağlar Turalı

Day #11: Maven Modules & Window Frames: Organizing Our Java Universe 🌌 🎨

Today marked a significant milestone in our Java journey as we reorganized our project structure and took our first steps into desktop UI development. The code changes from this session can be found here. Day 11 Summary Overview Restructured the entire project to use Maven multi-module architecture and began implementing a JavaFX-based user interface for the library system. Project Restructuring Migrated from single-module to multi-module Maven project Created dedicated modules: data-structures: Stack, Queue, and Tree implementations library-system: Library management application card-game: Card game implementations Set up parent POM with common configurations Established proper package organization JavaFX Integration Added JavaFX dependencies to library-system module Set up Scene Builder for UI development Created initial UI structure: Main application window FXML-based layout design Basic controller implementation UI Components Menu system with File and Books options Search functionality placeholder Book table view structure Action buttons for common operations Key Takeaways Maven multi-module benefits for project organization Clean separation of concerns through module structure FXML advantages for UI development JavaFX application architecture understanding Resource management in Maven projects Next Steps Ready to explore: ...

February 19, 2025 · 2 min · 261 words · Çağlar Turalı

Day #10: Tree of Knowledge: Roots of Binary Wisdom 🌳🧩

Today we delved into the world of Binary Search Trees, implementing a robust BST data structure while strengthening our testing practices. The code changes from this session can be found here. Day 10 Summary Overview Implemented a comprehensive Binary Search Tree data structure with proper testing methodology, covering core tree operations and utility methods. Environment & Tools JUnit 5 for testing framework Proper test organization with @DisplayName annotations Clean separation of test and implementation code Concepts Covered Binary Search Tree Implementation Generic type support with Comparable constraint Core BST properties and invariants Node structure and relationships Recursive tree operations Tree Operations Insertion maintaining BST property Deletion handling all cases (leaf, one child, two children) Three types of traversals (in-order, pre-order, post-order) Search/contains operation Utility Methods Size calculation Tree height computation Min/max value finding BST property validation Testing Practices Clean test organization Descriptive test naming Test isolation with @BeforeEach Edge case coverage Implementation Progress Created complete BST implementation Added comprehensive traversal methods Implemented utility operations Established proper test suite Key Takeaways BST provides efficient searching and ordering Recursive solutions for tree operations Importance of maintaining BST invariants Value of proper test organization Benefits of descriptive test naming Next Steps Ready to explore: ...

February 18, 2025 · 2 min · 268 words · Çağlar Turalı

Day #9: Building Better: From Queue to Quality 🏗️✨

Today marked a significant shift in our development approach, moving from basic implementations to professional-grade project structure and testing practices. The code changes from this session can be found here. Day 9 Summary Overview Implemented a generic queue data structure while establishing professional development practices through proper build system setup and testing methodology. Environment & Tools Set up Maven build system Configured JUnit 5 for testing Established proper project structure Added Git ignore patterns for Maven Concepts Covered Queue Implementation Generic type parameters Linked list-based structure Basic queue operations (enqueue/dequeue) Null handling and edge cases Modern Java Features Generic type implementation Iterator pattern Stream API integration Interface implementations (Iterable, Streamable) Professional Development Maven project configuration Dependency management JUnit test organization Clean project structure Testing Practices Test lifecycle management (@BeforeEach) Clear test naming conventions Comprehensive test cases Edge case coverage Implementation Progress Created SimpleQueue implementation Added queue operations Implemented iteration support Integrated stream capabilities Established comprehensive test suite Key Takeaways Professional project structure importance Value of proper testing methodology Build system benefits Clean separation of concerns Iterative development approach Next Steps Ready to explore: ...

February 17, 2025 · 2 min · 241 words · Çağlar Turalı

Day #8: Stack Overflow? Not On Our Watch! ⚡️🛡️

Today we ventured into the realm of data structures, implementing our own generic stack while restructuring our project organization. It’s one thing to use Java’s built-in collections, but building them from scratch? That’s where the real learning happens! The code changes from this session can be found here. Day 8 Summary Overview Restructured project organization and implemented a generic stack data structure with modern Java features while focusing on clean code principles and API design. ...

February 15, 2025 · 2 min · 274 words · Çağlar Turalı

Day #7: JVM Tales: From Mutable States to Immutable Fates 🎭

Today we dove deep into JVM architecture while transforming our Library Management System to embrace immutability. The code changes from this session can be found here. Day 7 Summary Overview Explored JVM architecture through our practical projects while evolving the Library Management System to use immutable records for state management. Environment & Tools Proper Java version management (OpenJDK 21) Git workflow Package structure and compilation JVM verbose class loading Concepts Covered JVM Architecture Class loading lifecycle Dynamic class loading patterns Memory management principles Garbage collection basics Immutability Patterns Record types for borrowing events State vs Event sourcing Clean separation of concerns Audit trail implementation System Evolution Removed mutable state from BookCopy Introduced BorrowingRecord Enhanced BorrowingService responsibilities Improved interface segregation Resource Management Proper datetime formatting String representation patterns Efficient optional handling History tracking implementation Implementation Progress Created immutable BorrowingRecord Updated BorrowingService for history tracking Simplified BookCopy class Enhanced system observability Improved separation of concerns Key Takeaways JVM’s efficient handling of immutable objects Benefits of event-sourced state management Clean separation of responsibilities Importance of proper version management Value of comprehensive audit trails Next Steps Ready to explore: ...

February 14, 2025 · 2 min · 251 words · Çağlar Turalı

Day #6: Memory Tricks & Card Flips: The Java Juggler's Day 🎪

Today we delved into the inner workings of the JVM while adding sophisticated debugging capabilities to our card game. The code changes from this session can be found here. Day 6 Summary Overview Explored JVM architecture concepts, memory management, and control flow patterns while enhancing the Card Game project with debug features and resource management. Environment & Tools Git workflow with meaningful commits IntelliJ IDEA Java resource management patterns Concepts Covered JVM Memory Management Stack vs Heap understanding Object lifecycle management Card recycling implementation Reference management patterns Resource Management AutoCloseable interface implementation Try-with-resources pattern Scanner resource cleanup Proper cleanup patterns Display Mode System Global configuration management DEBUG/PLAYER mode implementations Clean string representations Consistent output formatting Modern Java Features Switch expressions String formatting Stream operations Record implementations Design Patterns & Principles Single Responsibility Principle Clean Code practices Configuration management Resource lifecycle management Implementation Progress Implemented card recycling system with discard pile Added proper resource management to GameConsole Created system-wide display mode configuration Enhanced domain objects with debug information Improved console interface and commands Key Takeaways JVM memory management influences design decisions Proper resource cleanup is crucial for robust applications Global configuration can enhance debugging capabilities String representation can vary based on context Clean code principles lead to maintainable solutions Next Steps Ready to explore: ...

February 13, 2025 · 2 min · 279 words · Çağlar Turalı

Day #5: Dealing with Java: High Cards and Higher Principles 🃏

Today we brought our card game to life, implementing a complete multiplayer High Card game while diving deeper into Java’s object-oriented features. The code changes from this session can be found here. Day 5 Summary Overview Built a complete multiplayer High Card game while exploring Java’s object-oriented features, modern syntax, and clean code practices. Environment & Tools Git workflow with feature branching zsh git shortcuts for efficient version control Proper package organization Concepts Covered Domain Modeling Record types for immutable data (Card, GameResult) Class design for mutable state (Player, Game) Enum implementation with behavior Clean separation of concerns Modern Java Features Records with validation Enhanced enum capabilities String formatting Stream operations for collections Optional for null safety Design Patterns & Principles Dependency Injection (IO handling) Immutable value objects Builder pattern for game setup Interface segregation Single Responsibility Principle Console Interface Interactive gameplay Input/Output abstraction Error handling User feedback Game state management Implementation Progress Created core game entities Implemented deck management Added player validation Built interactive console interface Established proper error handling Key Takeaways Java enums can contain behavior Records provide clean immutable data structures Dependency injection enhances testability Clean separation between domain and UI Proper error handling improves user experience Next Steps Ready to explore: ...

February 12, 2025 · 2 min · 279 words · Çağlar Turalı

Day #4: From Books to Cards: A Tale of Two Projects 🎴📚

Today we wrapped up our reservation system implementation and embarked on an exciting new project - a card game that will help us explore more Java concepts. The code changes from this session can be found here. Day 4 Summary Overview Completed the reservation system implementation and started a new card game project, focusing on clean domain modeling and modern Java features. Environment & Tools Practiced proper Git workflow Feature branch management Meaningful commit messages Branch switching and merging Used zsh Git shortcuts effectively Concepts Covered Reservation System Completion Optional usage for null safety Queue operations (peek vs poll) Stream operations for collection manipulation Proper exception handling Event notification patterns Card Game Foundation Domain modeling with immutable types Enum usage and customization String manipulation utilities Collection operations Modern Java Features Records for immutable data Enhanced switch expressions String formatting List operations (removeLast) Stream collectors Design Patterns & Principles Immutable value objects Single responsibility principle Utility class patterns Clean code naming conventions Implementation Progress Completed ReservationService implementation Created foundation for card game: Card, Rank, and Suit implementations Deck management Card drawing mechanisms toString representations Key Takeaways Java’s modern features support clean, expressive code Importance of proper string representation Value of distinguishing between display and debug formats Collection choice impacts performance Next Steps Ready to explore: ...

February 11, 2025 · 2 min · 290 words · Çağlar Turalı