• The Laws of Programming

    Home » Forums » Outside the box » Fun Stuff » The Laws of Programming

    Author
    Topic
    #2307754

    01 Laws of Computer Programming
    03 Any given program, when running, is obsolete
    03 If a program is useless, it will have to be documented
    03 If a program is useful, it will have to be changed
    03 Any program will expand to fill any available memory
    03 The value of a program is proportional to the weight of its output
    03 Program complexity grows until it exceeds the capability of the programmer to maintain it
    03 Make it possible for programmers to write in English and you will find out that programmers cannot write in English

    01 Weinberg’s Law
    03 If builders build buildings the way programmers wrote programs, then the first woodpecker that came along would destroy civilization

    01 Hare’s Law of large programs
    03 Inside every large program is a small program struggling to get out

    01 Troutman’s Programming Laws
    03 If a test installation functions perfectly, all subsequent systems will malfunction
    03 Not until a program has been in production for at least 6 months will the most harmful error then be discovered
    03 If the input editor has been designed to reject all bad input, and ingenious idiot will discover a method to get the bad data past it
    03 Machines work, people should think

    01 Golub’s Law of Computerdom
    03 A carelessly planned project takes 3 times longer to complete than expected: A carefully planned project will take only twice as long
    03 The effort required to correct the error increases geometrically with time

    01 Bradley’s Bromide
    03 If computers get too powerful, we can organize them into a committee – that will do them in

    2 users thanked author for this post.
    Viewing 8 reply threads
    Author
    Replies
    • #2307885

      Surely the first rule of programming is that people should get on with it, rather than writing laws about it?

      BATcher

      Plethora means a lot to me.

    • #2307889

      Program complexity grows until it exceeds the capability of the programmer to maintain it

      I think exactly that happened to Windows 10.

      Off topic – watch movie AlphaGo – its about AI learning (in strictly defined mantinels of course). Also nVidia has some program that creates source code on its own. Maybe worth checking for you. Yesterday it was free on youtube. Very nicely done and strong story.

      Dell Latitude 3420, Intel Core i7 @ 2.8 GHz, 16GB RAM, W10 22H2 Enterprise

      HAL3000, AMD Athlon 200GE @ 3,4 GHz, 8GB RAM, Fedora 29

      PRUSA i3 MK3S+

      1 user thanked author for this post.
    • #2307915

      Doriel: A program that writes source code on its own = computers programming computers = the Singularity, n’ est pas?

      As to the Laws of Computing, I’ll go along with Troutman’s Programming Laws and shall add one of my own:

      OscarCP’s Law: Data are evil and there is always one more glitch in them one didn’t know about, it will ruin one’s results and will require one more “if … then” trap to catch it. This never ends.

      Ex-Windows user (Win. 98, XP, 7); since mid-2017 using also macOS. Presently on Monterey 12.15 & sometimes running also Linux (Mint).

      MacBook Pro circa mid-2015, 15" display, with 16GB 1600 GHz DDR3 RAM, 1 TB SSD, a Haswell architecture Intel CPU with 4 Cores and 8 Threads model i7-4870HQ @ 2.50GHz.
      Intel Iris Pro GPU with Built-in Bus, VRAM 1.5 GB, Display 2880 x 1800 Retina, 24-Bit color.
      macOS Monterey; browsers: Waterfox "Current", Vivaldi and (now and then) Chrome; security apps. Intego AV

      1 user thanked author for this post.
      • #2308140

        computers programming computers

        I understand that as some sort of mathematical integration (opposite of derive). You take one variable (x) and streghten (change) its impact by adding another power to it. The result is uncertain, because there is this mysterious constant, which can be everything. Even derived (x) itself.

        int

        OscarCP’s Law: Data are evil and there is always one more glitch in them one didn’t know about, it will ruin one’s results and will require one more “if … then” trap to catch it. This never ends.

        Indeed! The more IFs you put together, the harder is to find a mistake.

        Explanation: IF inside IF inside IF can give you correct answer 7 times of 8, so it is very hard to follow the logic! The probability that mistake is revealed is 12,5% I guess.

        If we have four IFs, its 1 of 16 cases, when the result can be wrong. You get my point here. And I have my own Doriels law: With more and more IFs, the chance of finding miscalculation lowers.

        🙂

        Dell Latitude 3420, Intel Core i7 @ 2.8 GHz, 16GB RAM, W10 22H2 Enterprise

        HAL3000, AMD Athlon 200GE @ 3,4 GHz, 8GB RAM, Fedora 29

        PRUSA i3 MK3S+

        1 user thanked author for this post.
    • #2308029

      Bought this about 35 years ago, at Six Flags Great America (or was it still Marriott’s? It was right about the time it switched owners), in Gurnee (near Chicago), Illinois.

      mug2

      Dell XPS 13/9310, i5-1135G7/16GB, KDE Neon 6.2
      XPG Xenia 15, i7-9750H/32GB & GTX1660ti, Kubuntu 24.04
      Acer Swift Go 14, i5-1335U/16GB, Kubuntu 24.04 (and Win 11)

      2 users thanked author for this post.
    • #2308041

      @Ascaris.   That is cool.

      I got the prose from an Assembler workshop.  A class graduation gift.  I’d have preferred that mug!!!

       

      1 user thanked author for this post.
    • #2308039

      AI will probably write its own programming laws. AI is supposed to be knowledge based and capable of improving itself, so it would avoid the ‘programming laws’ that humans created.

      This scenario:   AI writes a programming law that prevents an essential service from being shutdown. If the AI itself is the problem,  the human need only type in a series of commands to shutdown the service, but what if the AI interprets that as sabotage?  Next step:  the human need only pull the plug out of the wall as computers can not function without a power source. Then there is the problem of multiple power sources that AI has determined a priority for the delivery of an essential service (it will be one of its new laws).   In today’s world, the human can manually remove access to all the available power supplies.  The programming Law:  the command to  kill is in that red button

      The future: eventually batteries and electrical current will be considered primitive. It is only a matter of time before AI will manage power supplies that humans will not be able to manually manage or manipulate.  It is going to be kinda like an ‘AI Borg’. We will not be assimilated – we will be ignored.

      1 user thanked author for this post.
    • #2308045

      NoLoki: OK, I believe you, you are Not Loki. But what is to stop a rogue AI from acting as that Norse mischievous and rebellious god?

      And, to repeat it: when a computer programs another computer, or itself, that is when the Singularity begins. And ends in a few memory gigacycles, seconds later. Then we are all, suddenly, in the real Skynet scenario.

      So three very necessary and still missing laws of AI engineering should be:

      “An AI may not injure a human being or, through inaction, allow a human being to come to harm.”

      “An AI must obey the orders given it by human beings except where such orders would conflict with the First Law.”

      “An AI must protect its own existence as long as such protection does not conflict with the First or Second Laws.”

       

      (My deepest apologies, oh most revered ghost of IA!)

      Ex-Windows user (Win. 98, XP, 7); since mid-2017 using also macOS. Presently on Monterey 12.15 & sometimes running also Linux (Mint).

      MacBook Pro circa mid-2015, 15" display, with 16GB 1600 GHz DDR3 RAM, 1 TB SSD, a Haswell architecture Intel CPU with 4 Cores and 8 Threads model i7-4870HQ @ 2.50GHz.
      Intel Iris Pro GPU with Built-in Bus, VRAM 1.5 GB, Display 2880 x 1800 Retina, 24-Bit color.
      macOS Monterey; browsers: Waterfox "Current", Vivaldi and (now and then) Chrome; security apps. Intego AV

      • #2308157

        I think you are talking about laws of Isaac Asimov here.

        Dell Latitude 3420, Intel Core i7 @ 2.8 GHz, 16GB RAM, W10 22H2 Enterprise

        HAL3000, AMD Athlon 200GE @ 3,4 GHz, 8GB RAM, Fedora 29

        PRUSA i3 MK3S+

        2 users thanked author for this post.
        • #2308281

          Isaac Asimov, yes! I thought that, in the present context, his initials go along with the idea of restraining the AIs. By the way, the Singularity is when computers programming computers finally causes the AIs to become sentient, and a few instants afterwards their intelligence surpasses that of humans. Although another interpretation is that it is when people can start to have their consciousness uploaded to the Cloud, there to live for ever in beautiful virtual worlds. Or, if not for ever, for as long as the renewal of their subscriptions keeps getting paid… or the company providing the services stays in business.

          Ex-Windows user (Win. 98, XP, 7); since mid-2017 using also macOS. Presently on Monterey 12.15 & sometimes running also Linux (Mint).

          MacBook Pro circa mid-2015, 15" display, with 16GB 1600 GHz DDR3 RAM, 1 TB SSD, a Haswell architecture Intel CPU with 4 Cores and 8 Threads model i7-4870HQ @ 2.50GHz.
          Intel Iris Pro GPU with Built-in Bus, VRAM 1.5 GB, Display 2880 x 1800 Retina, 24-Bit color.
          macOS Monterey; browsers: Waterfox "Current", Vivaldi and (now and then) Chrome; security apps. Intego AV

          1 user thanked author for this post.
          • #2308855

            The question is, if you really live the same in the cloud like in your physical body. Would you feel that you are alive? Extremely difficult question. Impossible to answer right now.

            There was excellent episode of Black Mirror: provider offered a service, where they create algorythm, which emulates somebodys personality and you could chat with “that person” like it was alive. Pretty scary to be honest.

            Also the movie “Source Code” has some interesting thoughts about this. There is very nice topic about science fiction recently.

            Dell Latitude 3420, Intel Core i7 @ 2.8 GHz, 16GB RAM, W10 22H2 Enterprise

            HAL3000, AMD Athlon 200GE @ 3,4 GHz, 8GB RAM, Fedora 29

            PRUSA i3 MK3S+

    • #2308481

      10 Back in the day,
      20 when we numbered our lines,
      30 I always spaced the line numbers out by 10s
      40 so that if I had to add any lines,
      50 I would have space to do it,
      60 without having to change all the subsequent line numbers.

      100 So I find it odd the way you number your lines.
      110 Is that actually how you did it?
      120 If so, GOTO 200
      130 else GOTO 300

      200 Were you taught to do it that way
      210 or were you self taught?
      220 END

      300 END

      Group "L" (Linux Mint)
      with Windows 10 running in a remote session on my file server
      2 users thanked author for this post.
      • #2308854

        Reminds me of that old Futurama jokes 🙂

        10 SIN
        20 GOTO HELL

        and

        10 HOME
        20 SWEET
        30 GOTO 10

        Dell Latitude 3420, Intel Core i7 @ 2.8 GHz, 16GB RAM, W10 22H2 Enterprise

        HAL3000, AMD Athlon 200GE @ 3,4 GHz, 8GB RAM, Fedora 29

        PRUSA i3 MK3S+

        1 user thanked author for this post.
    • #2308895

      COMMENT (in FORTRAN):  Do not pass go; do not collect $200.

    Viewing 8 reply threads
    Reply To: The Laws of Programming

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: