IWETHEY v. 0.3.0 | TODO
1,095 registered users | 0 active users | 0 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New More fun with the One
OneLook, that is:

[link|http://www.onelook.com/?w=%3Acollection&ls=a|http://www.onelook.c...3Acollection&ls=a]

Their cool 'reverse dictionary' feature will return words that have your pattern in the definition.

Oh, so why is this in the Programming forum? 'Cause I always seem to spend more time naming things than actually designing them. The example above means it'll be easier now to avoid 'aCollection' as a name. :)
I was one of the original authors of VB, and *I* wouldn't use VB for a text
processing program. :-)
Michael Geary, on comp.lang.python
New Synchonicity
I'm data typing a general coordinate class - so I actually had to refresh my memory on the use of "union" - sometime the coordinates are named one thing, sometimes another - and I'm sitting here thinking - "I have the most fun doing this when I'm typing and naming things!"

(And Bob, shame on you for starting aVariable name with anIndefiniteArticle!)
-drl
New When it's aNonymous, I usually do. Otherwise, nope.
New I see
OK I can actually see the point of that.

But how is

aList

more descriptive than

List

All types are anonymous until you make an instance.
-drl
New Not the point.
It's not that it's more descriptive, it's just that VERY often, the label without the leading 'a' is a keyword. "List" is a good example. And if it's not a keyword, it often ends up being a method name or something. Prefixing with 'a' or 'an' or (most often) 'each' for loops is a quick visual identifier that I'm working with something trivial, at least in scope.

for project in projects:\n    job = project.job


just reads clearer IMO as:

for eachProject in availableProjects:\n    aJob = eachProject.job


But it's only convention. I'm not preaching this or anything.
I was one of the original authors of VB, and *I* wouldn't use VB for a text
processing program. :-)
Michael Geary, on comp.lang.python
New Here's a suggestion that will solve your problem
Instead of naming it
aList
how 'bout naming it something like
nameList
or
recipeIngredientList
...in other words, tell us what kind of List it is as part of your name.

I think doing something that like that on a regular basis should dissolve the writer's block youhave about naming things.

(Although, I will admit, it is decidely non-Unix. Which, of course, is why I like it so much....)
jb4
"There are two ways for you to have lower Prescription-drug costs. One is you could hire Rush Limbaugh's housekeeper ... or you can elect me President."
John Kerry
New Re: Here's a suggestion that will solve your problem
Right!

I mean, does this happen?

// Ok, time for some coordinates! Don't know why, but I feel saucy,
// and in the mood for coordinates!

SpaceCoords someCoordinates;

// ooh righteous! Now back to the problem...

No - you make things with a purpose, so name them according to the purpose.

Seriously, when I see code with prepended type identifiers and indefinite articles, I cringe.
-drl
New No, no, I'm swinging *back* from that
..on the pendulum backswing. Been there, do that constantly. It's just not always necessary. Sometimes you _should_ write "for eachJob in currentSet". Anything more descriptive would just get in the way.
I was one of the original authors of VB, and *I* wouldn't use VB for a text
processing program. :-)
Michael Geary, on comp.lang.python
New Sorry, No Sale
That would imply that you declared a variable called 'eachJob'. I'd love to see how you commented that...
\n    Job      eachJob;   // and I will describe this how?!?\n


Even in this example, the Job you are working with has a specific putpose and use in the program. This purpose and use has a name, and if you enumerate that, the variable magically names itself in such a way that event the most casual observers (ar a complete idion...like me) can figure out what it does.

YMMV
jb4
"There are two ways for you to have lower Prescription-drug costs. One is you could hire Rush Limbaugh's housekeeper ... or you can elect me President."
John Kerry
New That would imply that YOU don't use dynamic languages
In Perl:

for my $each_job (@job_list) {
  # Do something, like this...
  $each_job->start();
}

You will note that no declaration exists. And a comment about what you mean by a variable that is in scope for 2 lines which is clear in context is silly to the point of stupidity. (Why add the maintainance overhead if its purpose is that clear?)

Cheers,
Ben
"good ideas and bad code build communities, the other three combinations do not"
- [link|http://archives.real-time.com/pipermail/cocoon-devel/2000-October/003023.html|Stefano Mazzocchi]
New What Ben said...
You need to get out more, Burns. C++ is a pretty cramped neighborhood... ;-)
Regards,

-scott anderson

