
Taniya malviya
@coder_tani
korean lover | fullstack developer | angular js | react js | react native | nodejs | nextjs | nestjs | AWS S3 | AWS EC2
Tal vez te guste
10 VS Code extensions that will 10x your productivity:

peak dev happiness: everyone looking at the same bug and pretending they understand.

Can't add a method to a class you don't own? Use a Foreign Method! - Create the method in YOUR code - Pass the utility object as parameter Example (JS): function formatWithTimezone(date) { return StringUtils.format(date) + " UTC"; } #ProgrammingTips #CodeRefactoring
Remove Middle Man: When a class just delegates calls (adding no value): - Delete the delegating methods - Make clients call directly Before: manager.getEmployee().getName() After: employee.getName() Cut the pointless proxy! #CleanCode #Refactoring
Hide Delegate: If clients access object B through object A, make A handle the call instead. Before: a.getB().doSomething() After: a.doSomething() Reduces coupling! #CleanCode #OOP Example: user.getAddress().format() → user.formatAddress()
Fixing Pain as a Typescript Dev

Extract Class: When one class tries to do two jobs: - Split into two classes - Connect via reference Before: class User { saveToDB() {...} sendEmail() {...} } After: class User {} + class EmailService {} #SOLID #Refactoring
Move Field Refactoring: - Add field to new class - Redirect all old field access - Delete old field Keeps data where it’s used most! #CleanCode #Refactoring Example: user.address → profile.address
Move Method: When a method is used more by another class than its own: - Cut from source class - Paste into target class - Update references Keeps behavior near its data! #OOP #Refactoring Example: user.getAddress() → address.format()
you joined twitter. ↓ you didn’t understand. ↓ forgot about it for years. ↓ came back randomly one day. ↓ you got addicted.
Swapping algorithms? Do it! Old: for-loop summation New: arr.reduce() #CodeQuality #WebDev #DesignPattern #Javascript
Replace Method with Method Object: When: A method is too complex (dozens of lines, many vars). Before: function calc() { /* 50 lines */ } After: class Calculator { execute() { /* split logic */ } } #Refactoring #CleanCode
Never reassign parameters! Use a local var instead. Before: function foo(x) { x = 2; } After: function foo(x) { const y = 2; } #JavaScript #CodeSmells
I have two kinds of problems, the urgent and the important. The urgent are not important, and the important are never urgent. (By Eisenhower)
Split temps = One job per variable. Before: let t = x(); t = y(); After: const a = x(); const b = y(); #CodeQuality #JavaScript
Replace Temp with Query (JS): Before: const discount = basePrice * 0.1; return total - discount; After: function getDiscount() { return basePrice * 0.1; } return total - getDiscount(); #JavaScript #CodeQuality
Inline Temp Refactoring: Replace a variable with its expression. Before: const discount = basePrice * 0.1; return total - discount; After: return total - (basePrice * 0.1); Make simple code!! #CleanCode #Refactoring
United States Tendencias
- 1. #wednesdaymotivation 6,813 posts
- 2. Good Wednesday 30.6K posts
- 3. Jay Jones 58.9K posts
- 4. #LoveYourW2025 234K posts
- 5. Hump Day 14.3K posts
- 6. Markey 1,297 posts
- 7. Christen Press 1,909 posts
- 8. Vision Pro 2,903 posts
- 9. Voting Rights Act 8,975 posts
- 10. Moulton N/A
- 11. Young Republicans 107K posts
- 12. #VxWKOREA 58.7K posts
- 13. iPad Pro 5,905 posts
- 14. #GenV 4,936 posts
- 15. Happy Hump 8,749 posts
- 16. And the Word 74.6K posts
- 17. Hobi 40.4K posts
- 18. #WednesdayWisdom N/A
- 19. Tami 5,320 posts
- 20. St. Teresa of Avila 2,566 posts
Tal vez te guste
Something went wrong.
Something went wrong.