Arama Sonuçları: "#readablecode"

20 sonuç
Raghu Kishore Vempati
Raghu Kishore Vempati@raghuvempati·
Design code like telling a captivating story! Make each line contribute to the plot, with clear characters (variables) and a well-orchestrated narrative (code flow). Engage your readers (developers) with elegance and readability! #CodeStorytelling #ReadableCode #SoftwareDesign
English
1
0
7
379
Christopher Miller
Christopher Miller@ccmiller2018·
Refactoring: Well there we have it, a whistlestop tour of refactoring unreadable code into more readable code. Does that mean this is now perfect? no not at all - but we've got a lot better than we did. It's now a lot more readable. #ReadableCode
Christopher Miller tweet media
English
0
0
2
132
Christopher Miller
Christopher Miller@ccmiller2018·
Refactoring 1: Simple Layout Changes We're going to start simply by putting in some whitespace to separate things up a bit - a wall of text is super-hard to read, so getting some spacing in there immediately helps us to understand what's happening a bit more. #ReadableCode
Christopher Miller tweet media
English
0
0
2
186
Christopher Miller
Christopher Miller@ccmiller2018·
This week, a series of tweets looking at refactoring some bad code, step by step, into some more readable code. We're going to start with a particularly bad setup, and step by step make it more readable and optimised. let's start with the attached code #ReadableCode
Christopher Miller tweet media
English
2
0
2
868
Christopher Miller
Christopher Miller@ccmiller2018·
Refactor for readability. As code evolves, refactor it to align with best practices, simplify logic, and improve its overall structure. And don't be afraid of colleagues suggesting a refactor in code review! everyone is working together. #Refactoring #ReadableCode
Christopher Miller tweet media
English
1
1
4
298
Christopher Miller
Christopher Miller@ccmiller2018·
Provide constructive feedback when you're asked to review code. Focus on improving code quality and suggest alternative approaches while maintaining a positive tone. There's two ways of saying the same thing - choose the nice one. #Feedback #CodeReview #ReadableCode
Christopher Miller tweet media
English
1
0
3
149
Christopher Miller
Christopher Miller@ccmiller2018·
Log error details. Logging error messages along with context information aids debugging and provides insights into application issues. The example is over-simplified - but remember your logs should actually help you to find the problem. #Logging #ErrorHandling #ReadableCode
Christopher Miller tweet media
English
0
0
2
152
Christopher Miller
Christopher Miller@ccmiller2018·
Use specific exception types. Create custom exception classes to convey meaningful error information and differentiate between different error scenarios. Remember you can stack your exception classes like in the code example: #ErrorHandling #ReadableCode
Christopher Miller tweet media
English
2
3
13
1.1K
Christopher Miller
Christopher Miller@ccmiller2018·
Singletons may lead to tight coupling. Evaluate if they're truly necessary for the intended use case, or whether there's a more appropriate option. you might want to consider a factory instead! which would you choose? 1 or 2? #ReadableCode #DesignPattern
Christopher Miller tweet media
English
1
0
6
710
Christopher Miller
Christopher Miller@ccmiller2018·
Integrate singletons for better testability. If it's the same object every time you call it - mock the call if you need to in test - problem solved! Ok, maybe that's an over-simplification - but it's not far from the truth! it can make it easier! #ReadableCode #DesignPatterns
Christopher Miller tweet media
English
0
0
3
366
Christopher Miller
Christopher Miller@ccmiller2018·
The Singleton pattern ensures a single instance of a class. Use it to manage shared resources like database connections efficiently. Create a single object, then when you need it reuse it - bonus! memory optimization. #DesignPatterns #ReadableCode
Christopher Miller tweet media
English
10
15
102
14K
Christopher Miller
Christopher Miller@ccmiller2018·
Choose decorators wisely to maintain clarity. Don't make everything a decorator - think about your use case for everything you write. There's always choices! I'm pretty sure we can represent a drink choice without 9 decorators! #DesignTips #DesignPatterns #ReadableCode
Christopher Miller tweet media
English
0
0
2
166
Christopher Miller
Christopher Miller@ccmiller2018·
Decorators and core components share a common interface. This ensures interchangeable usage and consistent behaviour. Makes it easy to keep building with decorators. let's take an abstract example #ReadableCode #DesignPatterns
Christopher Miller tweet media
English
0
1
4
332
Christopher Miller
Christopher Miller@ccmiller2018·
Stackable decorators create versatile compositions. Combine decorators to achieve complex behaviors in a modular way. this is contrived purely for example here - I wouldn't advise using html stored like this! #Composition #ReadableCode #DesignPatterns
Christopher Miller tweet media
English
0
1
5
288
Christopher Miller
Christopher Miller@ccmiller2018·
Decorator pattern adds responsibilities dynamically. Wrap objects with decorators to enhance behaviour without altering their structure. my example is of course based on coffee! would you expect anything less from me 🤷 #DesignPatterns #ReadableCode
Christopher Miller tweet media
English
1
1
7
367