Published Feb 5, 2017

Clean Code - How to Write Classes the Right Way

Delve into the intricacies of clean code with Joe Zack and team as they unpack the essentials of class design, SQL performance optimization, and code testability. Explore advanced indexing in SQL, dependency inversion for cleaner code, and the SOLID principles to elevate your coding standards.
Episode Highlights
Coding Blocks logo

Popular Clips

Episode Highlights

  • Indexing Tips

    Optimizing index management in SQL Server can significantly enhance performance. explains that using a GUID as a primary key can lead to performance issues due to its randomness, which causes data fragmentation. Instead, he suggests creating a non-clustered primary key with the GUID and a separate clustered index using an integer column. This approach maintains data uniqueness while improving search speed and reducing storage space 1.

    You get the speed, you get lower storage, and you get the unique, the uniqueness for the record.

    ---

    highlights that this method effectively uses two keys: one for accessing data and another for maintaining uniqueness, which is beneficial for data replication 1.

       

    Conflict Solutions

    Handling key conflicts in SQL environments is crucial for seamless data synchronization. discusses the challenges of using surrogate keys, like simple integers, which can lead to conflicts when moving data between development and production environments. He suggests using unique identifiers, such as GUIDs, to avoid these conflicts, despite their larger size and randomness 2.

    One of the problems with using GUIDs for a key or a unique identifier as a key in SQL server is it's bigger and they are also random.

    ---

    This strategy ensures that each record remains distinct across different environments, facilitating smoother transitions and data integrity 2.

Related Episodes