Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces)

Reply
Thread Tools

[Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces)

 
 
Michael Torrie
Guest
Posts: n/a
 
      12-26-2012
On 12/25/2012 04:42 PM, Rick Johnson wrote:
> With that accurate definition in mind you can now understand how
> Python classes CAN and DO have variables, just as Python modules have
> variables; psst: they're called "global variables"!


Nice ascii graphic, but citation needed. What CS text book are you
quoting from?

> Now, whilst i don't believe we should haphazardly re-define the
> definition of CS terms (or worse, re-invent the wheel by inventing
> new terms when perfectly good terms exist) I DO believe we should
> interpret these terms in their current context.


Good to have you back, Rick. I think. Sounds like you need to go back
and review your computer language theory CS class that you took in
University if you want to appeal to authority and definitions. I was
taught very clearly what Dennis articulated. We spent about 2 weeks
going over the difference between variables, names of variables,
binding, and passing. And implementing everything in Scheme. Good
days. And we reviewed that again in my computer algorithms class.
 
Reply With Quote
 
 
 
 
Michael Torrie
Guest
Posts: n/a
 
      12-26-2012
On 12/25/2012 04:42 PM, Rick Johnson wrote:
> What IS a variable Dennis?
> #
> ################################################## ##########
> # Variable (ComputerScience) #
> ################################################## ##########


Found the reference you are quoting here. It's from wikipedia.
 
Reply With Quote
 
 
 
 
Rick Johnson
Guest
Posts: n/a
 
      12-27-2012
On Wednesday, December 26, 2012 2:29:13 AM UTC-6, Steven D'Aprano wrote:
> [snip]


I won't reply to your last post on a line-by-line basis because i feel we are straying from my general point: which is that we should NEVER re-interpret existing words (in an illogical manner) whilst transforming them into specific disciplines.

My specific point is that the English word "variable" is unambiguous and transforms smoothly to an abstract idea of an identifier referencing an object, and also, that the reference is "variable" (or has the ability to change). The word "variable" is a WONDERFUL example of transforming existing words into specific esoteric disciplines.

Alternatively, you want to argue that the word "attribute" is a better choice NOT because "variable" cannot transform to a programming context, BUT because you want use "variable" to reference some "attribute" of an object...*smile*..., oh i see.

But seriously,
What is an "attribute" anyway?

################################################## ##########
# Define: Attribute #
################################################## ##########
# Noun: A quality or feature regarded as a characteristic #
# or inherent part of someone or something. #
################################################## ##########

Interesting. And what about "inherent"?

################################################## ##########
# Define: Inherent #
################################################## ##########
# Adjective: Existing in something as a permanent, #
# essential, or characteristic attribute #
################################################## ##########

Ahh... so an "attribute" is attached to an entity (okay, we could easily transform the word "entity" to a memory object, but) ...that is "permanent" AND "essential"! OPPS! Here is where your logic breaks down. Variables COULDNOT be considered permanent: neither existentially or referentially. Please re-consider this illogical transformation of the word "attribute".

[Slightly Tangential Meanderings Ahead...]
Okay, now that we've ironed-out the wrinkles in our "variable" and we see how "variable" traverses perfectly into a computing context, i want to talk about how some of our most /ingrained/ syntax is NOT correct! Specifically i want to talk about "class" and "def".

