Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Test Your Code and Post the Output  (Read 4328 times)

0 Members and 1 Guest are viewing this topic.

billrich

    Topic Starter


    Rookie

    Thanked: 1
    Test Your Code and Post the Output
    « on: December 16, 2009, 09:16:42 AM »
    Test Your Code and Post the Output from your code. Prove the code works

    The person asking the question and the person providing an answer should  not be the same person. "No Ringers"


    Salmon Trout

    • Guest
    Re: Test Your Code and Post the Output
    « Reply #1 on: December 16, 2009, 09:52:15 AM »
    Some code has no output, and there is the philiosophical point that you can never prove that code "works", only that it appears to. A *censored* fool thread started by billrich IMHO. Move along folks, nothing to see here.


    billrich

      Topic Starter


      Rookie

      Thanked: 1
      Re: Test Your Code and Post the Output
      « Reply #2 on: December 16, 2009, 10:06:05 AM »
      A  fool thread started by billrich IMHO. Move along folks, nothing to see here.

      Dias de Verano, the twinkie from England has spoken.  Ignore Dias de Verano. 

      Examine the ideas presented.


      Salmon Trout

      • Guest
      Re: Test Your Code and Post the Output
      « Reply #3 on: December 16, 2009, 10:09:48 AM »
      What is the point of this thread?

      BC_Programmer


        Mastermind
      • Typing is no substitute for thinking.
      • Thanked: 1140
        • Yes
        • Yes
        • BC-Programming.com
      • Certifications: List
      • Computer: Specs
      • Experience: Beginner
      • OS: Windows 11
      Re: Test Your Code and Post the Output
      « Reply #4 on: December 16, 2009, 11:58:22 AM »
      The person asking the question and the person providing an answer should  not be the same person. "No Ringers"

      Yes. It should. and perhaps you should heed that advice yourself, as well.


      showing code output doesn't prove a *censored* thing, by the way.


      for example:

      Code: [Select]
      echo enter value.
      set /p value=
      set /a doubled=value*2

      seems pretty clearcut. how do you "test" this to prove it works? loop through every number? No. You really cannot, but if you understand what is being done and how the values are stored, you should be able to predict that a number like 1073741824 will not computer properly.

      Lo and behold, it doesn't:

      Code: [Select]
      C:\>set doubled=1073741824

      C:\>set /a doubled=doubled*2
      -2147483648

      It's also not possible; and if it is, not at all easy- to make this work.


      from http://www.joelonsoftware.com/items/2007/12/03.html
      Quote
      The problem, here, is very fundamental. In order to mechanically prove that a program corresponds to some spec, the spec itself needs to be extremely detailed. In fact the spec has to define everything about the program, otherwise, nothing can be proven automatically and mechanically. Now, if the spec does define everything about how the program is going to behave, then, lo and behold, it contains all the information necessary to generate the program! And now certain geeks go off to a very dark place where they start thinking about automatically compiling specs into programs, and they start to think that they’ve just invented a way to program computers without programming.

      Also, to make things ever more curious, BillRich, you don't even follow your own advice... certainly, you post your output, but many times it hardly scratches the surface of the OP's problem. for example, in the thread here:

      http://www.computerhope.com/forum/index.php/topic,96718.0/topicseen.html

      the specification is clear:

      Quote
      Please can anyone tell me the batch script which can search all drives and folders and subfolders in a computer for .jpg and .jpeg, once found they must get copied.

      And yet, the posted code and output hardly scratch the surface:

      Code: [Select]
      @echo off
      cd \
      dir /s *.jpg

      Oh! but wait! none of that matters, because you posted the output. of course it was the WRONG output since it was supposed to search all drives for jpg and jpeg, and they were never copied. therefore you hardly met any of the requirements except to search a single drive for 1 of 2 file extensions and then not perform the action intended on any of them anyway.

      Output is meaningless when you can't read the *censored* specification. And output is meaningless for a batch as small as the above, where anybody even slightly familar with the command prompt can guess what will happen based on the- well, I don't know, the basic semantics and switches being used by well known commands? I mean, really, you don't need to post output for code that can be stepped through in ones head:

      @echo off

      shut off echoing to screen.

      cd \

      change to root directory

      dir /s *.jpg

      recursive dir on all subfolders for *.jpg

      But of course, knowing what the commands do is meaningless, we must instead "post output" because it's a lot better to confuse the poster with terse, meaningless output from our command windows then actually discussing the problem or trying to guide them. And under no circumstances can the output from the prompt be called "guiding" because nobody has a *censored* clue what your getting at. Instead of saying "try using the dir command" Oh! wait, no, that's to short. let's instead post a 5 page output from MY dir command! I'll just erase the goats folder and nobody will be the wiser.



      I was trying to dereference Null Pointers before it was cool.

      Salmon Trout

      • Guest
      Re: Test Your Code and Post the Output
      « Reply #5 on: December 16, 2009, 12:32:46 PM »
      Not the goats folder!  :-[

      billrich

        Topic Starter


        Rookie

        Thanked: 1
        Re: Test Your Code and Post the Output
        « Reply #6 on: December 16, 2009, 03:32:43 PM »

        Showing code output doesn't prove a  thing, by the way.


        How silly can you be?

        All Good programmers test their code, show their code and show an example of their output.

        Why would anyone expect less from a programmer?

        Posting untested code is irresponsible, misleading  and lazy.




        Salmon Trout

        • Guest
        Re: Test Your Code and Post the Output
        « Reply #7 on: December 16, 2009, 03:36:12 PM »
        billrich, you are an obstinate, ignorant, stupid fool. It is way past time that you were compelled to shut up.

        BC_Programmer


          Mastermind
        • Typing is no substitute for thinking.
        • Thanked: 1140
          • Yes
          • Yes
          • BC-Programming.com
        • Certifications: List
        • Computer: Specs
        • Experience: Beginner
        • OS: Windows 11
        Re: Test Your Code and Post the Output
        « Reply #8 on: December 16, 2009, 03:43:05 PM »
        It is way past time that you were compelled to shut up.


        Again, I might add.

        I was trying to dereference Null Pointers before it was cool.

        billrich

          Topic Starter


          Rookie

          Thanked: 1
          Re: Test Your Code and Post the Output
          « Reply #9 on: December 16, 2009, 03:57:48 PM »
          Billrich, you are an obstinate, ignorant, stupid fool. It is way past time that you were compelled to shut up.

          Dias de Verano ( Salmon Trout ) it is the vicious, prissy name calling by Salmon Trout that must end.

          p.s. :  I have an IQ of 138, a BS Degree in Mathematics and I'm retired from AT&T as a computer programmer.

          Salmon Trout has the audacity to call me vicious, degrading names?


          « Last Edit: December 16, 2009, 04:15:15 PM by billrich »

          BC_Programmer


            Mastermind
          • Typing is no substitute for thinking.
          • Thanked: 1140
            • Yes
            • Yes
            • BC-Programming.com
          • Certifications: List
          • Computer: Specs
          • Experience: Beginner
          • OS: Windows 11
          Re: Test Your Code and Post the Output
          « Reply #10 on: December 16, 2009, 04:16:18 PM »
          p.s nobody cares what you think your IQ is, your 18 years in community college or the many years you spent switching relays at AT&T.
          I was trying to dereference Null Pointers before it was cool.

          billrich

            Topic Starter


            Rookie

            Thanked: 1
            Re: Test Your Code and Post the Output
            « Reply #11 on: December 16, 2009, 04:32:17 PM »
            p.s nobody cares what you think your IQ is, your 18 years in community college or the many years you spent switching relays at AT&T.

            When I show how wrong Salmon Trout is, then BC begins to weasel away or double talk.

            patio

            • Moderator


            • Genius
            • Maud' Dib
            • Thanked: 1769
              • Yes
            • Experience: Beginner
            • OS: Windows 7
            Re: Test Your Code and Post the Output
            « Reply #12 on: December 16, 2009, 06:02:43 PM »
            Topic Closed.
            " Anyone who goes to a psychiatrist should have his head examined. "