Microsoft's KPL

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
119 messages Options
123456
Reply | Threaded
Open this post in threaded view
|

Re: Low Enrollments

Chuck Allison
Hello David,

This makes so much sense it's scary. Except I don't know how to
explain myself. I was a deprived city-slicker who did not know how to
work. College woke me up. But to be brutally honest, I didn't have
anything else to do but go to college, and I had no other area of
strength besides mathematics, so that's where I started. Not typical,
I suppose. But I totally agree - the work ethic is diminishing. But if
we can "wake some up" like I was awakened, we can grab a few good
ones, no?

Now that you mention it, we took special pains to teach our children
to work (without a farm - they had to earn what they got). My son is
now a stellar Ph.D. candidate in M.E. at U. of Mich. My daughter is a
devoted mother of two and a culinary artist. Food for thought (sic).

As an interesting data point, most of our students are older and/or
married and/or working, so we're doing okay there. It's getting them
into the program in the first place that's the problem. But I'm sure
that across the country many bail because of the work issue. Good
insight.

Wednesday, October 12, 2005, 9:45:02 PM, you wrote:

DH> On Wed, Oct 12, 2005 at 08:25:56PM -0600, Chuck Allison wrote:
>> Hello EDU-SIG,
>>
>>   CS enrollments seem to be dropping drastically everywhere. Many
>>   factors probably are at fault (dot-com bust, off-shoring hype), but
>>   there seem to be others. One in particular is that so few HS
>>   graduates seem ready analytically to join in.
>>
DH> ...
>>
>>   Honestly, I can't imagine a field that better combines both sides of
>>   the brain with a service ethic and a dimension of fun than CS. But
>>   it looks like so much nerd-ness or drivel to the uninitiated.
>>  
>>   Any ideas would be appreciated.

DH> I noticed a profound shift occur at Glencoe High School in Hillsboro, Oregon
DH> between 1985 (when I graduated from there) and 1995-1998 when I visited
DH> there to give talks for national engineering week. In one memorable
DH> experience, I spoke to the Biochemistry students, in the same classroom
DH> where I had taken that same class a decade earlier. These were the top 20
DH> math and science students in the school. I asked how many of them wanted to
DH> become engineers. I got zero responses. I was floored. Based on my
DH> experience of the past, I had expected least a handful! I said "engineering
DH> is a good career, it pays good money, why are you not interested?" One kid
DH> raised his hand and said "It's too hard." Another volunteered, "Yeah, I have
DH> a friend who is an engineering student and he has to work all the time." I
DH> was dumbfounded. It appeared as if these kids thought there was a hard road
DH> to success and an easy road to the same success, so planned to take the easy
DH> road.

DH> Chuck, we are up against a more difficult problem than just making CS look
DH> cool. CS is fun, of course, but it is also hard work, there is no disguising
DH> that.  If the rising generation doesn't have the work ethic, there is really
DH> no substitute.