The words "class" and "def" are HORRIBLE choices for defining "classes" (oops, i should say objects, but it seems the brainwashing has run it's coarse!) and "methods/functions". I know, I know, your gut reaction is to _cling_to what is familiar -- and these words have become FAR TOO familiar to all of us -- but again, let's do some introspection of these words we "THINK"we understand.

Ask yourself. What /is/ a class?

A class is nothing more than a textual template defined by the programmer for which Python reads and creates OBJECTS in memory. If instead of "class" we used the word "object" to define a (wait for it...) "object" we would NOT ONLY be consistent and logical, we would inject more intuitiveness into our language. Can you imagine the confusion a new programmer would feel whentold that he must use "classes" to create "objects" when the only definition of classes he understands is "classrooms" and "classifications".

So the correct syntax follows:

OBJECT Car(object):
def __init__(self)
#....

same goes for methods/functions

FUNCTION foo(args):
.... pass

Of course i would be open to "obj" and "func" respectively (well maybe). But i favor the following syntax for even more intuitive consistency:

define object Car(...):
define function foo(...):

That is a work of logical fine art!. However a new problem arises: "function" an illogical choice. "Procedure" would be the obvious choice, however, old school CS majors YET AGAIN redefined a word into illogic oblivion.

Some people think Python's syntax is great, and i must confess i am one of those people, but even after all of Guido's whining about the failures of ABC's syntax he then went on to commit the same crimes[1]

[1] to a far less degree of course .
 
Reply With Quote
 
Steven D'Aprano
Guest
Posts: n/a
 
      12-27-2012
On Wed, 26 Dec 2012 20:07:53 -0800, Rick Johnson wrote:

> My specific point is that the English word "variable" is unambiguous


I'm sorry, do you mean "variable" the noun, or "variable" the adjective?

If you mean the adjective, do you mean something which naturally changes,
in the sense that the amount of rainfall is naturally variable, or a
collection of independent things which individually are constant but
collectively vary, such as the heights of children in a classroom are
variable?

If you mean the noun, do you mean a factor which is likely to vary, as in
"the weather is one variable to consider", or a quantity that is capable
of taking on a multitude of values, or a symbol which represents a fixed
but unknown quantity?

If you're going to claim that an English word is unambiguous, you
probably should choose an example with only one meaning.


> we should NEVER
> re-interpret existing words (in an illogical manner) whilst transforming
> them into specific disciplines.


I'm sorry yet again, did you mean "discipline" in the sense of
punishment, "discipline" in the sense of learning by instruction and
exercise, "discipline" in the sense of submission to authority, or
"discipline" in the sense of a field of study?


I am sorry[1] to ignore the main points of your post in favour of
attacking the very foundations of your argument, but if you build your
argument on counter-factuals (assumptions about English language which
are not, in fact, true) then even if your reasoning is utterly logical in
every step, the conclusion is still dubious.



[1] Ah who am I kidding?

--
Steven
 
Reply With Quote
 
Ranting Rick
Guest
Posts: n/a
 
      12-27-2012
On Dec 26, 11:02*pm, Steven D'Aprano <steve
+comp.lang.pyt...@pearwood.info> wrote:
> On Wed, 26 Dec 2012 20:07:53 -0800, Rick Johnson wrote:
> > My specific point is that the English word "variable" is unambiguous

>
> I'm sorry, do you mean "variable" the noun, or "variable" the adjective?
> [snip: sliding down the rabbit hole of a polysemantic nightmare...]


And now my dear friend you arrive at the horrible truth. The truth
that your language is defeating you. The truth that you dare not speak
because of the fear of unfamiliarity. You don't like that feeling, you
fear it, you prefer the warmth of clinging to a warm fuzzy something,
EVEN IF that something is a abomination.

So what do we do?

Well the obvious answer is to scrap the whole thing and start over.
Start with a system of word creation that is intelligently expandable
instead of what we have now which is a haphazard at best. Stringing
bits of Greek with bits of Latin may increase your social status at
the local chess club, but you are only injecting more garbage into the
system. The whole architecture is flawed. It's flawed in greek, it's
flawed in latin, and it's flawed in Python. You cannot create gold
from lead: "Polish a turd, it's still a turd!"

But short of re-inventing the English language ( heck, you people
won't even _admit_ to the inconsistencies in Python syntax, much less
commit to _repairing_ them!) the flaws in natural language cannot be
used as an excuse to inject illogic/inconsistency/multiplicity at your
whim. We should hold ourselves to a higher standard.

Every keyword, syntactical structure, style, etc, etc, should be based
on logical foundations; not adolescent fads or propagating more
idiotic cultural traditions. You **** and moan about language X and
how asinine the language is, them you go and repeat the same stupid
mistakes simply because you don't want to "rock the boat"?!

"""Well, urm, i don't particularly like "aspect x" about this
language, but most programmers have internalized the practice and i
don't want to confuse them with intelligent design, consistency or
logic, so i'll just propagate more of this stupidity so everyone can
feel warm and fuzzy."""

Well thanks Mr. language designer, now we'll be corralling braces for
another fifty FREAKING YEARS!

PS: Grow a pair!
 
Reply With Quote
 
Chris Angelico
Guest
Posts: n/a
 
      12-27-2012
On Thu, Dec 27, 2012 at 5:50 PM, Ranting Rick
<> wrote:
> Every keyword, syntactical structure, style, etc, etc, should be based
> on logical foundations; not adolescent fads or propagating more
> idiotic cultural traditions. You **** and moan about language X and
> how asinine the language is, them you go and repeat the same stupid
> mistakes simply because you don't want to "rock the boat"?!


Rick, ever heard of the ELIZA Effect?

ChrisA
 
Reply With Quote
 
alex23
Guest
Posts: n/a
 
      12-27-2012
On 27 Dec, 22:58, Chris Angelico <ros...@gmail.com> wrote:
> Rick, ever heard of the ELIZA Effect?


Can we _please_ stop feeding this troll?
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: migrating from python 2.4 to python 2.6 Mark Lawrence Python 0 07-09-2012 11:05 AM
Tabnanny errors when Migrating Python 2.4 code to 2.5 kyosohma@gmail.com Python 3 01-04-2008 10:28 PM
advice required re migrating php app to python and most likely zope Ken Guest Python 2 01-06-2006 10:59 AM
migrating c code to perl chetan Perl Misc 3 01-13-2004 06:35 AM
Perl Help - Windows Perl script accessing a Unix perl Script dpackwood Perl 3 09-30-2003 02:56 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57