#DevDiscuss Archive


Tuesday July 17, 2018
9:00 PM EDT

  • ThePracticalDev Jul 17 @ 9:05 PM EDT
    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?
  • bendhalpern Jul 17 @ 9:08 PM EDT
    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
    • ThePracticalDev Jul 17 @ 9:05 PM EDT
      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?
  • aminecodes Jul 17 @ 9:08 PM EDT
    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
  • kylegalbraith Jul 17 @ 9:08 PM EDT
    Refactoring with good test coverage == awesome. Refactoring with no test coverage == running with a chainsaw over hot coals. #DevDiscuss
  • DanFellini Jul 17 @ 9:09 PM EDT
    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
  • kylegalbraith Jul 17 @ 9:10 PM EDT
    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
  • kylegalbraith Jul 17 @ 9:12 PM EDT
    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
  • thefredelement Jul 17 @ 9:13 PM EDT
    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
    • ThePracticalDev Jul 17 @ 9:05 PM EDT
      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?
  • ASpittel Jul 17 @ 9:14 PM EDT
    I'm a little bit obsessed with clean code, so I love refactoring to get it where I want it! #DevDiscuss
  • bendhalpern Jul 17 @ 9:15 PM EDT
    I highly recommend this post on refactoring for newer devs #DevDiscuss https://t.co/sZN5uJGuzn
  • kunde21 Jul 17 @ 9:16 PM EDT
    Tip: As you're creating a feature PR, keep refactor changes in git stash. That way you can build the refactor commit quickly and easily. #DevDiscuss
  • derekjhopper Jul 17 @ 9:16 PM EDT
    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
    In reply to @ThePracticalDev
  • kylegalbraith Jul 17 @ 9:17 PM EDT
    How do you balance clean code with getting a feature in customers hands or is the balance a fallacy? #DevDiscuss
    In reply to @ASpittel
  • t_sedgwick Jul 17 @ 9:18 PM EDT
    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
    • ThePracticalDev Jul 17 @ 9:05 PM EDT
      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?
  • aminecodes Jul 17 @ 9:18 PM EDT
    RT kylegalbraith: Refactoring with good test coverage == awesome. Refactoring with no test coverage == running with a chainsaw over hot coals. #DevDiscuss https://t.co/rUqdigNIvI
  • aminecodes Jul 17 @ 9:18 PM EDT
    RT bendhalpern: I highly recommend this post on refactoring for newer devs #DevDiscuss https://t.co/czEQaEz4oi
  • kylegalbraith Jul 17 @ 9:18 PM EDT
    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
  • EntirelyAmelia Jul 17 @ 9:18 PM EDT
    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
    In reply to @ThePracticalDev
  • derekjhopper Jul 17 @ 9:18 PM EDT
    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
    In reply to @ThePracticalDev
  • theaccordance Jul 17 @ 9:20 PM EDT
    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
    • ThePracticalDev Jul 17 @ 9:05 PM EDT
      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?
  • derekjhopper Jul 17 @ 9:20 PM EDT
    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
    In reply to @ThePracticalDev
  • gdavis92 Jul 17 @ 9:21 PM EDT
    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
    • ThePracticalDev Jul 17 @ 9:05 PM EDT
      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?
  • derekjhopper Jul 17 @ 9:22 PM EDT
    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
    In reply to @ThePracticalDev
  • DominicDuffin1 Jul 17 @ 9:23 PM EDT
    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
    In reply to @ThePracticalDev
  • Red_Shirt_no2 Jul 17 @ 9:23 PM EDT
    #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”.
    • ThePracticalDev Jul 17 @ 9:05 PM EDT
      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?
  • kylegalbraith Jul 17 @ 9:23 PM EDT
    Yes. In my experience refactoring is where could TDD practices really pays off. #DevDiscuss
    In reply to @orangetide, @ThePracticalDev
  • derekjhopper Jul 17 @ 9:24 PM EDT
    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
    In reply to @ThePracticalDev
  • kylegalbraith Jul 17 @ 9:24 PM EDT
    100% agree. I open some of my projects, start refactoring, and actually stop myself because it isn't worth unraveling everything. #DevDiscuss
    In reply to @ASpittel
  • kylegalbraith Jul 17 @ 9:25 PM EDT
    #DevDiscuss
    In reply to @Red_Shirt_no2
  • t_sedgwick Jul 17 @ 9:25 PM EDT
    As for tips, I would always suggest starting with the unit tests. If the tests can be improved, chances are the code will follow. #DevDiscuss
  • jhartikainen Jul 17 @ 9:26 PM EDT
    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
    • ThePracticalDev Jul 17 @ 9:05 PM EDT
      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?
  • kylegalbraith Jul 17 @ 9:26 PM EDT
    Yes!!! If you tell your PM this refactor is necessary because it has this business impact, it is much easier for them to get it. #DevDiscuss
    In reply to @derekjhopper, @ThePracticalDev
  • Red_Shirt_no2 Jul 17 @ 9:28 PM EDT
    #DevDiscuss 2) Yes...
    • ThePracticalDev Jul 17 @ 9:05 PM EDT
      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?
  • derekjhopper Jul 17 @ 9:31 PM EDT
    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
    In reply to @ThePracticalDev
  • MetroNorthRider Jul 17 @ 9:31 PM EDT
    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
    In reply to @ThePracticalDev
  • Red_Shirt_no2 Jul 17 @ 9:32 PM EDT
    #DevDiscuss 3) a) think before you start! Refactoring happens because of unanticipated use-cases or design errors; what else might have been missed?
    • ThePracticalDev Jul 17 @ 9:05 PM EDT
      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?
  • derekjhopper Jul 17 @ 9:33 PM EDT
    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
    In reply to @MetroNorthRider, @ThePracticalDev
  • aminecodes Jul 17 @ 9:33 PM EDT
    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. #DevDiscuss https://t.co/lD4QP8HZIO
  • aminecodes Jul 17 @ 9:33 PM EDT
    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
  • aminecodes Jul 17 @ 9:33 PM EDT
    RT ASpittel: I'm a little bit obsessed with clean code, so I love refactoring to get it where I want it! #DevDiscuss
  • aminecodes Jul 17 @ 9:33 PM EDT
    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. #DevDiscuss https://t.co/6qqrmDsQrj
  • Radegund Jul 17 @ 9:35 PM EDT
    #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.
  • Radegund Jul 17 @ 9:36 PM EDT
    #DevDiscuss moving to a different more appropriate language was most of the improvement. But cleaned up a lot on the way past.
  • Red_Shirt_no2 Jul 17 @ 9:36 PM EDT
    #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.
  • ProfExistential Jul 17 @ 9:38 PM EDT
    “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
  • kylegalbraith Jul 17 @ 9:38 PM EDT
    This is very important. Don't dive into refactoring without understanding the existing behavior. #DevDiscuss
    In reply to @derekjhopper, @MetroNorthRider, @ThePracticalDev
  • BaherRamzy Jul 17 @ 9:39 PM EDT
    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
    In reply to @ThePracticalDev
  • MetroNorthRider Jul 17 @ 9:40 PM EDT
    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
    In reply to @derekjhopper, @ThePracticalDev
  • kesh_char Jul 17 @ 9:41 PM EDT
    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 !
    In reply to @ThePracticalDev
  • cszhu Jul 17 @ 9:44 PM EDT
    Honestly is there any better feeling than being able to cut down latency and % of lines by 50%? 😃 of course I enjoy it! #DevDiscuss
    In reply to @ThePracticalDev
  • ThePracticalDev Jul 17 @ 9:44 PM EDT
    When do you know that refactoring is worth it vs just accepting the technical debt and moving on? #DevDiscuss
  • MetroNorthRider Jul 17 @ 9:45 PM EDT
    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
    In reply to @ThePracticalDev
  • Programazing Jul 17 @ 9:45 PM EDT
    Check out my website/blog at https://t.co/4DAQVTUa1s #DevDiscuss
  • kylegalbraith Jul 17 @ 9:47 PM EDT
    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
  • aminecodes Jul 17 @ 9:48 PM EDT
    When do you know that refactoring is worth it vs just accepting the technical debt and moving on? #DevDiscuss
  • aminecodes Jul 17 @ 9:48 PM EDT
    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
  • ehkasper Jul 17 @ 9:48 PM EDT
    When your tech debts slow you down on further features/improvements #DevDiscuss
    • ThePracticalDev Jul 17 @ 9:44 PM EDT
      When do you know that refactoring is worth it vs just accepting the technical debt and moving on? #DevDiscuss
  • derekjhopper Jul 17 @ 9:52 PM EDT
    What's a good way to figure out if tech debt is slowing you down too much? #DevDiscuss
    In reply to @ehkasper
  • IgnoreIntuition Jul 17 @ 9:54 PM EDT
    I would add maintainability to that list. #DevDiscuss
    In reply to @kylegalbraith
  • kylegalbraith Jul 17 @ 9:55 PM EDT
    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
    In reply to @derekjhopper, @ehkasper
  • DominicDuffin1 Jul 17 @ 9:55 PM EDT
    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
    In reply to @ThePracticalDev
  • ehkasper Jul 17 @ 9:58 PM EDT
    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
    In reply to @derekjhopper