What's the opposite of "forget"?

  • Thread starter Kai Grossjohann
  • Start date
K

Kai Grossjohann

On unload of a page, I store the current scrollbar position (ie,
window.pageXOffset and window.pageYOffset) into a cookie. On load of
that same page, I fetch the information from that cookie and scroll
the window accordingly.

I used the name "remember_scrolling" for the function doing the store,
and "recall_scrolling" for the function doing the fetch. (There is
also a function which deletes the cookie. It is named
"forget_scrolling".)

But I'm afraid that this might be wrong English, for "remember"
appears to cover both storing and fetching. (I guess that "recall"
and "forget" are suitably specific.)

The obvious "{store,fetch,delete}_scrolling" and
"{set,get,unset}_scrolling" are so, well, *obvious* and *boring*!

Any ideas?

Kai

PS: www.dict.org tells me that WordNet suggests
keep_in_mind_for_consideration_or_attention_scrolling which is nice,
but somehow...

PPS: Maybe remember_the_scrolling, also from WordNet, could work.
 
F

Fabian

Kai Grossjohann hu kiteb:
On unload of a page, I store the current scrollbar position (ie,
window.pageXOffset and window.pageYOffset) into a cookie. On load of
that same page, I fetch the information from that cookie and scroll
the window accordingly.

I used the name "remember_scrolling" for the function doing the store,
and "recall_scrolling" for the function doing the fetch. (There is
also a function which deletes the cookie. It is named
"forget_scrolling".)

But I'm afraid that this might be wrong English, for "remember"
appears to cover both storing and fetching. (I guess that "recall"
and "forget" are suitably specific.)

The obvious "{store,fetch,delete}_scrolling" and
"{set,get,unset}_scrolling" are so, well, *obvious* and *boring*!

Any ideas?

Does it really matter? Javascript doesn't care what you name the
functions (within certain restrictions), so as long as *you* know what
the functions do, everything should be ok. Call them wasurete() and
oboete() if you like.

I wonder... does a function name have to be ascii, or can you use
chinese characters?
 
T

Thomas 'PointedEars' Lahn

Fabian said:
I wonder... does a function name have to be ascii, or can you use
chinese characters?
From JavaScript 1.5 on, JavaScript identifiers may contain Unicode
characters and escape sequerences, including Chinese glyphs (AIUI
Chinese has no characters):

http://devedge.netscape.com/library/manuals/2000/javascript/1.5/guide/ident.html#1008330
http://devedge.netscape.com/library/manuals/2000/javascript/1.5/guide/ident.html#1009568
http://www.unicode.org/


PointedEars
 
K

Kai Grossjohann

Fabian said:
Does it really matter?

Oh, yes!
Javascript doesn't care what you name the
functions (within certain restrictions), so as long as *you* know what
the functions do, everything should be ok. Call them wasurete() and
oboete() if you like.

I don't (primarily) write programs for the computer to read. I write
them for humans to read.

Why?

Because it's easy to make the computer understand, but it's not so
easy for a human to understand. But to the poor soul who has to fix
bugs in my code, it's vital to be able to understand what I did.

So that's why I believe that choosing the right names is important.
I wonder... does a function name have to be ascii, or can you use
chinese characters?

That would be quite useful -- Chinese is a quite succinct language,
and having short identifiers in your code is a good thing.

However, I don't want to require potential bug fixers to learn Chinese
in addition to JavaScript ;-)

Kai
 
F

Fabian

Kai Grossjohann hu kiteb:
Oh, yes!


I don't (primarily) write programs for the computer to read. I write
them for humans to read.

Why?

Because it's easy to make the computer understand, but it's not so
easy for a human to understand. But to the poor soul who has to fix
bugs in my code, it's vital to be able to understand what I did.

Have you considered naming them according to the conventions of the
human language you are most familiar with? There's less chance of making
a mistake with language nuances that way. And no right-thinking person
can reasonably object to things being named in the language of the
author.

Personally, I think well-written comments are far more important than
the names of functions and variables.
 
K

Kai Grossjohann

Fabian said:
Have you considered naming them according to the conventions of the
human language you are most familiar with?

Heh. Nah :) I hate German identifiers. Too long.

But some kind soul has suggested "memorize" which fits the bill quite
well.

Kai
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top