Maxi Contierimaximilianocontieri.com·Apr 25, 2024Code Smell 249 - Constants as NumbersTL;DR: Use real-world constants as constants Problems Bijection Violation Debugging Premature Optimization Maintainability Type Safety Limited Extensibility Solutions Use descriptive string constants Use Enums Create A Polymorphic Hierar...DiscussCode SmellsGeneral Programming
Ahmed Nadarahmednadar.hashnode.dev·Apr 23, 2024How I decide to pass on a parameter within a component.When creating a component in Rails, especially when using a component-based architecture like ViewComponent or similar, I was faced with a question, how should I pass around and manage data, especially configuration data. Here i have 2 options. Pass...Discuss·148 readsrapidrails
Maxi Contierimaximilianocontieri.com·Apr 20, 2024Code Smell 248 - Unreliable CopyTL;DR: Don't rely on external solutions without good handlers Problems Silent Modifications Least Surprise Principle violation Fail Fast Principle Violation Solutions Ensure you meet your function's postconditions Use mature languages Conte...Discuss·28 readsCode SmellsGeneral Programming
Vincent Revardvincentrevard.hashnode.dev·Apr 17, 2024Enhancing Code Quality: Refactoring Python Endpoints and JavaScript Fetch Methods through AbstractionIntroduction: In the ever-changing landscape of software development, the need for code refactoring remains constant. Similar to urban planning adapting to modern needs, codebases must evolve to meet new requirements and technological advancements. T...DiscussPython
Maxi Contierimaximilianocontieri.com·Apr 16, 2024Code Smell 247 - Javascript ReplaceTL;DR: Bad function names will lead you to defects Problems Misleading Names The least surprise principle violation Solutions Avoid ambiguous or bad names Define your own functions Use mature languajes Context Some names in immature languag...Discuss·1 likeCode Smellsclean code
Maxi Contierimaximilianocontieri.com·Apr 9, 2024Code Smell 246 - Expiration DateTL;DR: Model real word expiration dates with... expiration dates (I will use expiry date and expiration date interchangeably) Problems Bijection Violation Unexpected Behavior Small Objects Missing Primitive Obsession Solutions Honor the bijec...Discuss·51 readsCode SmellsGeneral Programming
Maxi Contierimaximilianocontieri.com·Apr 3, 2024Code Smell 245 - exec() and eval()TL;DR: Don't use metaprogramming. It is not that cool Problems Security Limited Control Solutions Use direct calls Wrap the execution in a primitive and controlled command Sanitize it Context Developers employ the eval() and exec() funct...Discuss·39 readsCode Smellsclean code
Ninad Mhatreninadmhatre.hashnode.dev·Apr 1, 2024Rewriting a framework!Have you ever decided to reorganise your house/place? Writing a framework, or big project is somewhat like decorating/organizing your house. Confused? Ok, I will try to explain my analogy... When you buy or rent a house, you have a clear (most of the...DiscussProgramming Blogs
Alex Laukeep-calm-and-code-on.hashnode.dev·Mar 29, 2024The Virtuous Cycle of TestingThere are many good reasons to write tests for your code: catching bugs, preventing functionality regressions, defining better interfaces to your modules, the list goes on. But one reason isn't discussed quite as frequently that I like to call "the v...DiscussProductivity
Alex Laukeep-calm-and-code-on.hashnode.dev·Mar 26, 2024In Praise of the TimeboxYou may have heard before that when you work in software development, you eventually build up a sort of "mental toolbox." The more you try out different tools, the more you familiarize yourself with them and know when to apply the right tool for a sp...DiscussProductivity