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. I'm seriously tempted...

I'm seriously tempted...

Scheduled Pinned Locked Moved The Lounge
databasecsharpasp-netquestionannouncement
34 Posts 17 Posters 5 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.
  • J Jay Gatsby

    *Pat on the shoulder* Hang in there old sport...

    -Gatsby

    L Offline
    L Offline
    Lost User
    wrote on last edited by
    #23

    Man...where have you been Gatsby? Haven't seen you around here since your last article on missile tracking and moving targets.

    1 Reply Last reply
    0
    • M M RI0

      Ray Cassick wrote:

      Personally I am getting sick of the mantra 'all software has bugs'. When was the last time an aircraft guidance system needed to be rebooted mid flight?

      Very strong comment. I will remember that one! And ofcourse, It's just commercial talk. Maybe it's a hard criterium, but it is possible to deliver software without any bug. throw new NotImplementedException("No signature.");

      G Offline
      G Offline
      Gary Wheeler
      wrote on last edited by
      #24

      M@RI0 wrote:

      it is possible to deliver software without any bug

      No, it's not, except for trivial cases. The phrase "without bugs" implies a lot of things. For lack of a better definition, it means software that can be formally proven correct. Any application of meaningful size can't be proven correct. Similarly, even trivial applications that run under existing operating systems can't be proven correct, since you have to prove the environment correct as well. If you define "without bugs" as "software that isn't immediately lethal to the end user, or even better, doesn't get us sued in court", then sure. There's plenty of bug-free software out there.


      Software Zen: delete this;

      G 1 Reply Last reply
      0
      • R Rob Graham

        Christian Graus wrote:

        were shutting off the plane to reboot the computer

        One heck of a power switch on that computer. To restart, turn off airplane...:wtf:

        G Offline
        G Offline
        ghle
        wrote on last edited by
        #25

        Rob Graham wrote:

        One heck of a power switch on that computer. To restart, turn off airplane...

        Either we were on the same United flight, or it happens more than occasionally. Seriously, all power to the plane was shut off. Totally quiet, no lights, no air, no engines. IIRC it was the guidance computers. After a couple of minutes, fire up the engines and we're good to go. I remember saying, a little too loudly "Must be running Windows.":omg: I thought it was funny. Half the passengers in front of me turned around. It was obvious from the stares of disbelief that no one else found it humorous. :-O

        Gary

        1 Reply Last reply
        0
        • _ _Damian S_

          John Cardinal wrote:

          I never guessed anyone would try to do that

          You can sum it up like this: All software would work perfectly if it wasn't for those pesky users!!

          ------------------------------------------- Don't walk in front of me, I may not follow; Don't walk behind me, I may not lead; Just bugger off and leave me alone!!

          G Offline
          G Offline
          ghle
          wrote on last edited by
          #26

          _Damian S_ wrote:

          if it wasn't for those pesky users!

          Hence, long live COBOL and command-line interfaces!!! :-D Contrary to popular beliefs, it IS possible to write bug-free software. It is difficult, but not impossible. With increased (or reduced) complexity comes bugs. bool WasteTimeAndSuckCycles() {    bool bWillNeverHappen = TRUE;    int i = 0;    while (bWillNeverHappen)    {      // Warm up the CPU      // Wait for CPU Power-off      i++;    }    return (bWillNeverHappen); }

          Gary

          B 1 Reply Last reply
          0
          • G Gary Wheeler

            M@RI0 wrote:

            it is possible to deliver software without any bug

            No, it's not, except for trivial cases. The phrase "without bugs" implies a lot of things. For lack of a better definition, it means software that can be formally proven correct. Any application of meaningful size can't be proven correct. Similarly, even trivial applications that run under existing operating systems can't be proven correct, since you have to prove the environment correct as well. If you define "without bugs" as "software that isn't immediately lethal to the end user, or even better, doesn't get us sued in court", then sure. There's plenty of bug-free software out there.


            Software Zen: delete this;

            G Offline
            G Offline
            ghle
            wrote on last edited by
            #27

            Gary Wheeler wrote:

            M@RI0 wrote: it is possible to deliver software without any bug No, it's not, except for trivial cases.

            Sorry, Wheeler, you've been listening to Billy G. too much. It is possible to write bug-free software. The software must do everything it is supposed to do, and nothing it is not supposed to do (the more difficult proof), including allowing for unanticipated situations. As a developer, it is not my responsibility to validate the O.S. or the complier/linker/assembler, however, the application must operate correctly under the O.S. that I qualify it for. Example, if an O.S. (bug) stops sending the application mouse clicks, that is not a problem with the application (that would appear to hang). If the compiler is wrong, again it is not a problem with the application. (Writing in machine code can alleviate compiler problems.) The difficulty is that formally proving software is correct is typically more time-consuming than the application/system development time. We attempt to reduce bugs by applying whatever testing we can, however, there comes diminishing returns. How much testing is done also, in the business world, depends on the "lethalness" of the software. If an application/system can kill/maim people or destroy equipment unintentionally, testing is generally more thorough than if the downside is our spell-checker misses some spellings. Also, having the software do self-checking takes CPU cycles and can make a system less responsive. Multi-processor CPUs can allow software to be more reliable at run-time with no degradation in performance. One thread tests the gozeins and gozeouts while another thread runs the logic. The logic thread returns expected results only if the checking thread finds no problems. Has ANYONE ever found a bug that after-the-fact given the resources was impossible under any means to find? No! We have an aha moment. Once found, we can add additional testing to find that bug in the future (or not). The problem is that we need to *think* about these situations at development time and incorporate them into the application.

            Gary

            1 Reply Last reply
            0
            • G ghle

              _Damian S_ wrote:

              if it wasn't for those pesky users!

              Hence, long live COBOL and command-line interfaces!!! :-D Contrary to popular beliefs, it IS possible to write bug-free software. It is difficult, but not impossible. With increased (or reduced) complexity comes bugs. bool WasteTimeAndSuckCycles() {    bool bWillNeverHappen = TRUE;    int i = 0;    while (bWillNeverHappen)    {      // Warm up the CPU      // Wait for CPU Power-off      i++;    }    return (bWillNeverHappen); }

              Gary

              B Offline
              B Offline
              Big Daddy Farang
              wrote on last edited by
              #28

              ghle wrote:

              Hence, long live COBOL and command-line interfaces!!!

              I agree 50 per cent. Command-line interfaces rock. COBOL not so much. ;) Actually we could replace COBOL with a myriad of other languages and have that same "discussion." For example, "VB" or "C" or ".NET" or "Java." So let's leave at, "To each his own." By the way, you have a compiler warning. It should be: bool bWillNeverHappen = true; Best regards, BDF

              G 1 Reply Last reply
              0
              • B Big Daddy Farang

                ghle wrote:

                Hence, long live COBOL and command-line interfaces!!!

                I agree 50 per cent. Command-line interfaces rock. COBOL not so much. ;) Actually we could replace COBOL with a myriad of other languages and have that same "discussion." For example, "VB" or "C" or ".NET" or "Java." So let's leave at, "To each his own." By the way, you have a compiler warning. It should be: bool bWillNeverHappen = true; Best regards, BDF

                G Offline
                G Offline
                ghle
                wrote on last edited by
                #29

                To each his own - agreed. Another thread discussed the desire to kill COBOL, just another reason why we can't.

                Big Daddy Farang wrote:

                By the way, you have a compiler warning. It should be: bool bWillNeverHappen = true;

                Note: I do NOT have a compiler warning, you do. It compiled and executed just fine.:wtf: From afx.h // Standard constants #undef FALSE #undef TRUE #undef NULL #define FALSE 0 #define TRUE 1 #define NULL 0

                Gary

                B 1 Reply Last reply
                0
                • G ghle

                  To each his own - agreed. Another thread discussed the desire to kill COBOL, just another reason why we can't.

                  Big Daddy Farang wrote:

                  By the way, you have a compiler warning. It should be: bool bWillNeverHappen = true;

                  Note: I do NOT have a compiler warning, you do. It compiled and executed just fine.:wtf: From afx.h // Standard constants #undef FALSE #undef TRUE #undef NULL #define FALSE 0 #define TRUE 1 #define NULL 0

                  Gary

                  B Offline
                  B Offline
                  Big Daddy Farang
                  wrote on last edited by
                  #30

                  Hi Gary, I sit corrected. It is indeed I who has the compiler warning. I know that with VC++ 6 that would compile without warning. Your original code would be bool bWillNeverHappen = 1; after preprocessing. C++ allows assigning an int to a bool and doesn't complain. However, either of these would be more correct: BOOL bWillNeverHappen = TRUE; // BOOL is #typedef int bool bWillNeverHappen = true; Why have nits if you can't pick them? :laugh: BDF

                  D G 2 Replies Last reply
                  0
                  • B Big Daddy Farang

                    Hi Gary, I sit corrected. It is indeed I who has the compiler warning. I know that with VC++ 6 that would compile without warning. Your original code would be bool bWillNeverHappen = 1; after preprocessing. C++ allows assigning an int to a bool and doesn't complain. However, either of these would be more correct: BOOL bWillNeverHappen = TRUE; // BOOL is #typedef int bool bWillNeverHappen = true; Why have nits if you can't pick them? :laugh: BDF

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

                    Big Daddy Farang wrote:

                    Why have nits if you can't pick them?

                    because lice are icky. :rolleyes:

                    -- You have to explain to them [VB coders] what you mean by "typed". their first response is likely to be something like, "Of course my code is typed. Do you think i magically project it onto the screen with the power of my mind?" --- John Simmons / outlaw programmer

                    1 Reply Last reply
                    0
                    • B Big Daddy Farang

                      Hi Gary, I sit corrected. It is indeed I who has the compiler warning. I know that with VC++ 6 that would compile without warning. Your original code would be bool bWillNeverHappen = 1; after preprocessing. C++ allows assigning an int to a bool and doesn't complain. However, either of these would be more correct: BOOL bWillNeverHappen = TRUE; // BOOL is #typedef int bool bWillNeverHappen = true; Why have nits if you can't pick them? :laugh: BDF

                      G Offline
                      G Offline
                      ghle
                      wrote on last edited by
                      #32

                      Big Daddy Farang wrote:

                      Why have nits if you can't pick them?

                      Ah, and eat them! Some food for thought... X| But seriously, true is defined as NOT ZERO and false is defined as ZERO, no? so bool nits = TRUE; and bool nits = 1; are correct and valid anyhow? It's been a while since I've used the CPM Borland C compiler... But this brings up a burning question regarding my EVC++ environment. MS generated code uses BOOL instead of bool. This takes a larger data storage area (32 bits to store a 1 or zero) which is not efficient. Is the trade off on storage space made up for in execution speed and or data alignment. I.e., is it faster to load registers with 32 bits rather than 8 bits (1 bit?). I know it is faster to load on an even boundary, but what if you are only loading one byte, not 4? Is there a penalty for padding the field with zeros or in loading 4 bytes instead of one? Anyone?:confused:

                      Gary

                      B 1 Reply Last reply
                      0
                      • G ghle

                        Big Daddy Farang wrote:

                        Why have nits if you can't pick them?

                        Ah, and eat them! Some food for thought... X| But seriously, true is defined as NOT ZERO and false is defined as ZERO, no? so bool nits = TRUE; and bool nits = 1; are correct and valid anyhow? It's been a while since I've used the CPM Borland C compiler... But this brings up a burning question regarding my EVC++ environment. MS generated code uses BOOL instead of bool. This takes a larger data storage area (32 bits to store a 1 or zero) which is not efficient. Is the trade off on storage space made up for in execution speed and or data alignment. I.e., is it faster to load registers with 32 bits rather than 8 bits (1 bit?). I know it is faster to load on an even boundary, but what if you are only loading one byte, not 4? Is there a penalty for padding the field with zeros or in loading 4 bytes instead of one? Anyone?:confused:

                        Gary

                        B Offline
                        B Offline
                        Big Daddy Farang
                        wrote on last edited by
                        #33

                        ghle wrote:

                        true is defined as NOT ZERO and false is defined as ZERO, no?

                        Sort of, I guess you can think of them in those terms surely. From MSDN's C++ Language Reference: bool This keyword is a built-in type. A variable of this type can have values true and false. Conditional expressions have the type bool and so have values of type bool. For example, i!=0 now has true or false depending on the value of i. true This keyword is one of the two values for a variable of type bool or a conditional expression (a conditional expression is now a true boolean expression). false The keyword is one of the two values for a variable of type bool or a conditional expression (a conditional expression is now a true Boolean expression). So they don't come right out and say that but.... The C# Language Reference explains further: In C++, a value of type bool can be converted to a value of type int; in other words, false is equivalent to zero and true is equivalent to nonzero values. In C#, there is no conversion between the bool type and other types. For example, the following if statement is invalid in C#, while it is legal in C++:

                        int x = 123;
                        if (x) // Invalid in C#
                        {
                        printf("The value of x is nonzero.");
                        }

                        ghle wrote:

                        MS generated code uses BOOL instead of bool.

                        I think this partly due to backwards compatibility with C language which does not have bool but uses BOOL. As for the questions in your last paragraph, I don't have to answer that. #define (don't have to) (can't)

                        ghle wrote:

                        Anyone?

                        Bueller? BDF

                        G 1 Reply Last reply
                        0
                        • B Big Daddy Farang

                          ghle wrote:

                          true is defined as NOT ZERO and false is defined as ZERO, no?

                          Sort of, I guess you can think of them in those terms surely. From MSDN's C++ Language Reference: bool This keyword is a built-in type. A variable of this type can have values true and false. Conditional expressions have the type bool and so have values of type bool. For example, i!=0 now has true or false depending on the value of i. true This keyword is one of the two values for a variable of type bool or a conditional expression (a conditional expression is now a true boolean expression). false The keyword is one of the two values for a variable of type bool or a conditional expression (a conditional expression is now a true Boolean expression). So they don't come right out and say that but.... The C# Language Reference explains further: In C++, a value of type bool can be converted to a value of type int; in other words, false is equivalent to zero and true is equivalent to nonzero values. In C#, there is no conversion between the bool type and other types. For example, the following if statement is invalid in C#, while it is legal in C++:

                          int x = 123;
                          if (x) // Invalid in C#
                          {
                          printf("The value of x is nonzero.");
                          }

                          ghle wrote:

                          MS generated code uses BOOL instead of bool.

                          I think this partly due to backwards compatibility with C language which does not have bool but uses BOOL. As for the questions in your last paragraph, I don't have to answer that. #define (don't have to) (can't)

                          ghle wrote:

                          Anyone?

                          Bueller? BDF

                          G Offline
                          G Offline
                          ghle
                          wrote on last edited by
                          #34

                          Big Daddy Farang wrote:

                          C language which does not have bool but uses BOOL

                          Backwards nit, I think. Oh oh, found this... No Boolean type[^] "NOTE: There is NO Boolean type in C -- you should use char, int or (better) unsigned char."

                          Gary

                          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