Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • It's for users of primative languages without sigils on their variables. Poor sods. They never know what a variable is without hunting down the declaration.
    • Did you read the article? It talks about two types of Hungarian notation, "Apps" (what the author originally intended and the more useful type) and "Systems" (what others misinterpreted the original type as and more like what you are referring to, but having equally useless information like "integer", "long", "char"). Sigils don't tell you if it's an index to an array, a 3-D point object, or the width of a bitmap.
    • Knowing that a variable is a scalar hardly tells you what it is, other than a scaler. Is it a string? A hash reference? A quadruply nested array of hashes of arrays of hashes? I guess you'll have to hunt down the declaration anyway, even in Perl.
  • One reason why RHN-the-lesser raises the hackles of many a Perl hacker is because we already have RHN built into the language.

    At the heart of it all, Perl has only five types that matter: scalars, arrays, hashes, filehandles and coderefs. (Yes, I skipped two. If you know what they are, you know why I skipped them. ;-) Yes, there are tied variables, but what matters about them is not how their internals differ, but how they automagically hide those internals. And objects are another kettle of fish, but

    • The sigil is only half the battle. Joel's article has a great example of pulling in unsafe data from a Web form. Perl's taint mode aside, we can't always know when it's safe to use a variable. When I was coding CGI apps, I did something like this:

      my $_name = $cgi->param('name'); my ($name) = $_name =~ /($untainting_regex)/;

      In this case, the sigil tells me nothing about whether or not it's safe to use that variable. If everything untaints, I can shove that data in the database. If it doesn't, I h

      • Crud, I hit 'Submit' instead of 'Preview'. Damn. Someone needs to read The Design of Everyday Things [mit.edu]. (Including me, to be fair.)

      • In this case, the sigil tells me nothing about whether or not it's safe to use that variable.

        Right. Because Perl embeds RHN-the-lesser (the kind of stuff in Petzold's book and the Windows API). The entire point of RHN-as-intended is to use common prefixes and principles of composition to describe the meaning of a variable: taintedness, Primality, object behavior, worksafe content, etc.

        The one huge problem with "Reverse Hungarian Notation", as Joel says, is that virtually everyone thinks RHN is RH

  • Assuming that we understood that "pnt" represented a Point and "prm" represented a Prime, we might get the idea that adding them might be useless.

    I'd much rather use a language where I can sensibly declare points and primes as different types and get a nice compile time or runtime error if I try and add them.

    Getting humans to do things that compilers can do seems counterproductive now we have the chance to use vaguely decent languages ;-)

    • Getting humans to do things that compilers can do seems counterproductive now we have the chance to use vaguely decent languages ;-)

      +1

    • I'd much rather use a language where I can sensibly declare points and primes as different types and get a nice compile time or runtime error if I try and add them.

      I'd much rather use a language that handles these kinds of strict typing issues for me and provides sensible error messages when a type error is found. ;-)

      (Yes, I'm using Haskell these days. And whenever I haven't seen a type error in a couple of days, it takes a while to figure out what ghc is trying to tell me.)