Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options

Re: Hungarian notation, kind of

by tobyink (Abbot)
on Jan 21, 2013 at 16:15 UTC ( #1014484=note: print w/replies, xml ) Need Help??

in reply to Hungarian notation, kind of

The one place I find this sort of thing useful is where you're dealing with a bunch of different pieces of data, some of which are in a "processed" state, and other in an "unprocessed" state.

For example, you have a $title, $author and $body for an article; the $body is stored in your database as a blob of HTML, so doesn't need entity encoding when you pump it into an HTML template, but the other two are stored as text in the database, so need entity encoding when inserted into the template.

So I'd call them something like $title_txt, $author_txt and $body_html.

Other examples might be where some of your bits of data are UTF-8 encoded byte strings, and others are Unicode character strings; or some bits of data are tainted and others are not; etc.

package Cow { use Moo; has name => (is => 'lazy', default => sub { 'Mooington' }) } say Cow->new->name

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1014484]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (6)
As of 2017-10-22 03:06 GMT
Find Nodes?
    Voting Booth?
    My fridge is mostly full of:

    Results (272 votes). Check out past polls.