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. The Lounge
  3. Clean Code, who missed the p(o)int... ?

Clean Code, who missed the p(o)int... ?

Scheduled Pinned Locked Moved The Lounge
question
25 Posts 16 Posters 30 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.
  • D Daniel Pfeffer

    It's called Cargo Cult [whatever]. :-\

    Freedom is the freedom to say that two plus two make four. If that is granted, all else follows. -- 6079 Smith W.

    M Offline
    M Offline
    Member 9167057
    wrote on last edited by
    #21

    Right, thank you!

    1 Reply Last reply
    0
    • K KateAshman

      I have one person in my team who will insist on doing things their way, because of clean code and readability. It's such a moot point, IMHO. Practically speaking, you should stick to the following: Structurally, you should keep the cyclometric complexity low --> you'll have cheaper A/B testing in the future, which is a good fallback strategy for unforeseen issues of all sizes. Syntax wise, just copy whatever style is prevalent in the code-base already, and reduce inconsistencies --> cheaper refactoring in the future. Quality wise, you should always aim for less lines of code, without resorting to ANY advanced language techniques --> less reading to understand the code, less esoteric bugs. Just do those three things to drive costs down and quality up. Everything else is pointless. The compiler doesn't care about the look and feel of the code and the user definitely doesn't care. We should take a hint and stop caring so much too.

      A Offline
      A Offline
      Andre_Prellwitz
      wrote on last edited by
      #22

      Programmers who can't be bothered to use linting tools are rarely concerned with cyclometric complexity, or maintenance cost, or refactoring. Also, it seems the broken window theory applies to software: if it's already crap software, most people won't bother with writing good code, resorting instead to the metric of lowest cost to write (even if it means the user or company pays the price many times over).

      J 1 Reply Last reply
      0
      • D DeerBear

        Readability is actually really important. The reason you can't find studies on it is that it varies by language, norms, code history, etc. I mean, sure, there are *some things* that are simply unreadable no matter what, but most often readability is highly subjective and team-based. Making hard and fast rules about it is very impractical and verging - in my opinion - on impossible.

        J Offline
        J Offline
        jschell
        wrote on last edited by
        #23

        DeerBear wrote:

        The reason you can't find studies on it is that it varies by language, norms, code history, etc.

        Nope. The reason you can't find any studies on it is because one needs to first be able to measure something to do a study. You can't declare that something is 'better' if you cannot define how to measure that it is so. Would you sign a contract that said your code must be 'better' or you don't get paid unless the contract specifically stated how that would be measured?

        1 Reply Last reply
        0
        • A Andre_Prellwitz

          Programmers who can't be bothered to use linting tools are rarely concerned with cyclometric complexity, or maintenance cost, or refactoring. Also, it seems the broken window theory applies to software: if it's already crap software, most people won't bother with writing good code, resorting instead to the metric of lowest cost to write (even if it means the user or company pays the price many times over).

          J Offline
          J Offline
          jschell
          wrote on last edited by
          #24

          Andre_Prellwitz wrote:

          bothered to use linting tools are

          Sigh... Static checkers are useless. They were useless 40 years ago when I first saw them and just as useless now. I have seen a static checked which tagged switch statements as being too complex. The 'solution' which some programmer implemented to fix that and which was reviewed and passed involved creating 40 objects every single time. 40 objects that could not even be created successfully every time. That code ended up in production. So it went from a very valid and correct idiom to one that failed. If the teams consists of NOTHING but junior developers then maybe they might provide a benefit. But if there is even one mid level developer and that person actually takes code review seriously then that is going to be far more effective.

          A 1 Reply Last reply
          0
          • J jschell

            Andre_Prellwitz wrote:

            bothered to use linting tools are

            Sigh... Static checkers are useless. They were useless 40 years ago when I first saw them and just as useless now. I have seen a static checked which tagged switch statements as being too complex. The 'solution' which some programmer implemented to fix that and which was reviewed and passed involved creating 40 objects every single time. 40 objects that could not even be created successfully every time. That code ended up in production. So it went from a very valid and correct idiom to one that failed. If the teams consists of NOTHING but junior developers then maybe they might provide a benefit. But if there is even one mid level developer and that person actually takes code review seriously then that is going to be far more effective.

            A Offline
            A Offline
            Andre_Prellwitz
            wrote on last edited by
            #25

            Agreed, static code analysis is designed to provide false positives over false negatives. What I actually meant was the simple linters that fix code style differences; if you cannot even agree on standards (rules such as "interface names should start with the letter 'I'", or "avoid Hungarian notation") then what are the odds you can agree on what's considered "clean"?

            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