Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Re: Using "my" suppresses "Name used only once" warning?

by Wysardry (Pilgrim)
on Feb 03, 2003 at 02:14 UTC ( #232111=note: print w/replies, xml ) Need Help??


in reply to Re: Using "my" suppresses "Name used only once" warning?
in thread Using "my" suppresses "Name used only once" warning?

My main use for Perl is Web based applications, so the only other alternative is PHP and I don't consider that to be anywhere near as stable besides anything else.

This check wouldn't have to be done at run-time - a separate "lint" program would do. I'd really only want to use the "ultra pedantic" check after completing a large section of code, not every time it was executed.

  • Comment on Re: Re: Using "my" suppresses "Name used only once" warning?

Replies are listed 'Best First'.
Re: Using "my" suppresses "Name used only once" warning?
by Abigail-II (Bishop) on Feb 03, 2003 at 08:18 UTC
    Excuse me? Where does it say that you can only use Perl or PHP to do Web based applications? Java, C, C++ and many other languages can be used as well, without any problems.

    And yes, the check does have to be done at run time, because only at run time one can know what's in a variable. Unless you've solved the halting problem, but then you wouldn't be writing web applications.

    Abigail

      Excuse me? Where does it say that you can only use Perl or PHP to do Web based applications? Java, C, C++ and many other languages can be used as well, without any problems.

      In the list of available features at my host for starters. ;o)

      I've tried using C in the past, and I found it too unforgiving of errors during the learning process - it's too easy to cause the machine to reset. It's bad enough doing that on my own machine, but I'd rapidly become unpopular if I did it on someone else's server.

      Having to recompile after every change didn't help the learning process much either.

      The closest I've been to Java is JavaScript, so I'd have to start learning the language from scratch.

      ASP and ColdFusion are too platform specific, and I have no experience with them whatsoever.

      I've already had experience in adapting existing Perl and PHP programs, I have both languages installed on my own machine, and the hosts I use support both.

      Perl is also a lot more suited to text processing than any of the alternatives mentioned, and HTML is basically just text.

        I'm a bit confused. You find C too unforgiving of errors, yet you want to make Perl less forgiving and more like C. (I don't have a clue what you mean by 'causing the machine to reset').

        As for thinking that JavaScript is close to Java, you're wrong. JavaScript has nothing to do with Java, except the name. Netscape developed LiveScript around the time SUN launched Java. As a marketing ploy, just before releasing it to the masses, Netscape renamed LiveScript to JavaScript.

        Abigail

Re: Re: Re: Using "my" suppresses "Name used only once" warning?
by Biker (Priest) on Feb 03, 2003 at 13:17 UTC

    Technically, you cannot check the run-time usage of your variables concerning strings/numbers in compile time (or before, using 'lint' or somesuch) with a garrantee of success, because you don't have any idea of what data your program will read in from external sources. (Keyboard, files, databases, etc.)

    So even if your code compiles without any 'numeric/string warnings' it may still fail in runtime when handling unforeseen data.

    I guess the reasoning goes something like: "Since we cannot garrantee a successful verification in compile time but the programmer must anyway do it in run-time when it's important, then le'ts be consistent and let the programmer do the verification whenever s/he thinks it is necessary."

    Personally, I tend to agree.


    Everything went worng, just as foreseen.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://232111]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (6)
As of 2021-03-08 09:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favorite kind of desktop background is:











    Results (123 votes). Check out past polls.

    Notices?