Hans L'Hoesthans.lhoest.eu·Dec 6, 2024Notes on Preparatory RefactoringNotes inspired by Emily Bache's short Youtube video Design Better Code with Preparatory Refactoring in TDD | Demo. A preparatory refactoring is a refactoring to make future changes to accommodate new requirements easy. By definition, current behavior...DiscussTDD (Test-driven development)
Maxi Contierimaximilianocontieri.com·Dec 4, 2024Refactoring 019 - Reify Email AddressesSayit once and only once TL;DR: Avoid duplicate email validations. Problems Addressed Repeated email validation logic in multiple places. Risk of inconsistent validation rules. Difficult to maintain validation rules. Bijection violation Primitive ...DiscussRefactoringsrefactoring
Maxi Contierimaximilianocontieri.com·Nov 30, 2024Code Smell 282 - Bad DefaultsTL;DR: Treat unknown responses as unauthorized, not as valid. Problems Security risks Ignoring unknown cases Error Misinterpretation Defaulting to valid states Mismatch Authorizations Failing to log events Exploitation Potential Solutions Validat...Discuss·627 readsCode Smellsclean code
Michael Laroccamichaeljudelarocca.hashnode.dev·Nov 26, 2024FeaturedHow to Elevate Your Coding Skills to Stand Out in the Job MarketIntroduction To become a hirable and sought-after web developer in today’s competitive job market, you must elevate your coding skills to a professional level to stand out from other candidates, significantly increasing your chances of being hired. I...huafeng qi and 2 others are discussing this3 people are discussing thisDiscuss·16 likes·184 reads#codenewbies
Gagandeep Singhblog.gagan93.me·Nov 24, 2024Refactoring: Lessons Learnt So FarBackground Refactoring is the process of restructuring code, without changing its original functionality. Over the past three years, my role has allowed me to pick a lot of refactoring tasks, which have enhanced my skills and understanding around R...Shivam Lekhwar and 1 other are discussing this2 people are discussing thisDiscuss·2 likes·86 readsrefactoring
Maxi Contierimaximilianocontieri.com·Nov 24, 2024Code Smell 281 - HashesTL;DR: Misaligned equals() and hashCode() break collections. Problems The least surprise principle violation Contract violations Mutable key issues Duplicate hash codes Debugging becomes hard Poor hash distribution Solutions Avoid mutab...Discuss·37 readsCode Smellsclean code
Maxi Contierimaximilianocontieri.com·Nov 20, 2024Code Smell 280 - Spaghetti CodeThis article is dedicated to the late Thomas E. Kurtz, one of BASIC's creators, as it was the first programming language I learned. TL;DR: GOTO statements create confusing and unmaintainable code Problems Logic becomes unclear Debugging gets har...Discuss·136 readsCode Smellsclean code
Maxi Contierimaximilianocontieri.com·Nov 16, 2024Code Smell 279 - Loop Premature OptimizationTL;DR: Don't optimize loops without a clear need and concrete real-world evidence Problems Premature Optimization Reduced readability Increased complexity Difficult to maintain Slower debugging Solutions Keep it simple Prioritize clarity Avoid pr...Discuss·33 readsCode SmellsProgramming Tips
Maxi Contierimaximilianocontieri.com·Nov 10, 2024Code Smell 278 - DirName and FileTL;DR: Use clear names for better code understanding. Problems Unclear variable purpose Bijection Fault Misleading context Repetitive code Harder maintenance Reduced readability Abbreviations Increased cognitive load Solutions Honor the Bijectio...Discuss·38 readsCode Smellsclean code
Mihai Olteanblog.mihaioltean.com·Nov 8, 2024Typescript stories - Generics vs Union typesThis will be a quick and more “back-to-basics” kind of article. While doing some small refactoring, I stumbled across a situation where I had to pass an object, but the shape of the object is completely different depending on the component using that...Discuss·1 like·52 readsTypeScript