DH> In my experience, I noticed that among the successful American-born
DH> engineering students, a significant number of them had been raised on farms,
DH> where they had to get up at 5am every morning to milk the cows. In other
DH> words, they knew how to work.  So what did I do?  When I lived back in
DH> Oregon, we moved out to the country and we had goats and chickens, and my
DH> boys went out with me morning and evening to milk the goats.  Now that we
DH> live in a different environment in North Carolina, I have taken a different
DH> route and have the boys help me in our home publishing business.  They have
DH> gotten pretty good at binding books. (Just a little plug: anyone who buys my
DH> book is contributing to my children's education in multiple ways.)

DH> David H




--
Best regards,
 Chuck


_______________________________________________
Edu-sig mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/edu-sig
Reply | Threaded
Open this post in threaded view
|

Re: Low Enrollments

wesley chun
In reply to this post by David Handy
On 10/12/05, David Handy <[hidden email]> wrote:

> On Wed, Oct 12, 2005 at 08:25:56PM -0600, Chuck Allison wrote:
> >
> >   CS enrollments seem to be dropping drastically everywhere. Many
> >   factors probably are at fault (dot-com bust, off-shoring hype), but
> >   there seem to be others. One in particular is that so few HS
> >   graduates seem ready analytically to join in..
>
> I noticed a profound shift occur at Glencoe High School...
> ...
> I asked how many of them wanted to
> become engineers. I got zero responses. I was floored.
> ...
> Chuck, we are up against a more difficult problem than just making CS look
> cool. CS is fun, of course, but it is also hard work, there is no disguising
> that.  If the rising generation doesn't have the work ethic, there is really
> no substitute.
>
> In my experience, I noticed that among the successful American-born
> engineering students, a significant number of them had been raised on farms,
>
> David H


chuck, david,

yes, this is very disturbing indeed.  as a society, i think we are
definitely "falling behind."  it's true that most HS grads are *not*
ready for the rigors of engineering in college.  i too, graduated HS
in 1985 when it wasn't all that bad.  when i completed grad school 10
years later, i did notice that the *majority* of graduate students in
the CS dept were born overseas.

it's not that we *don't* have the talent, but that they have been
diverted elsewhere.  sadly, i don't see this trend reversing anytime
soon, and yes, this will make offshoring even more attractive to
employers.  i (mostly) joke that in 20 years from now, i'll be
flipping burgers.  i hope that it doesn't get to that point.  if we
lose our ability to innovate, that's the end of the US as we know it.
this country is founded on innovation and hard work -- does this come
from the farmland too?

i feel that we are definitely losing the edge in everything science
and math-oriented.  people are not taking care of themselves... we are
getting fat and lazy, letting other people do the dirty work for us.
in a way, this applies to your argument.  why should i do the hard
work when someone else will do it for me (and more cheaply).

we can only slow it down with wonderful tools like python.  jeffrey
elkner and other educators have seen better retention rates in their
classes, but still, i don't want this to be just a stem in the tide.
somehow, good-paying, hard-working, and smart need to be attractive to
people as something that they want to be.
we don't offshore our medical services right?  there still need to be
doctors; their presense is locally required.  unfortunately, that
isn't necessarily true for engineering.

oh, and to answer your original inquiry, here's a link to CP4E:
http://www.python.org/cp4e/

-- wesley
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
"Core Python Programming", Prentice Hall, (c)2006,2001
    http://corepython.com

wesley.j.chun :: wescpy-at-gmail.com
cyberweb.consulting : silicon valley, ca
http://cyberwebconsulting.com
_______________________________________________
Edu-sig mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/edu-sig
Reply | Threaded
Open this post in threaded view
|

Re: Low Enrollments

Toby Donaldson
In reply to this post by Chuck Allison
>I noticed a profound shift occur at Glencoe High School in Hillsboro,
> Oregon between 1985 (when I graduated from there) and 1995-1998 when
> I visited there to give talks for national engineering week. In one
> memorable experience, I spoke to the Biochemistry students, in the
> same classroom where I had taken that same class a decade
> earlier. These were the top 20 math and science students in the
> school. I asked how many of them wanted to become engineers. I got
> zero responses. I was floored. Based on my experience of the past, I
> had expected least a handful! I said "engineering is a good career,
> it pays good money, why are you not interested?" One kid raised his
> hand and said "It's too hard." Another volunteered, "Yeah, I have a
> friend who is an engineering student and he has to work all the
> time." I was dumbfounded. It appeared as if these kids thought there
> was a hard road to success and an easy road to the same success, so
> planned to take the easy road.

Hmm, is this just the "kids today are lazy and didn't work as hard as
I did in my day" argument? I don't buy that one. Kids today are no
less lazy than at any other time in history. Perhaps they have more
opportunity for leisure, but many still say they want to become
doctors or nurses or lawyers --- careers that require lots of
education and hard work.

I think when a kid says "engineering is too hard", they are also
saying that they don't see the rewards of engineering as very
significant. I really don't see kids as being afraid to work hard;
quite the opposite, I am often amazed at how hard students will work
on something that is interesting and valuable to them.

Doctors and nurses make a difference every day. This is why they put
up with grueling work schedules. They love their jobs, and they see
first-hand the difference they make. The rewards are tangible and
obvious ("for every death a birth, for every sickness a cure").

Do programmers make a difference? Not according to the typical CS PR:
programming is something that is "fun", "cool", and so easy to do that
anyone can master it. You know, like bowling. A fun, rewarding
activity that anyone can get good at with a little practice.

I think the rhetoric of "cool" and "fun" is a fine way to get younger
kids interested in programming, but it depresses me to see university
CS programs advertise the same way. It's like a medical school
enticing students to take their program by showing you how cool it is
to be a Beverley Hills plastic surgeon.

I think CS is a field that makes a difference; I just don't think CS
educators (such as myself) communicate this very well.

Or maybe the answer is simply that the 50-year bubble that CS has been
riding has finally popped? Maybe we are just in the middle of an
inevitable "correction"? It's not like CS saw the web coming!

Toby
_______________________________________________
Edu-sig mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/edu-sig
Reply | Threaded
Open this post in threaded view
|

Re: Low Enrollments

Peter Bowyer
At 07:35 13/10/2005, Toby Donaldson wrote:
>I think when a kid says "engineering is too hard", they are also
>saying that they don't see the rewards of engineering as very
>significant. I really don't see kids as being afraid to work hard;
>quite the opposite, I am often amazed at how hard students will work
>on something that is interesting and valuable to them.

Could it also be because Engineering is never advertised as being
creative?  Certainly when I was looking at doing civil &
environmental engineering it was sold as "You get to direct large
machines, follow someone else's plans, and make sure the concrete is
poured in the right place".  OK a bit of an overexaggeration, but no
creativity or innovation appeared in the description.

I would have loved to study cartography or photography which would
satisfy my creativity, but neither had good job prospects, so I did
physics instead (which is supposed to - if you want to employ a
masters graduate who's done his project on teaching programming to
unwilling physics undergraduates, contact me).

>Doctors and nurses make a difference every day. This is why they put
>up with grueling work schedules. They love their jobs, and they see
>first-hand the difference they make. The rewards are tangible and
>obvious ("for every death a birth, for every sickness a cure").

Mind you that applies to most jobs, from journalist to author to
teacher to musician.  I've yet to meet a passionate accountant, which
leads me back to the role of creativity in a job.

Peter

--
Maple Design - quality web design and programming
http://www.mapledesign.co.uk 

_______________________________________________
Edu-sig mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/edu-sig
Reply | Threaded
Open this post in threaded view
|

Re: Low Enrollments

Arthur-27
In reply to this post by Chuck Allison


> -----Original Message-----
> From: [hidden email] [mailto:[hidden email]] On
> Behalf Of Chuck Allison
> Sent: Thursday, October 13, 2005 12:02 AM
> To: David Handy
>
> As an interesting data point, most of our students are older and/or
> married and/or working, so we're doing okay there. It's getting them
> into the program in the first place that's the problem. But I'm sure
> that across the country many bail because of the work issue. Good
> insight.

I think this is an interesting datapoint.

Kids grow up in the US, just slower.

Among the reasons, I think, that things like Law attract so many brighter
students is that no commitment to it is required before graduate school.
One can be a sort of dissolute undergraduate dabbling in any of the softer,
less demanding Liberal Arts, knowing that one is not ready to commit to any
difficult and demanding course of study - and then "hit a books" in a
serious way first as a graduate student. Business School is another example.

There is nothing equivalent in the sciences.  The structure is such that one
can only go down that road if one makes the decision to do so early - as a
practical matter before many students are ready to make such a
commitment/decision. Even if, given time, that is the decision they might be
likely to make.  

Because by the time they might, they are prerequisited out of the game.  

Science programs, including computer science programs, that kicked in later
in a student's career might help as a work-around.


Art



_______________________________________________
Edu-sig mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/edu-sig
Reply | Threaded
Open this post in threaded view
|

Re: Low Enrollments

Arthur-27
In reply to this post by Peter Bowyer


> -----Original Message-----
> From: [hidden email] [mailto:[hidden email]] On
> Behalf Of Peter Bowyer
> Sent: Thursday, October 13, 2005 3:57 AM
> To: [hidden email]
> Subject: Re: [Edu-sig] Low Enrollments
>
>
> Could it also be because Engineering is never advertised as being
> creative?  Certainly when I was looking at doing civil &
> environmental engineering it was sold as "You get to direct large
> machines, follow someone else's plans, and make sure the concrete is
> poured in the right place".  OK a bit of an overexaggeration, but no
> creativity or innovation appeared in the description.

Like learning Java.

Art


_______________________________________________
Edu-sig mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/edu-sig
Reply | Threaded
Open this post in threaded view
|

Re: Low Enrollments

david-2
In reply to this post by Toby Donaldson
On Wed, Oct 12, 2005 at 11:35:36PM -0700, Toby Donaldson wrote:
> > It appeared as if these kids thought there was a hard road to success
> > and an easy road to the same success, so planned to take the easy road.
>
> Hmm, is this just the "kids today are lazy and didn't work as hard as
> I did in my day" argument? I don't buy that one. Kids today are no
> less lazy than at any other time in history. Perhaps they have more
> opportunity for leisure, but many still say they want to become
> doctors or nurses or lawyers --- careers that require lots of
> education and hard work.

I wasn't speaking about all kids everywhere in the world. But unfortunately
I have several more data points to show there really was a problem among
American kids in Oregon in the 1990's. I read reported statistics that said
Oregon was one of the bottom states of the US in terms of kids wanting to go
into *any* technical profession. I saw reports in the media of scholarship
programs and training programs with seats going empty for lack of interest.
The programming and electronics classes at Glencoe High were both canceled
for lack of interest.

Kirby is in better touch with the pulse of things back in Oregon now than I
am. Hopefully he has witnessed a rebound, hopefully things have gotten
better. But I believe there really was a dip in the 1990's.

> I think when a kid says "engineering is too hard", they are also
> saying that they don't see the rewards of engineering as very
> significant. I really don't see kids as being afraid to work hard;
> quite the opposite, I am often amazed at how hard students will work
> on something that is interesting and valuable to them.

Yes it is true that people find ways to work hard at things that interest
them; somehow many have a hard time finding something that is interesting
and valuable to them!

Unfortunately, the majority of this group told me that they were "undecided"
on what they wanted to major in. In particular I don't remember any saying
they wanted to become doctors, etc.

It seemed like we had a group of kids who were college-bound because their
parents had money, but they were unmotivated. Hopefully they became
"late-bloomers" and "found themselves" later on.

I didn't want to come across as saying "kids today are lazy" so much as to
emphasize that I've seen the correlation between a willingness to work --
including physical labor -- and entering and succeeding in technical fields
of study.  Good parents take note and prepare your children accordingly.

On a related note, I have also noticed a lack of confidence, a fear of
failure, contributing to people being unwilling to try difficult technical
studies.  Somehow someone has to convince them they can do it.  In my case
it was my father who boosted my confidence.  The parents' attitude makes a
big difference.  I remember teaching a programming seminar to a group of
12-year-olds as part of a Boy Scouts activity.  One young man kept saying
over and over "I'm just no good at this stuff" even though (1) he had never
tried before, so how did he know he wasn't good at it? and (2) he understood
and followed all the directions perfectly.  But I know why he said he was
"no good at this stuff" -- I had overheard his father saying that exact same
thing.

David H

_______________________________________________
Edu-sig mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/edu-sig
Reply | Threaded
Open this post in threaded view
|

Re: Uniform Access Principle confusion

Arthur-27
In reply to this post by Arthur-27


> -----Original Message-----
> From: Kirby Urner [mailto:[hidden email]]
> Sent: Wednesday, October 12, 2005 2:25 PM
> To: 'Arthur'; [hidden email]
> Subject: RE: [Edu-sig] Uniform Access Principle confusion
>
>
> Note that passing an argument is not the only way to tell an object stuff
> like "my preferred unit of measure."  That could also be regarded as a
> change in state, and be handled with another attribute, e.g.:
>
>   >>> Triangle.anglemeasure = 'degrees' # set default class attribute
>   >>> mytri = Triangle((30,60,90))      # instantiate using degrees

But in my (perhaps overly strict) way of OO thinking the unit of measure is
an attribute of the angle, not of the Triangle.

Is there a way to a accomplish a "change of state" of the angle "attribute",
other by sending it a parameter?

Art


_______________________________________________
Edu-sig mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/edu-sig
Reply | Threaded
Open this post in threaded view
|

Re: Low Enrollments

Arthur-27
In reply to this post by david-2


> -----Original Message-----
> From: [hidden email] [mailto:[hidden email]] On
> Behalf Of David Handy
> Sent: Thursday, October 13, 2005 11:48 AM
> To: Toby Donaldson
> Cc: [hidden email]
> Subject: Re: [Edu-sig] Low Enrollments
>
> It seemed like we had a group of kids who were college-bound because their
> parents had money, but they were unmotivated. Hopefully they became
> "late-bloomers" and "found themselves" later on.

Which is consistent with the point of my previous post - once they might
bloom a bit, technical subjects no longer seem like an option.  They just
reconcile to the "fact" that they have missed the boat, unless they are
unusual enough to be willing to in some sense "start over".

Can't help thinking that a program geared to older students, on a graduate
school level, that assumed little in the way of accomplished pre-requisites,
would help the cause.  I don't think this is totally unrealistic since, on
the graduate school level, a degree of commitment and maturity of the
students can be assumed that is not so at the undergraduate level. So the
intensiveness of what might need to be accomplished to get somewhere
substantial in, say, a 3 year program is not necessarily be pie-in-the-sky.

Law School tends to be intense in that way.  But my sense that those schools
are filled with late-bloomers looking/wanting to get intensive - but with no
particular commitment to the study of Law.  Its just that, as things are,
that seems to be a path  accepting of their previous educational background,
whatever that might happen to be.

Though it is certainly true that folks at this stage are quite career
oriented, and that if the root problem is connected to off-shoring, maybe
nothing will help.

One of the founders of Intel gave an long interview on public television
last night, and spoke extensively on this subject. He considers himself a
pessimist on this subject, at least as to where the US is going.  Though I
felt his ire was quite misdirected, seeming to be pointing the finger at the
religionists influence on the respect for science.

I guess only those of us truly unaffiliated can wonder out loud how much of
the disrespect for science is a (certainly unintended) side effect of the
efforts to engineer gender fairness.
 
Art







_______________________________________________
Edu-sig mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/edu-sig
Reply | Threaded
Open this post in threaded view
|

Re: Low Enrollments

Arthur-27


> -----Original Message-----
> From: [hidden email] [mailto:[hidden email]] On
> Behalf Of Arthur
> Sent: Thursday, October 13, 2005 1:26 PM
> To: 'David Handy'; 'Toby Donaldson'

> Though I felt his ire was quite misdirected, seeming to be pointing the
> finger at the  religionists influence on the respect for science.

The sense of him be off-base here not totally uninfluenced by having
recently browsed a book of Donald Knuth's MIT lectures on Christian belief.

Art


_______________________________________________
Edu-sig mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/edu-sig
Reply | Threaded
Open this post in threaded view
|

Re: Low Enrollments

Kirby Urner
In reply to this post by david-2
> Kirby is in better touch with the pulse of things back in Oregon now than
> I am. Hopefully he has witnessed a rebound, hopefully things have gotten
> better. But I believe there really was a dip in the 1990's.
>

Not sure about a rebound yet.  Free Geek (freegeek.org) has been an
important influence in Greater Portland, in getting a lot of kids through
the Build Program and onto Linux.  

I think that's a good route, as the Build Program is also about recycling
and community service.  Plus it's very hands on and Free Geek has way of
making technology accessible -- lots of interesting junk to play with,
friendly people to answer questions.  I often see lots of kids there
(including last Tuesday -- for our Portland Python Interest Group meeting).

More NGOs like Free Geek are sorely needed IMO if only to cut down on
recyclable stuff going to landfills.

I have two blog entries of possible interest on this theme (each fairly
short).

This very recent entry re Saturday Academy summarizes a 20 year attempt to
recruit more native engineering talent in Oregon (mentions "work ethic"):

http://worldgame.blogspot.com/2005/10/saturday-academy.html

And then there's this older one about a visit from Dr. Wulf, president of
the National Academy of Engineering (about creativity):

http://mybizmo.blogspot.com/2005/04/last-isepp-lecture-2005.html

howtoons.org and Make: Magazine (O'Reilly) represent attempts to counter
technophobia among the young.  

Probably another factor behind technophobia is fewer teens work on their own
cars anymore (engines have gotten more complicated), plus we don't fix so
much as replace electronic components (there's less to repair).

Another take:
http://chronicle.com/forums/colloquy/read.php?f=1&i=5123&t=5092 

That's me replying to Chris Stephenson, head of Computer Science Teachers
Association, his post being here:
http://chronicle.com/forums/colloquy/read.php?f=1&i=5109&t=5092 

(The article we're referring to is I think only available to subscribers)

Kirby


_______________________________________________
Edu-sig mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/edu-sig
Reply | Threaded
Open this post in threaded view
|

Re: Uniform Access Principle confusion

Kirby Urner
In reply to this post by Arthur-27
> But in my (perhaps overly strict) way of OO thinking the unit of measure
> is an attribute of the angle, not of the Triangle.
>

I think of the unit of measure more as an attribute of the viewer, so if
this were MVC-style OO, we'd probably keep the model in some internal unit,
perhaps integer, while translating to time/size units (e.g. ergs) per some
request into the model by a view, as mediated by the controller.

For example, with the Triangle class, we might just define __slots__ for 3
xyz tuples (per your point re __slots__, yes, for economy in memory) -- and
that's it.  A viewer class might glom on and suck down a reference to a
triangle object, and from self's three slots spit back all angle and edge
measures, in whatever language or units.  A French Imperial bot could spit
back in French.

> Is there a way to a accomplish a "change of state" of the angle
> "attribute", other by sending it a parameter?
>
> Art
>

Well, you could do as follows:

 >>> mytri = Triangle()
 >>> mytri.C.degrees
 90
 >>> mytri.C.radians
 1.5707963267948966

In this case, the angles are thought of as "sub objects" each with their own
sets of attributes, in this case both radian and angle measure.  The
subobjects might also support actions, e.g. mytri.C.break() or
mytri.C.colorize('Red') -- note verbs.

Just mytri.Cd and mytri.Cr would likely be less confusing (degrees and
radians respectively -- we maybe don't know if these are implemented as
properties unless we have access to the source code).

Note that many programmers visualize a GUI on an object, when coding with
it, i.e. they'll translate the published API, all spelled out in formal
syntax, in terms of slider bars, popup menus, other widgets (it's like the
cockpit of an airplane, once the objects get complicated and plentiful
enough).  That's like a customized "programmer specific" view *into* a
model.  The model itself contains to views.

I saw some examples of this the other night at PORPIG.  Dylan projected some
Zope 3 off his Linux laptop, showing a simple 'hello world' object being
defined in terms of MVC.  A .py file defines M.  V is handled by interfaces
(links to another template XML: .zcml).  These go in product subdirectories.
C (the Controller) is Zope itself in this case i.e. py classes + interfaces
+ Zope = MVC.

Kirby


_______________________________________________
Edu-sig mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/edu-sig
Reply | Threaded
Open this post in threaded view
|

Re: Uniform Access Principle confusion

Kirby Urner
> model.  The model itself contains to views.

That should have been:

"The model itself contains NO views."

I was doing MVC earlier a bit on this list:
http://mail.python.org/pipermail/edu-sig/2005-August/005087.html

To see where our discussion of the Triangle class begins check:
http://mail.python.org/pipermail/edu-sig/2005-August/005057.html
(this later became a discussion of the Python properties feature, plus
decorators).

For a good example of a Zope 3 project check out SchoolTool:
http://www.schooltool.org/

Kirby


_______________________________________________
Edu-sig mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/edu-sig
Reply | Threaded
Open this post in threaded view
|

Re: Uniform Access Principle confusion

Arthur-27
In reply to this post by Arthur-27


> -----Original Message-----
> From: Kirby Urner [mailto:[hidden email]]
> Sent: Thursday, October 13, 2005 7:35 PM
> To: 'Arthur'; [hidden email]
> Subject: RE: [Edu-sig] Uniform Access Principle confusion
>
>
>  >>> mytri = Triangle()
>  >>> mytri.C.degrees
>  90
>  >>> mytri.C.radians
>  1.5707963267948966

Well that looks simple, elegant, and straightforward enough for my purposes.


Is there a simple elegant and straightforward way to implement this API in
Python that I am missing?  I know better than to assume that I don't miss
the obvious when it comes to this stuff.

Art



_______________________________________________
Edu-sig mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/edu-sig
Reply | Threaded
Open this post in threaded view
|

Re: Uniform Access Principle confusion

Kirby Urner
> >  >>> mytri = Triangle()
> >  >>> mytri.C.degrees
> >  90
> >  >>> mytri.C.radians
> >  1.5707963267948966
>
> Well that looks simple, elegant, and straightforward enough for my
> purposes.
>
>
> Is there a simple elegant and straightforward way to implement this API in
> Python that I am missing?  I know better than to assume that I don't miss
> the obvious when it comes to this stuff.
>
> Art
>
>

 >>> class Angle (object):

        def __init__(self, thevalue):
                self.value = float(thevalue)

        @property
        def degrees(self):
                return self.value

        @property
        def radians(self):
                return math.radians(self.value)

 >>> class Triangle (object):

        def __init__(self, A=30, B=60, C=90):
                self.A = Angle(A)
                self.B = Angle(B)
                self.C = Angle(C)

               

       
 >>> mytri = Triangle()
 >>> mytri.C.degrees
 90.0
 >>> mytri.C.radians
 1.5707963267948966
 >>> mytri.A.degrees
 30.0
 >>> mytri.A.radians
 0.52359877559829882

Kirby


_______________________________________________
Edu-sig mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/edu-sig
Reply | Threaded
Open this post in threaded view
|

Re: Uniform Access Principle confusion

Arthur-27
In reply to this post by Arthur-27


> -----Original Message-----
> From: Kirby Urner [mailto:[hidden email]]
>
>  >>> class Angle (object):
>
> def __init__(self, thevalue):
> self.value = float(thevalue)
>
> @property
> def degrees(self):
> return self.value
>
> @property
> def radians(self):
> return math.radians(self.value)
>
>  >>> class Triangle (object):
>
> def __init__(self, A=30, B=60, C=90):
> self.A = Angle(A)
> self.B = Angle(B)
> self.C = Angle(C)

Works for me.

And I think pedagogically valuable as an approach.

For an (embarrassingly) long time I had complicated my class hierarchies by
not seeing the simple possibilities of creating classes to act as attributes
of more far-reaching classes.

Its simple and obvious -  once it's simple and obvious.

Downsides, warnings?

Art


_______________________________________________
Edu-sig mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/edu-sig
Reply | Threaded
Open this post in threaded view
|

Re: Uniform Access Principle confusion

Kirby Urner
> Its simple and obvious -  once it's simple and obvious.
>
> Downsides, warnings?
>
> Art
>

So far we're looking at pretty straightforward composition of objects (less
an inheritance pattern), i.e. angle objects composed in a triangle.  

However, it could easily needlessly complexify, the bane of good style.
Keeping it simple is actually harder than giving in to tempting
clevernesses.

There's nothing here yet to stop an uninitiated user from trying to start a
new triangle with radian inputs.  I should post a guard, or at least better
document the API (perhaps using __doc__ strings).

Also, AAA (angle-angle-angle) isn't usually considered a sufficient
criterion for congruence (in topology it might), as no edge size has been
specified (i.e. only similarity has been established).  

So the above Triangle class more defines an equivalence class than a
template for any one triangle.  That may lead to confusion down the road.

That's all I can think of at the moment.  When it comes to finding
weaknesses, that's generally a drawn-out process.

Thanks for asking though -- you helped me get thoughtful.

Kirby


_______________________________________________
Edu-sig mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/edu-sig
Reply | Threaded
Open this post in threaded view
|

Re: Uniform Access Principle confusion

Arthur-27
In reply to this post by Arthur-27


> -----Original Message-----
> From: Kirby Urner [mailto:[hidden email]]
> Sent: Friday, October 14, 2005 12:47 AM
> To: 'Arthur'; [hidden email]
> Subject: RE: [Edu-sig] Uniform Access Principle confusion
>
> > Its simple and obvious -  once it's simple and obvious.
> >
> > Downsides, warnings?
> >
> > Art
> >
>
> So far we're looking at pretty straightforward composition of objects
> (less
> an inheritance pattern), i.e. angle objects composed in a triangle.
>
> However, it could easily needlessly complexify, the bane of good style.
> Keeping it simple is actually harder than giving in to tempting
> clevernesses.

OK.  But there are lessons attached - something to the effect of "exploring
freedoms".

Which is what I think makes Python a pithy environment in which to learn
about programming.

And part of what connects programming, in general, to - for me - the
development of mindfulness.

Perhaps stated in my usual inappropriately pithy manner.

Art


_______________________________________________
Edu-sig mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/edu-sig
Reply | Threaded
Open this post in threaded view
|

Re: Uniform Access Principle confusion

Kirby Urner
> Perhaps stated in my usual inappropriately pithy manner.
>
> Art
>

Not too pythy, as we both know 'bout Python.

Kirby


_______________________________________________
Edu-sig mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/edu-sig
Reply | Threaded
Open this post in threaded view
|

Re: Low Enrollments

Arthur-27
In reply to this post by Arthur-27


> > From: [hidden email] [mailto:[hidden email]] On
> > Behalf Of Peter Bowyer
> > Sent: Thursday, October 13, 2005 3:57 AM
> > To: [hidden email]
> > Subject: Re: [Edu-sig] Low Enrollments
> >
> >
> > Could it also be because Engineering is never advertised as being
> > creative?  Certainly when I was looking at doing civil &
> > environmental engineering it was sold as "You get to direct large
> > machines, follow someone else's plans, and make sure the concrete is
> > poured in the right place".  OK a bit of an overexaggeration, but no
> > creativity or innovation appeared in the description.

It seems to me the issues here are all tied together quite neatly with some
of the discussion of the previous thread - small business vs. large
business, the impact of companies like Microsoft (well maybe mostly just
Microsoft)  in the marketplace and on traditional notions of the
relationship of large companies to educational institutions, etc.

Though, unfortunately, I don't see a way to make these tie-ins in a few
words.

Suffice it to say that there is zero question, none -  that Microsoft's
tactics over the last 15 years have had the effect of stifling the impetus
of smaller players to direct efforts towards innovation in a very wide
swatch of the potential area for such innovation.  This isn't a quirky,
iconoclastic view of things.  The fact is certainly getting noticed in very
mainstream industry analysis. And at Microsoft, I'm sure. The days of the
creative, innovative, entrepreneurial developer allowing themselves to spend
their energies to become the uncompensated market research department of a
Microsoft are over. A whole vibrant market segment has simply dried up and
gone away.

Which doesn't yet touch on Microsoft's ability to influence agendas in
academic settings.

I could go for pages, talking to a good degree from a personal frame of
reference, talking about circumstances that I have been close enough to
observe where Microsoft has seen fit to assert its clout, and managed to
move mountains that by the charters and mission statements of the
organizations involved should have been quite unmovable.

To the extent that the CS departments have allowed, and continue to allow,
themselves to be company towns for the major industry players, they deserve
what they get.  And if what they get is a lack of interest, maybe that is
saying something optimistic about who our kids are today.

Art


_______________________________________________
Edu-sig mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/edu-sig
123456