"Welcome to Rivendell, Mr. Anderson..."
New Even C++ allows defining in scope...
for (var job eachJob = .....
New My two sense...
we usually had most logic than a simple ArrayList or Vector in our collection classes...

so:
   JobCollection allJobs;
   Job aJob;
   Job aProgammer; // Better still

Then:
   foreach (allJobs.begin(), allJobs.end(), <function call>);

(Or you could simply walk through them)
   for (allJobs::iterator i= allJobs.begin(); i != allJobs::iterator.end(); i++) {
       // DO something
   }

// The each aspect is implied - so it falls out.
New Well,
I write in what I'm paid to write in. Right now that's C...with a migration to C++ in the offing.

Most of my work is in the embedded arena. The closest thing I have to a script language is the shell of whatever platform we're using for cross development (mostly Windows, which as we all know, doesn't have a shell; some work is going to happen on Linux [Hoo-RAY!], and I'm furiously learning bash, because csh sux!). Some talk of perl work; so I'll be availing myself of the collective's expertise soon enough.

Oh, yeah...and MAKE files...they're sorta a script....

We don' need no steenkin' Web services!
jb4
"There are two ways for you to have lower Prescription-drug costs. One is you could hire Rush Limbaugh's housekeeper ... or you can elect me President."
John Kerry
New Re: I write in what I get PAID to write in
Hm. I get paid to write in what I write in. Subtle difference. ;)

I truly appreciated the power of anonymity in dynamic languages today, when I wrote:

categories = {}.fromkeys(categories).keys()

which removes duplicate items from the sequence named 'categories'. The {} creates a new, anonymous dictionary, which is first populated with .fromkeys(), then immediately consumed by .keys(), which returns the list I want.

Of course, if I did this regularly, I would put it in a named function, like 'flatten' or 'dedupe' or something. But you get the idea.
I was one of the original authors of VB, and *I* wouldn't use VB for a text
processing program. :-)
Michael Geary, on comp.lang.python
New You're clearly NOT a contractor, then...
jb4
"There are two ways for you to have lower Prescription-drug costs. One is you could hire Rush Limbaugh's housekeeper ... or you can elect me President."
John Kerry
New I don't.
Well, I do, but I also write in a lot of other things, too.

Because learning languages other than the ones I use at work gives me a new appreciation (or depreciation, for that matter ;-) for how they operate, and new insights into how to use them creatively to solve problems.
Regards,

-scott anderson

"Welcome to Rivendell, Mr. Anderson..."
New must be nice to have real work


-drl
New I'll bet it is too
FWIW

jobs do: [:each | each start].




"I believe that many of the systems we build today in Java would be better built in Smalltalk and Gemstone."

     -- Martin Fowler, JAOO 2003
New Variable names.
I've got soem funky variables names in unit tests I've written. One test I recall has $a_time, $an_other_time, $an_earlier_time, $a_later_time, $an_even_later_time or some collection like that.

Wade.

Is it enough to love
Is it enough to breathe
Somebody rip my heart out
And leave me here to bleed
 
Is it enough to die
Somebody save my life
I'd rather be Anything but Ordinary
Please

-- "Anything but Ordinary" by Avril Lavigne.

New "$a_later_time, $an_even_later_time..."? ObSentientLRPD!
Well, what on Earth could it have been, but:
"For Wade, it is to lag."
?!

:-)


   [link|mailto:MyUserId@MyISP.CountryCode|Christian R. Conrad]
(I live in Finland, and my e-mail in-box is at the Saunalahti company.)
Resident [link|http://z.iwethey.org/forums/render/content/show?contentid=119792|zIWETHEY pilkunnussija]
     More fun with the One - (FuManChu) - (20)
         Synchonicity - (deSitter) - (17)
             When it's aNonymous, I usually do. Otherwise, nope. -NT - (FuManChu) - (16)
                 I see - (deSitter) - (15)
                     Not the point. - (FuManChu) - (14)
                         Here's a suggestion that will solve your problem - (jb4) - (13)
                             Re: Here's a suggestion that will solve your problem - (deSitter)
                             No, no, I'm swinging *back* from that - (FuManChu) - (11)
                                 Sorry, No Sale - (jb4) - (10)
                                     That would imply that YOU don't use dynamic languages - (ben_tilly)
                                     What Ben said... - (admin) - (8)
                                         Even C++ allows defining in scope... - (ChrisR) - (1)
                                             My two sense... - (Simon_Jester)
                                         Well, - (jb4) - (5)
                                             Re: I write in what I get PAID to write in - (FuManChu) - (1)
                                                 You're clearly NOT a contractor, then... -NT - (jb4)
                                             I don't. - (admin)
                                             must be nice to have real work - (deSitter) - (1)
                                                 I'll bet it is too - (tuberculosis)
         Variable names. - (static) - (1)
             "$a_later_time, $an_even_later_time..."? ObSentientLRPD! - (CRConrad)

GOPHERS, not GOLFERS!
161 ms