Programming As a Part of a Science Education? 508
An anonymous reader writes "I'm a fairly new physics professor at a well-ranked undergraduate university. When I arrived, I was surprised to discover there were no computer programming requirements for our majors. This has led to a series of fairly animated faculty curriculum conversations, driven by the question: to what extent should computer programming be a part of an undergraduate science education (in particular, physics)? This is a surprising line of questioning to me because in my career (dominated by research), I've never seriously even questioned the need. If you are a physics major, you learn to program. The exact language isn't so important as is flow control, file handling, basic methods/technique, basic resource management, and troubleshooting. The methods learned in any language can then be ported over to just about any numerical or scientific computational problem.
Read on for the rest of the reader's questions and his experiences dealing with faculty who have their own ideas.
The reader continues, "I'm discovering the faculty are somewhat divided on the topic. There is even a bizarre camp that actually acknowledges the need for computer programming, but turns my 'any language' argument on its head to advocate the students do 'scientific programming' using Excel because it is 'easy,' ubiquitous, and students are familiar with it. They argue Excel is 'surprisingly powerful' with flow control and allows you to focus on the science rather than syntax. I must admit that when I hear such arguments I cannot have a rational discussion and my blood nearly boils. In principle, as a spreadsheet with simple flow control in combination with visual basic capabilities, Excel can do many things at the cartoon level we care about scientifically. But I'm not interested in giving students toys rather than tools. As a scientist raised on a heavy diet of open source software and computational physics, I'll hang my head in shame if our majors start proudly putting Excel down on their resumes. However, in the scientific spirit, perhaps I'm missing something. So I ask Slashdot, to what extent do you feel computer programming should be a part of an undergraduate science education? As a follow-up, if computing is important, what languages and software would best serve the student? If there are physics majors out there, what computing/programming requirements does your department have? My university is in the US, but how is this handled in other parts of the world?"
CMU (Score:5, Interesting)
Necessary Tool (Score:5, Interesting)
Perl, probably Python now (Score:5, Interesting)
Probably Python would be the 'cooler' kit these days. But, my former roommate, now with the National Weather Service, says it's all command-line Perl scripts there and working with me to learn Perl was one of the best things he got in college.
MATLAB (Score:1, Interesting)
I'm a pretty competent CS/EE guy so I could just as easily be doing everything in C, but whenever I'm running simulations for signal processing or approximating systems my first instinct is to go to MATLAB.
For Physics students, it would be _nice_ to learn all about memory and objects, but if they want to be useful in an experimental and simulation sense, they really ought to just learn MATLAB... it was designed for all that anyway...
In a modern, educated nation... (Score:4, Interesting)
I'll go even further and suggest that this isn't appropriate for college, but would fit nicely into 6th and 7th grade algebra.
Matlab (Score:5, Interesting)
If a physics major wants to learn more about programming than is required to compute complex formulas in Matlab then they should probably minor or double major in Comp Sci.
I majored in Math and the only programming I did as part of my degree was in Matlab. And that was in applied classes. I was taught just enough Matlab to do the assignments.
C/Java courses would have been a waste of time. A physics major's time is best spent learning how to use existing tools rather than wasting time learning low level languages so they can reinvent Matlab functionality.
all the cool kids use matlab (Score:2, Interesting)
Programming As a Part of a Science Education? (Score:2, Interesting)
With a BS and MS in physics I find programming to get in the way of what the physics is about.
On the other hand I have spent 40 years programming and find it forces one to clarify the ideas behind any area.
I was taught Algol-60 at Stanford from the computer science department. At that time the physics department did not require any programming.
The experience of Algol lead to SAIL (Stanford AI Language) and then MAINSAIL (Machine Independent SAIL) and later Oberon and now BlackBox/Component Pascal.
All of these languages were influenced by Nicklaus Wirth who taught at ETH Zurich. Dr. Wirth adopted from Albert Einstein the phrase "As simple as possible, but not simpler" as a slogan for the Oberon Language. Einstein got his undergraduate degree from ETH Zurich. So there have a beautiful blending of physics and computer science.
One needs to be able to think abstractly as well as concretely with physics. The ABSTRACT facility and Object Oriented aspects of Component Pascal aid here. But unlike Smalltalk one is not forced to use objects. One can get down to the machine level if need be using a CODE construct within the language.
Although I have seen but not used MathLab I believe such already written graphical facilities are a benefit. Why reinvent the wheel unless it is part of the learning process.
I whole heartedly reject the C/C++ class of languages as 'programming in a can'. Far, far, too complex and syntactically messy.
Keep it simple.
Re:Necessary Tool (Score:1, Interesting)
These are very complex spreadsheets, not toys, and for the kind of work being demanded of them, they do a really nice job. In fact I have had the opportunity to look at some of them in the past they blew me away -- thousands upon thousands of datasets where each value can affect another one in a different dataset, etc... The complexity is overwhelming even for someone who has been in the software industry for over ten years.
Re:CMU (Score:5, Interesting)
UK Perspective (Score:1, Interesting)
At Imperial, they teach C in the first year (dressed up as C++, but mostly avoiding pointers + OOP). Standard 'big' project is a simplified double pendulum, numerically integrated & used to investigate chaos.
The second year sees OOP introduced rather counter intuitively via a HEP-orientated labscript. I don't like this second year script one bit, as it teaches the 'kids to program stupid access functions that never get use and build an enormous 500+ line cathedral to eventually do a calculation that could be written in three 5-line functions.
In the third/fourth year there is a computational physics option, partly lectured (FFTs,linear algebra,numeric integration,monte-carlo/Metropolis, lots more I've forgotten) and two bits of lab coursework (metropolis model of magnetic domains, solving a simple tight-binding model electronic structure with matrix method... others I've forgotten). Code can be written in any language, though most people keep on using C(++).
Other than the 2nd yr OOP via heartache, I think its pretty good.
I believe Oxford trialled using python to teach their course. You might even be able to google down the handbook.
That said; there really is room for teaching people basic data mangling (+ gnuplot scripting?) in the aim of training experimentalists to analyse their data. Its heartbreaking to watch PhDs struggle with origin to handfit things that should be batch scripted (with provisos to avoid certain areas of data from fit etc.), or hand edit a 1000+ line file of data in Notepad to cludge it into a binary-only analysis tool.
Critical Thinking (Score:3, Interesting)
I'm surprised this is even a question. There is a meaningful use for computers and information technology at virtually every level and function of Physics, save possibly the imagining part.
And even there, the mental muscles you acquire, solving puzzles, constructing semantic connections, seeing the big picture while managing the minutiae, all help to make you a better scientist, to see your problem newly. In fact a great physicist would want to try on at least two or three significantly different world views, just so they have the freedom to Grok their specific field in new and powerful ways. In my experience, getting mired in a narrow way of seeing things is the kiss of death for someone dancing on the fuzzy edge of unraveling the mysteries of existence and trying to see all in a meaningful and relevant way.
Additionally, the language of choice is clearly Vpython. Great for simulations, rich set of programmatic tools, quick prototyping, high level, easy to learn, tons of documentation, and huge user community with tons of ready made chunks of code available for the asking. Excel is a kiddie car. Forgive me, but trying to graphically express a tensor field in excel would be like trying to figure out how jerry-rig a Big Wheel to compete in the Indy 500. You're not going to achieve anything interesting in Excel, and it's a pitiful tool for expressing higher order concepts or visualizations. It's just not made for that for that purpose.
If you're looking to get a really sweet pie chart showing the distribution of funds for your next research grant, by all means, use Excel. If on the other hand you want to do a graphical simluation of branes colliding and view a number of possible outcomes, given by a select range of values for the simulations initial parameters, use Vpython. Let the tool fit the need.
"Other parts of the world" (Score:5, Interesting)
That was my formal introduction to computing. Later on in my course, I mostly used MatLab, and occasionally C. Sometimes I had to reverse-engineer old Fortran code. I wrote my Master's thesis in MatLab (even though it was a rather computationally expensive application. In scientific applications, the time saved during design time often easily makes up for the loss in computational efficiency).
Since I started my PhD, I've tried a lot of different languages, from MatLab to Java, C# Python and, recently, F#. Even though I was brought up with OSS (my laptop runs Debian next to Windows), I have come to value the rapid development capabilities of
I think my point is: It's probably a good idea to start with powerful low-level languages like C first, but don't overdo it. It's good if your students know about the existence of Assembler and Fortran, but the important point is that they lose their fear of computers. Nowadays, teenagers grow up with computers, but they never get to see behind the web 2.0 surface. Our generation grew up with text editors and batch files. They grow up with facebook. So it's important to give them a look behind the curtains. Let them feel the power of being able to control memory adresses. Once they have lost their fear of pointers, they can move on to use high-level languages that safe loads of design time, while being able to descend down into the architecture when it really counts.
Re:Science majors (Score:5, Interesting)
I know this is going to confirm every bad stereotype the
Maybe next semester I'll do a research colloquium on SQL and basic database construction.
Re:Necessary Tool (Score:3, Interesting)
Re:Matlab/octave (Score:2, Interesting)
07 Grad from Vanderbilt (Score:2, Interesting)
My programming was limited to one class on MATLAB. Learning to program was a common debate and conversation between the professors and management and the students.
The major issue with knowing how to program was for people who intended to goto grad school. It's definitely a huge plus for graduate work in physics and should be a requirement for anyone who intends to go further than a BS. Because I wasn't planning to get a masters or Ph.D. it was never really a problem.
A year later, I'm a SQL Server developer, so what do I know.
Requirement? No. Useful? Yes. (Score:2, Interesting)
My input...every scientist needs to understand the potential of computers and therefore programming languages but there's no need for them to be capable of programming. It's certainly a great asset if you can combine the scientific and practical capabilities into one person but there's really no need for it in the real world. If a physicist is capable of handling her work I don't actually care how she gets it done. All I ask is that the work be timely and correct.
So if you want to encourage the use of computer programming you need to establish a curriculum that actually requires the use of computers. If a student is able to bypass the computer and still complete assignments, labs, and exams, then the computer isn't really a requirement.
This is the view I take of virtually everything in life, if you have to question if something is a requirement than it's not a requirement becuase those are obvious
As for languages or technologies...I think that's the wrong track. If you're a programmer, capable of programming, then by definition you can program in any language provided you have some reference books and time to learn. Stick with stupidly simple programming languages for beginners and focus on the fundamentals so they can transfer that knowledge on to other languages.
Here's what I'd want any physics student to be able to do (regarding programming) after graduating from college with a physics degree.
1) Conceptualize the power of computers so that they can consider the use of computers to solve "challenging" problems.
2) Document the requirements of a test/model/project in a manner consistent with the principles of computer science so that they, or anyone else, can write a program using some computer language.
3) Interact with programmers to build/test/improve programs related to physics problems.
And the person I'd want to hire...the kickass physics major who doubled in computer science and is a contributor to the Linux kernel.
When I was an undergraduate... (Score:4, Interesting)
Teach a "power" language and scripting (Score:2, Interesting)
Re:Excel can't handle real scientific data sets (Score:5, Interesting)
There are whole classes of problems that Excel is well suited to solve. Linear propagation models, optical ray tracing for instance, is one. I remember back in the early 80's spreadsheets in general were touted as a good way to solve complicated 2-D boundary value problems via iteration because you are given a nice cell grid to start (I have foggy memories of doing this myself on whatever preceded Excel). I have seen some very impressive models built out of spreadsheets; it wouldn't have been my tool of choice, but the people putting them together could really do some impressive things.
At the undergraduate level I don't know what to say. I don't know how much programming I would force on the physics major. I am a very strong advocate of teaching mathematical methods for the major, as I had been. My professor spent some time having us learn FORTRAN, but I wouldn't say it was very productive because we were learning it for the sake of knowing it, not because we had a task to use it for (and so it really didn't set in). I didn't do any serious programming until graduate school, where I ended up becoming a FORTRAN expert after all.
I do agree that Excel can't handle real data sets, especially with the limitations of plotting 32k data points and only holding 64k in a column. On the other hand, not too much data handling you do at the undergraduate level deals with that much data.
I wouldn't say the students would be at a major handicap having only used Excel at the undergraduate level. If they are handed that particle data set in C++ objects, they'd do what I would have to do: learn C++. Between undergraduate and graduate school I made a conscience decision to learn either C or FORTRAN, since those were the languages of physics. I settled on C, picked up some books and started teaching myself. When I got to graduate school, the research I inherited was all FORTRAN, so I ended up betting on the wrong horse (at first, at least). When I got out of graduate school, I ended up learning C for the job I was doing at the time (I've since drifted into the IDL/Matlab world and now I find I'm rusty in all of them!).
You also have to be careful what you consider a grown-up language. By the time I got out of graduate school, C++ was all the rage and I kept hearing how they couldn't believe that any serious programmer would program in a non-object-oriented language unless they were either old or a Luddite.
Resume Buzzwords (Score:3, Interesting)
I was once in a moderately prestigious science undergrad program. There were no programming classes as part of the curriculum. And no, this wasn't an oversight on the part of the people who designed the program. Because this was a computer science program.
(Full disclosure: I didn't make it through. Had to admit that in case any of the profs who flunked me out read this.)
That's not uncommon. MIT probably rates as the leading computer science school in the country, maybe the world. I don't know much about their program as a whole, but I do know their key freshman course [mit.edu] spends almost no time describing any programming language. Of course, it helps that they do all their actually programs in Scheme [wikipedia.org], a language whose syntax you can write on the back of an envelope.
Which is not to say that Scheme is a trivial language. Quite the contrary. But I doubt that anybody who makes it through SICP puts "Scheme" on their resume. No, they talk about their newfound knowledge of algorithmics and data structures.
If you want to make your students skilled scientific programmers, don't make them take programming classes. Create physics classes where programming is a key element. Programming is just a tool, and do you have a class for every tool your budding physicists might use?
Re:About that Matlab thing.... (Score:5, Interesting)
Usually I don't feed ACs, but here I am astonished and ask for clarifications, because we, as educational institution with a 'university' in its name, have to pay horrendous sums for the licenses of Matlab. One single seat license is close to the campus license price of Microsoft.
Mathematica and/or C++ (Score:2, Interesting)
As a physics undergrad, I was required to take a Mathematica course. I already knew how to program, but for most of my classmates, it was their first time programming, with mixed results. Most ended up using it as glorified calculator, rather that actually creating structured programs...
What really annoys me is the anachronistic faculty who force their grad students to use Fortran 77...
Simon
Re:"Other parts of the world" (Score:5, Interesting)
YES! (Score:2, Interesting)
Re:FORTRAN? (Score:1, Interesting)
Re:CMU (Score:5, Interesting)
Re:CMU (Score:3, Interesting)
I once heard Excel described as the world's most popular functional programming language, which if you take away the GUI, it effectively is.
Once you start looking at it that way, rather then "fucking Excel" it starts to be quite a lot more powerful.
When I was a young whippersnapper (Score:2, Interesting)
From then on, data for every lab were analyzed with programs and we had to turn in our program as well as our results. It was a really good way to learn physics and programming too.
Re:CMU (Score:5, Interesting)
The same teacher also taught my older kid in programing using Pascal, my son came home from his class early in the year with a single sheet of paper. He gave me the sheet and said mockingly "the teacer reckons that assignment will take all year" (he already knew how to set up a BBS and I was teaching C lab classes at uni, so he thought he knew something). When I read the sheet I found it was a very clear requirements spec for a toy database that would indeed take him through all the common programming tasks like file handling, common data structures, sorting and searching, input parsing, relational data storage, resource management, display, etc. The project was broken into four phases that were worth 25% of the final mark. Only met the guy once or twice but his techniques rank him as one of the best programming teachers I've come across at any institution.