Thread: Graceful Crash on Bad Pointer

  1. #31
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    There's no excuse for a frozen program. Keeping the GUI responsive while doing heavy work is VERY EASY.
    Implementing a way to cancel or exit is also very easy. Canceling in a timely manner can be difficult depending on what you do, if there's something blocking, etc.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  2. #32
    Hurry Slowly vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,788
    It is first time I hear that any windows application needs GUI
    All problems in computer science can be solved by another level of indirection,
    except for the problem of too many layers of indirection.
    – David J. Wheeler

  3. #33
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Every program should have a GUI.
    CLI and/or missing Settings functionality is for the lazy.
    Disclaimer: This is all in my opinion.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  4. #34
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    Quote Originally Posted by Elysia
    Every program should have a GUI.
    Definitely. Every program should have a good user interface. Some command line interfaces are good.

    Quote Originally Posted by Elysia
    CLI and/or missing Settings functionality is for the lazy.
    Definitely. Crooked user interfaces are designed by crooks. Some graphical user interfaces are crooked.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  5. #35
    Officially An Architect brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,396
    Quote Originally Posted by Elysia View Post
    CLI [...] is for the lazy.
    Or for anybody who wants their program to be operable in a batch mode without user interaction... Or to make one program drive another... or a thousand other legitimate reasons.
    Code:
    //try
    //{
    	if (a) do { f( b); } while(1);
    	else   do { f(!b); } while(1);
    //}

  6. #36
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Oranges vs apples. It can be done in GUI too.
    It might just be a little more complicated.
    To call it from another program, a DLL is more suitable IMHO.

    And, I think, my main point was... alright, CLI is good for such reasons, but what if you DON'T want to it the way you describe? For example, the H264 encoder x264. It only has a CLI version. What if I want to process a video file with it? It's certainly cumbersome to use the CLI, rather than a GUI.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  7. #37
    Officially An Architect brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,396
    Quote Originally Posted by Elysia View Post
    Oranges vs apples. It can be done in GUI too.
    It might just be a little more complicated.
    To call it from another program, a DLL is more suitable IMHO.

    And, I think, my main point was... alright, CLI is good for such reasons, but what if you DON'T want to it the way you describe? For example, the H264 encoder x264. It only has a CLI version. What if I want to process a video file with it? It's certainly cumbersome to use the CLI, rather than a GUI.
    So write a GUI which drives the CLI. Decoupling is not usually viewed as a bad thing in software engineering.

    Suppose you've started a video conversion. It's carrying along merrily, then a silly GUI bug crashes the whole program. You just lost a bunch of work because of a bug in a button event handler.

    Had the GUI been driving an external process to do the conversion, the conversion would still be going even though the interface crashed.
    Code:
    //try
    //{
    	if (a) do { f( b); } while(1);
    	else   do { f(!b); } while(1);
    //}

  8. #38
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Quote Originally Posted by brewbuck View Post
    So write a GUI which drives the CLI. Decoupling is not usually viewed as a bad thing in software engineering.
    Not saying that's bad. Just saying it's lazy not to PROVIDE such a GUI.

    Suppose you've started a video conversion. It's carrying along merrily, then a silly GUI bug crashes the whole program. You just lost a bunch of work because of a bug in a button event handler.

    Had the GUI been driving an external process to do the conversion, the conversion would still be going even though the interface crashed.
    User interface bugs may be just as good or bad as CLI interface bugs (crashes when parsing input string?). I don't think that is a good and valid point, really, as it could happen to both CLI and GUI.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  9. #39
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    Quote Originally Posted by Elysia View Post
    Not saying that's bad. Just saying it's lazy not to PROVIDE such a GUI.
    Lazy? Why is it lazy if a programmer who specializes in video codecs spends his time on improving the codec instead of writing a GUI? I call it efficient. Let someone who knows GUIs write the GUI.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  10. #40
    Hurry Slowly vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,788
    why to write a gui for something that will never interact with the user directly?
    All problems in computer science can be solved by another level of indirection,
    except for the problem of too many layers of indirection.
    – David J. Wheeler

  11. #41
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    The thing is, command lines are unfriendly and difficult to many. Therefore, if there is a remote chance that a user might use that program directly, without external programs, it should contain a GUI of sorts.
    Then there's the whole argument about when it's necessary, if it's only going to be used as an external component, etc. And if the user is never going to use it directly (but who are you to judge what the user does, though?). But this opens a whole new can of worms, I'm not really interested in opening.
    I realize this is subjective and we have different views, so an argument here will only get into a flamewar.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  12. #42
    Registered User
    Join Date
    Dec 2006
    Location
    Canada
    Posts
    3,229
    command lines are unfriendly and difficult to many
    And if your program doesn't target that particular "many"?

    Sure, if you are writing a coffee cooking clock for your grandma, it's probably a good idea to write a GUI.

    Many/most programmers/advanced computer users are not afraid of CLIs, though, and if they are your target audience...

    For example, mplayer, one of the if not the most popular video player for Linux, has a CLI interface and a bunch of GUIs, and if I am only trying to play a video, I won't be bothered to open the GUI, since a simple "mplayer asdf.mpg" will do. Or for compression - is "bzip2 asdf.bmp" really more complex than right click -> add to archive -> "OK"?
    Last edited by cyberfish; 03-18-2009 at 10:46 AM.

  13. #43
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Quote Originally Posted by cyberfish View Post
    And if your program doesn't target that particular "many"?

    Many/most programmers/advanced computer users are not afraid of CLIs, though, and if they are your target audience...
    Who are you to judge who finds CLI comforting or not, advanced user or not?
    There are some advanced users out there, like me, who do not like CLI or find it confusing.

    ...since a simple "mplayer asdf.mpg" will do.
    And navigating there, of course. Oh yes, and it might be in the path directory.
    Not all of it is in Windows.

    ...Or for compression - is "bzip asdf.bmp" really more complex than right click -> add to archive -> "OK"?
    Yes, it is.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  14. #44
    Hurry Slowly vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,788
    I still do not understand. If we are talking about such simple user, why he will go into the windows system directory, enable showing hidden files (do the simple user know how to do it?) and click on the h264 decoder?

    What purpose will this action have? User should not even know what file contains the h264 decoder - It is automaatically loaded by the MediaPlayer when required, and <ediaPlayer provides all the GUI user ever needs...

    VS has a perfectly fine (ugly is you prefer) GUI, why linker or compiler or any other tool loaded using VS should have a GUI? Does because you fill adventeruos today and want to makes several double clicks on any file with exe extention?

    In this case message box "Go away" has no more meaning than automatically dissapeared black box
    All problems in computer science can be solved by another level of indirection,
    except for the problem of too many layers of indirection.
    – David J. Wheeler

  15. #45
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Quote Originally Posted by vart View Post
    I still do not understand. If we are talking about such simple user, why he will go into the windows system directory, enable showing hidden files (do the simple user know how to do it?) and click on the h264 decoder?

    What purpose will this action have? User should not even know what file contains the h264 decoder - It is automaatically loaded by the MediaPlayer when required, and <ediaPlayer provides all the GUI user ever needs...
    What? No, they shouldn't do that...
    The only problem might be if they want to use the decoder stand-alone to decode something. I'm not saying this is a good example of what a simple user might do, though...
    This is all becoming twisted from the original meaning...

    I'll take an example. In the Linux world, lots of applications are simply CLI and lacking GUI. Usually, it's because they're geared towards power users, so it's fine. Sure, it's fine.
    But I think it's just lazy and inexcusable, no matter towards who it's geared.
    Likewise, typically in many Linux apps, you are required to edit an ini-file yourself to change settings and stuff instead of providing an options dialog in the program. This, too, I think is lazy and inexcusable.

    This is not because it's unfriendly towards some simple user, but because I feel more comfortable with GUI than CLI.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Ban pointers or references on classes?
    By Elysia in forum C++ Programming
    Replies: 89
    Last Post: 10-30-2007, 03:20 AM
  2. sorting with pointer of pointers to array
    By dunpealslyr in forum C++ Programming
    Replies: 6
    Last Post: 10-01-2007, 11:26 PM
  3. Question About Pointer To Pointer
    By BlitzPackage in forum C++ Programming
    Replies: 2
    Last Post: 09-19-2005, 10:19 PM
  4. Compiler "Warnings"
    By Jeremy G in forum A Brief History of Cprogramming.com
    Replies: 24
    Last Post: 04-24-2005, 01:09 PM
  5. Contest Results - May 27, 2002
    By ygfperson in forum A Brief History of Cprogramming.com
    Replies: 18
    Last Post: 06-18-2002, 01:27 PM