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. 6 tips for writing more maintainable code

6 tips for writing more maintainable code

Scheduled Pinned Locked Moved The Insider News
htmlcsscom
5 Posts 5 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

    Jaxenter[^]:

    Not making code easily understandable for other developers will inevitably increase the cost down the line, especially if the person working on the code you wrote has no other choice but to start over from scratch.

    Bonus #0: Write it all on one line, less scrolling that way

    D D 2 Replies Last reply
    0
    • K Kent Sharkey

      Jaxenter[^]:

      Not making code easily understandable for other developers will inevitably increase the cost down the line, especially if the person working on the code you wrote has no other choice but to start over from scratch.

      Bonus #0: Write it all on one line, less scrolling that way

      D Offline
      D Offline
      dan g 0
      wrote on last edited by
      #2

      Less vertical scrolling anyway... ;)

      .dan.g. AbstractSpoon Software email: abstractspoon-todolist-support(at)googlegroups(dot)com

      J R 2 Replies Last reply
      0
      • D dan g 0

        Less vertical scrolling anyway... ;)

        .dan.g. AbstractSpoon Software email: abstractspoon-todolist-support(at)googlegroups(dot)com

        J Offline
        J Offline
        Jan Steyn
        wrote on last edited by
        #3

        Keep variable names short. a, b c and d suffice. If you run out, there is always a1, b1 etc. That way you cut down on horizontal scrolling.

        1 Reply Last reply
        0
        • D dan g 0

          Less vertical scrolling anyway... ;)

          .dan.g. AbstractSpoon Software email: abstractspoon-todolist-support(at)googlegroups(dot)com

          R Offline
          R Offline
          Rob Grainger
          wrote on last edited by
          #4

          Simple, set your text editor to wrap lines.

          "If you don't fail at least 90 percent of the time, you're not aiming high enough." Alan Kay.

          1 Reply Last reply
          0
          • K Kent Sharkey

            Jaxenter[^]:

            Not making code easily understandable for other developers will inevitably increase the cost down the line, especially if the person working on the code you wrote has no other choice but to start over from scratch.

            Bonus #0: Write it all on one line, less scrolling that way

            D Offline
            D Offline
            Dan Neely
            wrote on last edited by
            #5

            REM Please ignore that I don't actually know how to write proper VB6 :laugh:

            REM LALALALALALAicanthearyouLALALALA
            REM Makes all error messages go away
            On Error Resume Next

            sub UnpolishableTurd
            Count = Count/MAGIC_NUMBER_CONSTANT REM ZERO_CONSTANT defined as 0 elsewhere
            end sub

            REM confirms UnpolishableTurd doesn't error
            sub ICanHazUnitTest
            UnpolishableTurd()
            end sub

            Quote:

            Comment your code

            Got comments

            Quote:

            Don’t forget about error checking

            I handled every possible error

            Quote:

            Use less code

            In as little code as possible

            Quote:

            Write code that can be easily modified

            That's why I'm using a constant instead of hard coding my magic number

            Quote:

            Write code that can be easily tested

            I have tests

            Quote:

            Fix the problem, not the symptoms

            Oh elephant

            Did you ever see history portrayed as an old man with a wise brow and pulseless heart, waging all things in the balance of reason? Is not rather the genius of history like an eternal, imploring maiden, full of fire, with a burning heart and flaming soul, humanly warm and humanly beautiful? --Zachris Topelius Training a telescope on one’s own belly button will only reveal lint. You like that? You go right on staring at it. I prefer looking at galaxies. -- Sarah Hoyt

            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