Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Other Discussions
  3. The Insider News
  4. Don’t refactor like Uncle Bob. Please

Don’t refactor like Uncle Bob. Please

Scheduled Pinned Locked Moved The Insider News
phpcomcode-review
4 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    Kent Sharkey
    wrote on last edited by
    #1

    Axol[^]:

    “Clean Code” has garnered a bit of notoriety despite coining an endearing term we use in coding conversations.

    Because sometimes you want your code a little unclean

    M 1 Reply Last reply
    0
    • K Kent Sharkey

      Axol[^]:

      “Clean Code” has garnered a bit of notoriety despite coining an endearing term we use in coding conversations.

      Because sometimes you want your code a little unclean

      M Offline
      M Offline
      MarkTJohnson
      wrote on last edited by
      #2

      Read the article, author has some good points. One thing I would have done was use a switch over a bunch of if/else's. Author's refactor of the original is also something I would approve. Not that anyone was asking.

      I’ve given up trying to be calm. However, I am open to feeling slightly less agitated. I’m begging you for the benefit of everyone, don’t be STUPID.

      J C 2 Replies Last reply
      0
      • M MarkTJohnson

        Read the article, author has some good points. One thing I would have done was use a switch over a bunch of if/else's. Author's refactor of the original is also something I would approve. Not that anyone was asking.

        I’ve given up trying to be calm. However, I am open to feeling slightly less agitated. I’m begging you for the benefit of everyone, don’t be STUPID.

        J Offline
        J Offline
        jochance
        wrote on last edited by
        #3

        I was in a car with several greenhorns. One of them said they were in it for the precision. Like math. As though there were explicitly correct answers/ways of getting things done. I found that humorous but couldn't really explain to them why. I feel like the segment of our tribe which came by similar footsteps as that line of thinking though... Upon discovering it doesn't really exist, they set about construction of these various frameworks for perfection and pedantry. Like facades built for personal security these guardrails protecting from the great unknown. It's not all at all bad. It's only the purists I can't stomach. We can entertain "true TDD" or whatever we want from a theoretical/discussion sort of stance. That's awesome. However, I think for some purists this is explicitly antithetical to their puritanical goal of nailing down the 'one right answers' and then never thinking about them or discussing them again.

        1 Reply Last reply
        0
        • M MarkTJohnson

          Read the article, author has some good points. One thing I would have done was use a switch over a bunch of if/else's. Author's refactor of the original is also something I would approve. Not that anyone was asking.

          I’ve given up trying to be calm. However, I am open to feeling slightly less agitated. I’m begging you for the benefit of everyone, don’t be STUPID.

          C Offline
          C Offline
          charlieg
          wrote on last edited by
          #4

          I'm not sure I agree with most of the points made. In my 35 years of writing software, I have _never_ seen code anally refactored to stupid silly functions. Does this really help understanding? Supportability? I'd say meh.

          private void createPluralDependentMessageParts(int count) {
          if (count == 0) {
          thereAreNoLetters();
          } else if (count == 1) {
          thereIsOneLetter();
          } else {
          thereAreManyLetters(count);
          }
          }

          Ten days until my retirement sabbatical, but the opening brace on every function or conditional drives me to drink. And yes, I know that's a religious argument. Sure, you save one line on the page, but it just seems to make the code compressed and hard to scan.

          Charlie Gilley “They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759 Has never been more appropriate.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups