Do you know where your variables are? PerlMonks

### Programming & real life

by nothingmuch (Priest)
 on Dec 30, 2003 at 01:07 UTC Need Help??

A year or two ago, when I was moaping about being stuck and angry at high school mathematics, especially geometry, my dad (being a mathematician) and I had a discussion (during one of our makeup classes (My teacher and I couldn't cope with each other, so we decided to part ways (turned out that me & dad didn't get along that well either))), in which he mentioned that geometry really hadn't much to do with mathematics in terms of what the board of education (here at least), attempts to achieve by teaching it.

The rationale, he said, behind it is that people need to know how to use an abstract set of axioms to solve complicated problems by gradually building upon them. The technique is, when generalized, a way of using understanding and experience simultaneously.

He went further, perhaps to sooth my frustrations, and noted that the means of teaching it, the geometry we all know, is somewhat counter productive. The reason for this is that it is, in his opinion, too near to reality to be truely generalized. If we hadn't learnt plannar (is that correct?) geometry, but instead applied a different set of rules to a different symbolic universe, somewhat less similar to ours (like a two dimensional one that is actually shaped like a donut, for example), perhaps the tools we have acquired would have been more easily used against other aspects of life, having nothing to do with maths at all.

The thought occurred to me that despite it's even tighter relationship to reality (especially when oriented towards objects), programming provided me with immensely useful tools of abstraction, perception and attitude towards many practical problems.

I think the reason for this is that to program "correctly" you need not think like you do intuitively (unless you've been programming for too long... ;-), but instead pretend you're solving a problem while you are blind, deaf, and illiterate, in a way, due to the (current) simplicity of all aspects of computation, as high a level as they may very well be, in comparison with the human way of thought.

Basically... Do you guys think that programming has as much, or perhaps even more to give to mind in need of general education, not specific knowledge, than something like geometry?

Update: grammer

-nuffin
zz zZ Z Z #!perl

Replies are listed 'Best First'.
Re: Programming & real life
by Ninthwave (Chaplain) on Dec 30, 2003 at 10:43 UTC

You should read Godel, Escher, Bach by Douglas Hofstadter. This is an excellent examination of the way we think, and the relationship between axiomic systems and reality. The purpose of the book is to discuss AI possibilities, but to do such Hofstadter discusses the concept of thought really well. I was lucky to read this book quite young and early into my life as a programmer. As much as I think you can draw reflections of reality in programmming you have to realise that programming, mathematics, physics, all axiomic systems are approximations of reality and these approximations can fall over and often do when the system you are in stacks up its axioms.

"No matter where you go, there you are." BB
Re: Programming & real life
by Sandy (Curate) on Dec 30, 2003 at 02:09 UTC
Hmmm,

Interesting thought. I love to program, and I absolutely love geometry, but not how it is taught in high schools. (I took advanced geometry in university).

So, do I think that the learning the methods of programming give a more general education than learning the methods of geometry?

When I try to solve very difficult algorithms, I find that I do it in the same fashion that I try to solve any problem. I'm not sure that I learned my problem solving techniques via school, but more that I honed the ability by applying it to a variety of different tasks (programs, math, science, how to repair my stupid leaking tap...).

But, programming is more than just problem solving. It also has asthetic qualities. For example, lots of posts here are "How do I make my clunky code nicer?".

And... when we need to program something which other people will use (instead of for your own use), you truly have to put yourself into the mind of the user. How would they want to use it, what do they need, etc. Learning how to do this certainly helps us problem solve in ways that is certainly not required by mathematicians.

So I guess that there is a lot of 'general knowledge' gained by learning to program than is generally given credit.

Just don't discount what some people learn from geometry. Those who are really into it go nuts over neat proofs the same way we all go nuts over cool code.

Re: Programming & real life
by hardburn (Abbot) on Dec 30, 2003 at 04:10 UTC

If we hadn't learnt plannar (is that correct?) geometry . . .

Euclidian geometry is what is normally taught in high school. It roughly follows the real world, but has some significant differences (how do you draw a line infinately long and infinately thin? No cheeting with the little arrows at the end!)

Oddly, geometry was one of the few subjects I really liked. Perfectly logical, and you could figure stuff out on your own just by scratching diagrams out on paper during boring classes.

In the general case, programmers don't need a great deal of math experiance, but the ability to prove things, as taught in geometry, is vital. Set theory is also useful (type systems and relational database theory are based on set theory), but higher mathmatics than that may or may not be useful, depending on the type of problems you solve.

----
I wanted to explore how Perl's closures can be manipulated, and ended up creating an object system by accident.
-- Schemer

: () { :|:& };:

Note: All code is untested, unless otherwise stated

Ah yes... euclidian... =)

-nuffin
zz zZ Z Z #!perl
Re: Programming & real life
by pg (Canon) on Dec 30, 2003 at 04:49 UTC

I always had the belief that, when programming teaches you the way of structive thinking and provides you great opportunity to practice it every day, it slowly kills your sense of non-structive thinking, which is ultimately much more powerful.

Down to the bottom, although computer is very powerful, it is only good at:

1. Problems can possiblly be resolved in a sequential manner. (two side notes: 1. OO is still sequential, but people intend to see a section of the sequence a time; 2. (a limited number of) multi-process and multi-threading is still sequential, you just have more than one sequence.)
2. Even under point 1, computer cannot help resolve all problems that can possiblly be resolved by applying a sequence of actions, it in fact only helps to resolve problems that have very reasonable complexity.

Although there are lots of progress in computer science in last half century, there is simply no break through after Turing. The computer is getting faster and faster, and the way to develop computer system is getting more and more efficient, but none of those progress is on track of possibly leading to a quantum leap.

Today, everyone learns computer as a basic skill, but in terms of teaching one the power of thinking, computer does much less than geometry, at least to my own experience.

. . . computer does much less than geometry, at least to my own experience.

A general purpose computer can do anything that is mathmatically possible, provided it has enough memory (see also: Turing Complete).

Though I do think Computer "Science" has stagnated into "make it go faster, mommy!" over the last 30 years, I disagree that there weren't any breakthroughs since Turing. Microprocessor technology, Unix, relational databases, and functional and OO programming were all breakthroughs. Turing just did the One Big Breakthrough, the CS equivilent of Newton or Einstein (one will note that there are a few centuries between geniuses in other disciplines, and CS has already had its quota).

----
I wanted to explore how Perl's closures can be manipulated, and ended up creating an object system by accident.
-- Schemer

: () { :|:& };:

Note: All code is untested, unless otherwise stated

"...computer does much less than geometry, at least to my own experience."

The way you cut and paste from my post, made my sentence has a totally altered meaning. and I think the right way is:

"but in terms of teaching one the power of thinking, computer does much less than geometry, at least to my own experience."

You cannot cut the bold part off, and I was not saying what you thought I said.

Re: Programming & real life
by nimdokk (Vicar) on Dec 30, 2003 at 02:37 UTC
Very nice little essay there. Wish my dad had given me that sort of description of geometry when I was wallowing in it in high school myself. Hindsight being 20/20, I can see that now. It is too easy to get stuck on one way of doing something, think of the the box as it were. I've had to debug (and re-write) Perl scripts that were essentially NT batch command processes because that was the only way the person who was writing it seemed to be able to think.

If you focus too closely on something, you sometimes can't see another way around a particular problem. You almost need to be someone who specializes in generality (or something to that effect :-).

Anyway, very thought provoking.

"Ex libris un peut de tout"
Re: Programming & real life
by bl0rf (Pilgrim) on Dec 30, 2003 at 03:26 UTC
Nothingmuch,
I completely agree with you, I have often had the same thoughts. Programming has helped me structure my brain and developed my problem solving skills. I have also learned the unreliability of computers and long hours of debugging for mind boggling bugs have given me a healthy amount of paranoia and doublechecking skills.

During my work with C ( ok it was pretty short ) I have never worried about aesthetics, I consider optimization and beauty of code more present in Perl than in other languages. Perl's language-like structure is a big plus when it comes to creative coding. Also, about being limited by certain outlooks ( 2D instead of 7.5D planes ) - working with Perl has given me more freedom than working with other languages because Perl offers less constraints.

Programming most definitely modifies your mind, it is like the effect of the logic of mathematics ( OK, I'm a logic addict I admit it ).

Re: Programming & real life
by tilly (Archbishop) on Dec 31, 2003 at 03:51 UTC
Useful context: I wrote Re: (OT) Should math (or adv. math) be required in CIS degrees? and I have a strong mathematics background.

My considered opinion is that mathematics and science as they are currently taught do virtually nothing to help the average person learn to think more clearly. Instead they teach people how to apply poorly comprehended formulas by rote because that is how authority said to do it, and you will get good marks on the test. If correctly taught, either subject could go a long way towards teaching these basic mental skills.

The essense of what I consider correct teaching of each includes a clear understanding of the reasoning process, and a gut-level understanding of how science and math evolve as natural extensions of normal human methods of comprehending the world around us. Only if you capture that connection (which today is only captured by accident) is the significant insight possible.

Note that abstracting everything amazingly far, right away like your dad suggests, is not something that I advocate. Quite the contrary, the New Math experiment of trying to do that with everyone was quite the failure. A lot of that failure was because the teachers who were asked to implement it didn't understand what they were supposed to teach. (Always a recipe for disaster.) But I believe that much of it is because a capacity for abstraction is learned and developed, you cannot start people off with expecting them to behave ideally. People don't work that way. (This may have been a problem with your dad tutoring you - if so then he would not be the first mathematician that I know who had problems explaining math to his own kids on this account.)

Likewise programming has the same potential. For the same reasons. I also doubt that it would work in the real world for the same reasons. After all if teachers who do not understand programming were asked to teach kids who are uninterested in programming to program, what would happen? Well both teachers and kids would be likely to be performing actions by rote. With pressure on the teachers to give the kids results that they can see. Very quickly the entire exercise would reduce to teachers showing kids how to plug answers into a wizard that would write the program. Neither teacher nor students would understand what the wizard did, and neither would have a clue how to proceed with any situation that the wizard did not provice a pre-canned answer for. What lessons about how to think for yourself would you expect to be passed along?

For further thought, a dated but insightful critique of the "new math" movement is Why Johnny Can't Add. It is still worth reading for anyone who believes that it is appropriate to teach mathematics by first teaching excessive abstraction. By contrast anyone who wants to learn to appreciate mathematics is highly encouraged to pick up, The Mathematical Experience. It may not make geometry any more fun for you, but it may help you understand your father's love of mathematics. And finally a tip to all of you college-bound highschool students. If given the choice between taking a highschool Calculus course and taking more algebra and geometry, I strongly suggest that you take more algebra and geometry. The US school system horribly shortchanges you when it comes to basic mathematics. Sure, you can learn by rote the manipulations that get the right answers on a Calculus test. But you won't understand the subject without a better understanding of the basics. And if you fail to place out of Calculus in college, having been through (and failed to understand) Calculus in highschool is worse preparation than having a solid background in algebra and basic trigonometry. (Particularly when you get to Calculus II and have to do complex substitutions.)

Re: Programming & real life
by SamCG (Hermit) on Dec 30, 2003 at 22:09 UTC
No one seems to have mentioned the obvious: programming teaches you to think (and sometimes even speak and write) in a precise manner. As a programmer for a financial firm, I can't count the number of times someone from one of the business units has come to me with a request and I've had to tell them that what they just asked for wasn't what they actually wanted. As programmers, we care about details, and this meticulousness can carry over into our general thinking. How many times have you (as a programmer) heard some random bit of conversation and realized that what someone was saying wasn't accurate for one reason or another, and that there could be a complete semantic disconnect between the two parties because of some difference of interpretation. If you eavesdrop as much as I do, it's been pretty often. Sometimes this precision even goes to the extent of annoying and infuriating others. Nothingmuch's post, for example, uses 5 sets of parentheses in the first paragraph without confusing them (hrrmmmm. . . so programming doesn't exactly teach how to avoid run-on sentences. . .;))(not to say that the post was annoying (at least to me, though it could be to some)).

I think this is a good thing.

Don't get me wrong, I enjoy a good ambiguity now and then -- in a joke, or in a poem. And, if I need to, I can use ambiguities in normal speech as well, if I have a desire to mislead the person I'm speaking to (if I wish to do this, though, I prefer to make things ambiguous by simply leaving particular details unspoken and letting the listener come to the wrong conclusion (I happen to have also just gone through law school, so I know a bit about misleading without lying)). However, in general I am not inclined to use ambiguities.

Do other subjects teach this sort of thinking? While many subjects may rely on the same sort of attention to detail that programming does, few have as immediate an effect as writing and then attempting to run a program (after all, if you get a geometry proof wrong but think it's right, you wouldn't know -- if you write a program incorrectly, then it will (likely) do something unexpected when running). Also, I feel that for many, programming would be more immediately tangible than geometry (I don't mean to be short-shrifting geometry, it's obviously very useful). In programming one is actually creating something, while in geometry one is frequently simply proving something. Maybe if they taught geometry by getting kids to build houses. . .

Oh, and it's "planar".

Are you actually IN high school or recently graduated? Or do you just harbor a long-running grudge against high-school geometry? And, unless your Dad is completely unavailable, don't give up on your relationship with him -- it's only been a year or two!

Learning calculus ( my favourite ) has led me to become meticulous about correct grammar and speech - rather than programming leading me to it. This is due to my teacher's continued demands that exact terminology be used. Working with calculus does have an immediate effect, lack of correct form or ambiguity on a test immediately lowers my mark :-)

Re: Programming & real life
by Courage (Parson) on Dec 30, 2003 at 12:50 UTC
I only have a side note about "geometry that is far from our universe".

Actually this is what almost all high mathematics is about.
Topology, and most of all - algebra (not a calculation but algebra in its own) are very abstract and only come to our universe in their application side from time to time, most of the time having specualtions about many things inside them.
Alike, when your donut is extremely (infinitely) huge you will be very close to speculations in our 3D universe.

However IMHO teacher should not distract young people from further studying by frustrating them (like it was in your case) and forcing them studying what they do not want.
I fully agree it is much more interesting to have tasks and their bright solution applied in real life, so you will have fun solving them.
BTW what is programming Perl mostly is about - is having fun.

Courage, the Cowardly Dog

Re: Programming & real life
by jonadab (Parson) on Dec 30, 2003 at 19:29 UTC
The reason for this is that it is, in his opinion, too near to reality to be truely generalized. If we hadn't learnt plannar (is that correct?) geometry, but instead applied a different set of rules to a different symbolic universe, somewhat less similar to ours (like a two dimensional one that is actually shaped like a donut, for example), perhaps the tools we have acquired would have been more easily used against other aspects of life, having nothing to do with maths at all.

Yep, he's a mathematician alright. This is *exactly* how mathematicians think: How can we generalize this so that it is applicable to other things besides the traditional applications? Let's define subtraction entirely in terms of addition, so that if we redefine addition we have subtraction too, for free. Then let's develop a new class of numbers (or, if you prefer, objects) that aren't remotely similar to traditional natural or real numbers, and then let's define an "addition" operation on them that's isomorphic to standard arithmetic addition... we'll do the same thing for multiplication, and then let's generalize this whole process so that we can talk about any given pair of addition/multiplication operatons on any given set as a Group... then let's take these Group concepts and apply them to electrical engineering, art, philosophy, literature, ... anything *but* arithmetic.

programming provided me with immensely useful tools of abstraction, perception and attitude towards many practical problems.

There are some very strong relationships between programming and math. I've just been reading Hofstadter's book <cite>Godel, Escher, Bach: an Eternal Golden Braid</cite>, and the author (who really wants to talk about Artificial Intelligence but has to delve into other areas to make his points) draws parallels (actually, a full-blown isomorphism) betweem a formal system in math and a Turing-equivalent programming language. (In particular, the chapter on BlooP and FlooP and GlooP is of interest. See also the notes on my scratchpad about this, which may or may not eventually become a node.) In other words, anything that can be done in the one can be done in the other, though it may be more or less convenient to do so. All of that to say, programming and math have a great deal in common, and if one is applicable to a problem you can expect the other to be applicable as well. (Well, not quite; some forms of modern math do not fit into formal systems and so programming may not be able to handle them. But most of the math you've probably had up to this point is probably not in this category.)

Basically... Do you guys think that programming has as much, or perhaps even more to give to mind in need of general education, not specific knowledge, than something like geometry?

You should study the geometry. If you have a mind for programming, you should be able to enjoy the geometry as well. If the teachers and textbooks you've had haven't made it come alive for you, try to find some other books on the subject that are more suitable. Yes, the programming has as much to offer, but the geometry is another way of looking at things, and the added flexibility of being able to think in terms of both will be very beneficial. You should study both -- and if you enjoy one, it should be possible to enjoy the other as well, given the right approach. Like I said, find a different book or a different tutor or something, but don't give up on math. Math can be very cool, if you find the right approach to it.

```\$;=sub{\$/};@;=map{my(\$a,\$b)=(\$_,\$;);\$;=sub{\$a.\$b->()}}
split//,".rekcah lreP rehtona tsuJ";\$\=\$ ;->();print\$/
Re: Programming & real life
by poqui (Deacon) on Dec 30, 2003 at 17:37 UTC
Re: Programming & real life
by QM (Parson) on Dec 31, 2003 at 05:27 UTC
Good topic, lots of interesting responses...here are mine :)

1) Yes, geometry should teach you how to reason logically from assumptions to conclusions. This could be achieved other ways, but geometry has the advantage of direct presentation via visuals and kinesthetics, as well as the traditional verbal means. Algebra "puzzles" and Murder Mysteries are not as directly accessible by everyone (especially by the teachers, who, it can be argued, need the most help).

2) Learning to program, and practicing programming, can both help and hinder this goal. It can help by forcing you to focus on the critical details of a problem. It can hinder because there are myriad details to handle that are related to programming and implementation, not to the problem. [An interesting topic to explore would be a measure of the level (high or low) of a language, insomuch as its statements relate to the problem, and not to programming or computers or even people.] It can also hinder because it is possible to write programs that are nearly correct, that either give an answer close enough, or for the inputs tried, or most of the time, but fail for some inputs, or have other subtle errors -- the programmer may think s/he understands the problem, but has failed on some fundamental point (or just tripped over the syntax).

3) The more I learn, across disciplines seemingly unrelated and irreconcilable, the more I realize that everything connects to everything else. The obvious links, like between math and physics, are expected. But who expected fractals to predict tree branching and mountain formation? The less obvious links bring a smile with them -- such as Fibonacci patterns in sunflowers, or chaotic neuron firings indicating a healthy brain.

4) Until you understand the fundamentals (such as the rules of proof in geometry), you will have a hard time making real progress in a subject area. As an example, I liked the way Feynman explained light reflection from a glass window.

The traditional argument was that light was reflected from both the front surface and the back, because of the abrupt transitions between the indices of refraction (air to glass, then glass to air), as if the light were reflected by the boundary itself, and not the material.

Feynman (in the Red Books) starts from a fundamental principle of light: it has a frequency. Since light is a wave (in this context, anyway), it is not a localized phenomenon, and cannot be reflected by a highly localized (and somewhat imaginary) boundary. Instead, suppose it is reflected from each "layer" within the glass, and also transmitted by each layer, and is more accurately described as a superposition of these two states. The resulting reflection and transmission ratios are determined by the number of wavelengths that "fit" in glass at the angle of propagation. The reflections that do not "fit" cancel out, and in the ideal case the result is the same as if assuming light is reflected off the air-glass boundaries. But in less ordinary situations, such as variations in the index of refraction through the material, this new approach makes predictions that match experiments, and is less cumbersome to manipulate than the old way. [I don't think Feynman came up with this - but his was the first and best explanation I've seen to date.]

5) I wish someone had taught me the fundamentals of problem solving directly, instead of having to discover them gradually on my own, with fits and starts and backtracking. There is merit in rediscovery, but I always feel like I've missed something...;)

-QM
--
Quantum Mechanics: The dreams stuff is made of

Re: Programming & real life
by johndageek (Hermit) on Dec 30, 2003 at 22:52 UTC
Interesting post (and replies). A lot of what I read here is a stepping point to philosophy, religion and belief structures. Men (yes, yes and women, kids and all other humans), frequently seem to feel the need to explain the world (universe) around them. And by God we will (oops, sorry that is one of the explanations used). So for this discussion we need to define what “good thinking” is that will be needed in general education.

Good clear logical thinking is frequently promoted as the way to go, so mathematics is touted as a good tool to practice with (cool, but why do we need imaginary numbers? – could we be missing something?). Programming allows us to manipulate multi-dimensional arrays, welllll, ok it really is just linear memory containing ones and zeros in repetitive patterns we imagine will represent what we perceive as a multi-dimensional object in our universe. Oops, what about the idea of multiple universes (oh, oh, universe does not have a plural does it?)

What we do with our perceptions, feelings, and experiences determine how we think. When we run up against a new situation or idea, we need to integrate it into our experience in a manner we can accept and apply to our lives. These new inputs cause us to extend or change how we perceive our world. Our application of this information allows us to change our world, or our perception of it.

Abstraction is something we do naturally since we cannot experience our world directly. Sight is merely the abstraction of the physical world around us by interpreting light bounced off real world objects. Touch is the abstraction of the real world objects as interpreted by nervous impulses detecting pressure and temperature. Smell is the interpretation of very small particles as they contact mucus membranes and their effect is transmitted to the brain by nerves. Hearing is the translation of vibration of the molecules surrounding the eardrum, and nerves sending a set of pulses to the brain.

Once you start thinking about how abstract our very lives are, those who can program and do math, need to look at others who think artistically, or emotionally, or intuitively in a different light.

An interesting thought, how are others abstractions different from our abstractions of life?

Thank you for a good and thought provoking post!

Dageek

Re: Programming & real life
by The Mad Hatter (Priest) on Dec 30, 2003 at 17:57 UTC

Create A New User
Node Status?
node history
Node Type: perlmeditation [id://317594]
Approved by Daruma
Front-paged by hsmyers
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (8)
As of 2020-08-06 07:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
Voting Booth?
Which rocket would you take to Mars?

Results (39 votes). Check out past polls.

Notices?