Slashdot Mirror


When a CGI Script is the Most Elegant Solution

An anonymous reader writes "Writing local Web applications can be quick, easy, and efficient for solving specific Intranet problems. Learn why a Web browser is sometimes a better interface than a GUI application and why experienced Web developers find themselves struggling to learn a GUI toolkit, and descover that a simple CGI script would serve their needs perfectly well, if not better."

6 of 256 comments (clear)

  1. When is a CGI script the most elegant solution? by Anonymous Coward · · Score: 5, Insightful

    When everything else is not.

  2. Easier than Networking! by MattPat · · Score: 5, Insightful

    Quick web scripts are way easier than developing an application if only for the fact that you don't need to figure out how to use networking in whatever language you'd be working in. Plus, you don't need to "distribute" the application once it's done, and you don't need to provide updates to every user on your network who's using it: update your script, update the application.

    Plus, developers think in program logic, not in program design. A web script let's the developer write their output in HTML, then go back in later and add some CSS for presentation once they've got the program actually working. I say, it's a good way to do things.

    Not to mention that a lot of web scripting languages are easier to use than full-blown application languages, and there are many packages that let you attach native GUIs to web scripts. There isn't a compelling argument not to go that route if your application a) uses networking, and b) is distributed over an intranet.

    1. Re:Easier than Networking! by MattPat · · Score: 5, Insightful

      You start out saying, oh, we will only support browser X...but it never sticks...and your regression testing grows geometrically with each browser and version of browser you support.

      Honestly, as a web developer, I've never quite understood this. Whenever I design a website, it'll often look different in multiple browsers (read: it'll be effed up in Internet Explorer), but unless I use a particularly fancy bit of JavaScript, they almost always functionally work the same in multiple browsers. I just don't get it... are the people who are writing the web apps really that bad with their concept of standards? Are they relying on browser bugs to do a job? Or are they just getting way too cutesy with their JavaScript? Should someone give them a dictionary open to the word "testing"? It just seems to me to be silly not to spend five extra minutes per browser to open your app up in IE, Firefox, Safari (if Macs will be using the app), and Opera (which is pretty guaranteed to work if Firefox and/or Safari does).

      Other than that, though, I agree with what you're saying, in many cases it looks like a full-blown app would be the best solution. I was thinking along the lines of quick fixes that were easily expandable, though, which in my mind is best for web app.

      But hey, in computers there's no wrong way to do anything, right? You just need to gauge which method will make your users swear the least. ;)

  3. I don't understand! Help me? by Anonymous Coward · · Score: 5, Insightful

    I don't understand either the problem space, or the solution. I've read the article twice -- though it is apparent by most of the comments that people have not read the article.

    It sounds like the author is recommending a single instance web server application running on a local machine that uses a file store instead of a database and CGI as the programming interface. (In other words, this is NOT an intranet application for multiple users!) Doesn't sound that simple at all. In order to do this, you must:

    - Know at least one programming language for CGI.
    - Know HTML including forms, postback and session.
    - Understand the limitations of web browser UI elements. (There are many.)
    - Install and maintain a webserver on your local machine.
    - Build a robust file store interface. (Even loading / saving / parsing XML files with backups takes time...)
    - Install and maintain permissions for the file store.
    - And more...

    Sounds like all of the disadvantages of the web with none of the advantages.

    Why would you not use PERL and CSV IN/OUT files for simple (or complex) command line processing -- and if you needed a really simple UI, then Excel with Visual Basic. (This isn't easy, but it's a lot less technology to learn and maintain.) Anything more complex: Java, the free version of Microsoft VS or xcode. Anything worth doing is worth doing well.

  4. Re:You web developers... by skrolle2 · · Score: 5, Funny

    You're just jealous because our stuff actually is used by a lot of people, whereas your toaster-controller, written in C, with a user-interface noone understands only got five downloads from Tucows. And one of them was your cat jumping up on your keyboard.

  5. Re:Here's what happens a month later... by Anonymous Coward · · Score: 5, Funny

    ...and then you would be right to say,

    if (you == inHouseProgrammer)

    "Well you cocksuckers should have told me all this shit up front so I didn't waste my weekend writing a useless web app. If you want it fixed, do it yourself"

    else if (you == consultant && you == chargingTimeAndMaterials)

    "I'll be happy to add those new requirements for you, but I'm afraid that's going to impact the schedule."

    else if (you == consultant && you == chargingFixedFee)

    "Thanks for the feedback, bit I'm afraid we will have to address those new requirements in a follow-on contract."