Time for #DevDiscuss
Tonight's topic is REFACTORING
Let's start with a few questions:
Do you enjoy refactoring?
Do you get to do refactoring regularly?
What are your tips for a good refactoring process?
I really enjoy refactoring when I'm in the mood, and feel like I can really justify sinking my teeth into some code that can be improved. But sometimes I go a while between opportunities to really sink my teeth into the process these days. #DevDiscuss
Time for #DevDiscuss
Tonight's topic is REFACTORING
Let's start with a few questions:
Do you enjoy refactoring?
Do you get to do refactoring regularly?
What are your tips for a good refactoring process?
Time for #DevDiscuss
Tonight's topic is REFACTORING
Let's start with a few questions:
Do you enjoy refactoring?
Do you get to do refactoring regularly?
What are your tips for a good refactoring process? https://t.co/ipOdxFWpEV
Refactoring for me is a painfully beautiful process. I look at code I wrote three years ago and say, "wow dude, that's pretty sloppy" and get a sad. But then enjoy the process of improving it with what I've learned since then. #devdiscuss
In all seriousness, I enjoy the process of refactoring, its like spring cleaning and it feels good when you leave something better than how you found it. #DevDiscuss
There is a best practice I follow to prevent unravelling the entire code base when it comes to refactoring. If I can't refactor it to where it improves the performance, stability, or customer value then I probably should tug on that string. #DevDiscuss
I love refactoring.. my tips would be, try to understand first, make/review test of the signatures and then make a refactoring plan. If you're usually under feature crunch, a plan is key so you can chunk away when you get the time or have an opportunity.
#DevDiscuss
Time for #DevDiscuss
Tonight's topic is REFACTORING
Let's start with a few questions:
Do you enjoy refactoring?
Do you get to do refactoring regularly?
What are your tips for a good refactoring process?
I love refactoring, but I don't get to do it as often as I'd like (I know right). #DevDiscuss Here are some tips:
✅ Refactoring with tests in place is WAY LESS risky
✅ If you don't have tests, write them before refactoring
✅ Tests that test behavior make it easier to refactor
We are constantly learning and should take opportunities to refactor based on our new learnings. It’s a natural part of developing. Refactoring should be a priority for a team whenever touching code. It’s a sign of growth. #DevDiscuss
Time for #DevDiscuss
Tonight's topic is REFACTORING
Let's start with a few questions:
Do you enjoy refactoring?
Do you get to do refactoring regularly?
What are your tips for a good refactoring process?
RT kylegalbraith: Refactoring with good test coverage == awesome. Refactoring with no test coverage == running with a chainsaw over hot coals. #DevDiscusshttps://t.co/rUqdigNIvI
Another key practice in my mind is smaller chunks of refactoring are better than massive changes. This can be hard with legacy code bases though as a small change in one place has ramifications. #DevDiscuss
I try to refactor as much as is needed and time allows. Best tip is to have solid test coverage before you touch anything. Makes it easier to avoid breaking thinsgs. #DevDiscuss
If your tests are testing implementation details, refactoring is going to make you feel 🤮. When your tests are testing the behavior of what you're implementing, refactoring is so much easier. #DevDiscuss
1. I enjoy making my daily life easier
2. Not as often as I’d like, but I strive to give my team a couple opportunities every year
3. Understand the problem fully - what are the business rules that you have to respect, and what is the scaling direction
#DevDiscuss
Time for #DevDiscuss
Tonight's topic is REFACTORING
Let's start with a few questions:
Do you enjoy refactoring?
Do you get to do refactoring regularly?
What are your tips for a good refactoring process?
Bonus: If your tests are testing behavior, you can refactor freely. If you have to change your tests every time you refactor, you're not testing the behavior anymore. #DevDiscuss
I write code for an agency, so it really depends on the budgeted time for the project.
I do enjoy modernizing and refactoring when possible, but it rarely is unfortunately. #DevDiscuss
Time for #DevDiscuss
Tonight's topic is REFACTORING
Let's start with a few questions:
Do you enjoy refactoring?
Do you get to do refactoring regularly?
What are your tips for a good refactoring process?
When you're working with a client or even on your company's product, you often have to sell refactoring. Most of the time, you can't refactor just because you like to do it. Always be thinking about how refactoring can be sold to the business. #DevDiscuss
I like the idea of refactoring, but I don't do it that often - I could refactor a lot of old stuff I've done, and the difference would be pretty satisfying given what I've learnt since I made it - but I'm at the stage where its more productive to just make new stuff. #DevDiscuss
#DevDiscuss
1) It’s kind of like a really big poop; part of the time it hurts, part of the time it flows really well, & things seem so much lighter when you’re done. On the whole, that’s a “yes”.
Time for #DevDiscuss
Tonight's topic is REFACTORING
Let's start with a few questions:
Do you enjoy refactoring?
Do you get to do refactoring regularly?
What are your tips for a good refactoring process?
An easier way to sell refactoring is to think how a refactoring could better serve the client or your customers. Sometimes a refactoring allows you to deliver features faster, improve performance or provide a better user experience.
Always be selling. #DevDiscuss
Best tip: Refactoring doesn't have to be a large change!
Try to do a bit of tidying up as you do other changes and tasks. Suddenly your codebase remains much nicer almost with no effort.
#DevDiscuss
Time for #DevDiscuss
Tonight's topic is REFACTORING
Let's start with a few questions:
Do you enjoy refactoring?
Do you get to do refactoring regularly?
What are your tips for a good refactoring process?
Time for #DevDiscuss
Tonight's topic is REFACTORING
Let's start with a few questions:
Do you enjoy refactoring?
Do you get to do refactoring regularly?
What are your tips for a good refactoring process?
A good reason to ensure you're making private methods private so nobody else can use them: You can refactor them, change their names, change their implementation, do whatever the hell you want. #DevDiscuss
One thing I've learned about refactoring is to be sensitive of the previous programmers' efforts (when you're doing the refactoring) and to check your ego at the door when your code is being refactored.
#DevDiscuss
Time for #DevDiscuss
Tonight's topic is REFACTORING
Let's start with a few questions:
Do you enjoy refactoring?
Do you get to do refactoring regularly?
What are your tips for a good refactoring process?
I completely agree. It's easy for the WTFs to pop up in your head. There could be a very particular reason things were done that way and you should be careful to make sweeping changes without knowing why. #DevDiscuss
RT gdavis92: I write code for an agency, so it really depends on the budgeted time for the project.
I do enjoy modernizing and refactoring when possible, but it rarely is unfortunately. #DevDiscusshttps://t.co/lD4QP8HZIO
RT EntirelyAmelia: ThePracticalDev I try to refactor as much as is needed and time allows. Best tip is to have solid test coverage before you touch anything. Makes it easier to avoid breaking thinsgs. #DevDiscuss
RT jhartikainen: Best tip: Refactoring doesn't have to be a large change!
Try to do a bit of tidying up as you do other changes and tasks. Suddenly your codebase remains much nicer almost with no effort.
#DevDiscusshttps://t.co/6qqrmDsQrj
#DevDiscuss you refractor when you need to to. It can be a rabbit hole. I once rewrote a backend in secret, the boss was a bit cross when he discovered the reason for my lack of productivity. But in the end was happy with the 10x speed up and much smaller code base.
#DevDiscuss
3)b) Tell people how & why you’re refactoring. Code and design reviews — even desk checks, if changes are minor — are a good way to do that. You might find out you’ve missed something, & institutional wisdom rises.
“Refactoring” by @martinfowler is good stuff, but “Working Effectively With Legacy Code” by @mfeathers is what you need
Why?
How often have you inherited a well tested & organized code base? Legacy code is code w/o tests. To add test, you must _first_ refactor it
#DevDiscuss
My favorite activity! There's a special type of satisfaction to be found when you're able to make code more readable, maintainable and performant all at once. #DevDiscuss
Often the goal at the time can be different. Compare making something work for the first time and meeting a production deadline to making the code modular for another project. Code can evolve through refactoring. #NoJudging#DevDiscuss
Refactoring is fun only if we have the full freedom to change the content from scratch #DevDiscuss , else it will be a discussion nightmare to convince those who originally worked on the code. Coder's Ego !
You must have a goal in mind when you begin refactoring.
1. To add testing for currently untested or untestable code.
2. To rework the code for a pending enhancement.
3. Improve performance or stability in a measurable way.
#DevDiscuss
To determine if refactoring is worth it, you have to be able to tie it back to something that delivers value. Scale, performance, stability, your own mental health when you're on support all provide value. Customer value is even better, but tech debt is rarely that. #DevDiscuss
RT cszhu: ThePracticalDev Honestly is there any better feeling than being able to cut down latency and % of lines by 50%? 😃 of course I enjoy it! #DevDiscuss
This has always been the struggle for me. My litmus test has been that if it slows just me down probably leave it alone for a bit if it slows more than just me down. Probably needs a refactor. #DevDiscuss
If I'm writing code for a university assignment, it's worth refactoring if I can think of a better way to do something _before_ I submit it. #DevDiscuss
It depends on your daily workflow/processes. To me it smells like a tech debt when a story should be simpler, but I have to explain why its going to take longer to deliver due to a specific part of the code or design #DevDiscuss