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?"
You can lead a horse to water... (Score:5, Insightful)
Certainly Excel can be a powerful, and useful, tool in data analysis. But I agree, I would never call it programming.
For simulation, however, I would expect you need something a bit more powerful. Perhaps you can teach all the students how to use Excel to analyze experimental data, and design a separate course for simulation design, which would, in turn, use a far more featured language/toolset.
The big danger with trying to teach a "real" language is that you spend the whole semester teaching students with no aptitude for the work the basics of structured programming and they still won't have time for the numerical analysis that is important to them as scientists. Structured programming is as natural as breathing to a geek, but it would be a bit more of a struggle to somebody without the right mindset. I don't see any way of forcing two required semesters of programming on every student. Just not room in the schedule for it.
However, keep in mind that the purpose of college is not to get those students employed, it is to teach them to think. Your brighter students are going to figure out that as a practical skill, most of them will need to know how to program, and would possibly sign up for "Programming for Theoretical Science Majors" as an elective The not-so-bright students... well... they will struggle in the real world, just as they always have.
SirWired
why is your blood boiling? preconceived notions? (Score:4, Insightful)
(i'm an aerospace engineer, and for work, i program in c, fortran, java, vb, and yes, excel / vba,depending on the need)
Computational Physics (Score:5, Insightful)
Bottom line: IMHO no special effort to add programming to a physics curriculum should be necessary. However, there are obviously classes where programming is essential to the physics content and for those you would horribly disserve your students by candy-coating the computational aspects.
Require programming as a pre-requisite where the class requires it, and if that means that none of the reasonable degree tracks are possible without it then you have your answer.
Don't forget floating point .. and abstraction (Score:4, Insightful)
A solid understanding of the nature of floating point numbers wouldn't hurt either. For example, something like David Goldberg's What Every Computer Scientist Should Know About Floating-Point Arithmetic [sun.com].
As to the language not being important, I don't know that that's entirely true. Each language offers a choice of types and some sets of choices are more instructive than others. I personally think Lisp or Scheme are good teaching candidates because they offer arbitrary precision integers and rational numbers in addition to basic floating point number types so that it's easy to see side-by-side the trade-offs being made between correctness on one hand and space/speed on the other hand that go along with choices in this regard.
Plus, if you go the Scheme route, you get teaching materials focusing on good abstraction like Sussman and Wisdom's Structure and Interpretation of Classical Mechanics [mit.edu], the proper companion to Abelson and Sussman's popular CS text Structure and Interpretation of Computer Programs [mit.edu]!
GNU Scientific Library. (Score:4, Insightful)
The GSL [gnu.org] is mostly C. It's useful for students to take a numerical methods class and recreate the basics and to understand the limitations. Once they know, they can use libraries like GSL to get real work done.
Excel is not only a joke for real problems, it's a real problem to grade.
Matlab/octave (Score:5, Insightful)
Computer Literacy vs. Computer Science (Score:5, Insightful)
But scientists are going to need to do increasing amounts of computer use as computers pervade and inform the sciences, and that means doing their own programming, including writing real programs and writing scripts to bash input or output data for other programs. So they not only need to learn some syntax, and some scripting languages, they need to learn basic data structures, efficiency issues, debugging, and one of the most important lessons from my CS100 days - "Never trust input" "Ever" . That means they need at least two semesters of programming.
As scientists, even if they don't ever end up doing much more programming than feeding input to other packages and interpreting the output, they need to be able to do it in ways that will run in finite amounts of time and produce correct output - and learning not to trust input is as basic as learning not to connect the 110volt power to a 5 volt device or use fire near flammable liquids.
Re:GNU Scientific Library. (Score:2, Insightful)
Scientific problems, sure. It's not designed for that any more than GNUCash is. But let's not generalize, twitter. It's actually one of Microsoft's better products.
For complex charting and plotting I really like GNUPlot [gnuplot.info].
Re:Necessary Tool (Score:2, Insightful)
When doing complex computation, having a better understanding of the structure that you're building can be of immense value.
Re:Necessary Tool (Score:5, Insightful)
As far as requiring physics majors to take a programming course, I think that is ridiculous. I went through a PhD level applied physics program including writing a simulation of chemical reactions occurring on the surface of space shuttle heat shield tiles during re-entry and never found anything more than spending a few hours here and there reading language syntax. The applied maths literature is full of pidgin code for the algorithms that is easily translatable into the language of your choice. The courses in algorithm analysis and numerical methods are the rest if what you need. A formal course would have been both a terrible bore and a waste of time that should be spent on something more useful like quantum electrodynamics.
Re:programming for scientists (Score:3, Insightful)
I wouldnt say essential, but it certainly helps, although most sciences don't require programming to achieve their goals, the mode of thinking envolved in programming can be intrinsicly helpful to science. And as you said "graphical", 3D software in general certainly has its place.
Personally, I think at some stage in general curriculum (K-12) programming should be envolved. I was lucky enough to have a teacher in grade 5 that made/let us do basic (as in easy, not the language) programming, to draw and animate a worm doing [something]... although I had previously done PET/BASIC (Commodore) at home, it certainly helped in my general understanding of how things work, and most likely helped lead to my fascination with computers, programming, and 3D and therefore science and mathematics as a whole.
The answer to the Excel argument... (Score:5, Insightful)
Excel is not sufficient instruction in programming any more than Algebra is sufficient instruction in math. So if someone suggests that all students need to learn is Excel, you may ask why the students are required to take more advanced math classes.
Re:Excel can't handle real scientific data sets (Score:4, Insightful)
I cannot agree more. After a master in high energy physics where I learned C++/matlab(or octave)/gnuplot/latex/... I decided to continue my career in medical physics.
I was shocked by the omnipresence of Word and Excel. I am sorry, but there should be corporeal punishment for people publishing scientific papers with figures made by Excel.
Now, with a good undergrad training in programmation we would avoid such abberations
Re:why is your blood boiling? preconceived notions (Score:5, Insightful)
I once had a friend who built an instantiation of LIFE in Excel. Using macros and stored VB code in each cell, he was able to have every cell look up the context of every other adjoining cell during each generation, and the cells would turn on and off accordingly.
I'm not saying it can't be done in Excel. I'm saying just because you're versed in Excel, doesn't mean it's an expedient, or even appropriate tool for managing complex data structures, critical physical concepts, or large multidimensional problem sets.
For straight forward engineering and archtectual applications, it might well prove to be an excellent resource. It just seems a little like going next door via the polar route to try ways of making problems fit an inappropriate tool, vs finding an optimal tool in the first place and having it available for problems requiring greater flexibility, and less application related operational overhead.
Of course, when what you have is a hammer...
Re:In a modern, educated nation... (Score:2, Insightful)
Just because computers are so prevalent doesn't mean that everyone needs to know how to program. Effective programming is very analytical and structured and some people just don't work that way, and that's fine- we all have different strengths and weaknesses. Stop trying to make everyone fit into your mold. The *last* thing we need is for every Tom, Dick and Harry to think they know how to program because they can get the computer to print out "Hello World"
You enjoy listening to music, right? Well, I've heard you singing and believe me- stick to using the CD, don't try and create music!
Numerical methods requires programming (Score:5, Insightful)
Every physics graduate should have the ability to find and use Numerical Recipes by Abramowitz and Stegun. Doesn't matter if they're using the C version, Fortran or whatever. This means you need to teach some programming, but more importantly the skills to understand the recipes.
Re:You can lead a horse to water... (Score:3, Insightful)
One course is dangerous (Score:2, Insightful)
There are those that study programming and are respected by others who know what they are doing.
And there are those (probably managers) who have one course in programming and have written a 50 line program (probably in Basic). They think they know programming. Those people are dangerous.
Re:Perl, probably Python now (Score:3, Insightful)
About that Matlab thing.... (Score:4, Insightful)
Re:GNU Scientific Library. (Score:5, Insightful)
Re:CMU (Score:5, Insightful)
With one of my professors, it was "You can use any language you want as long as it can do the job it's required to do and your TA is willing to accept it". That approach worked really well for us. The TAs were very flexible. In fact, I would tend to think the job of grading projects was much more interesting because of all the variations in the student's work. Remember, you've said it yourself, this is not supposed to be a class on syntax. At my school at least, they didn't teach us the languages, they taught us the concepts (and you were supposed to learn the computer languages on your own, and of course, every Professor had their favorite pet language they had been developing/using for the last twenty years).
For the lecture itself, I think the choice should be left to the Professor teaching the class in question. If the Professor is an expert in Logo, let him use that -- if that's what he wants. If the Professor is an expert in pseudo-code and wants to use that -- let him use that. If the Professor is an Expert in VBA, let him use that if that's what he wants to use. Hopefully, your faculty is made up of smart people. If they're smart, just let them use the tool of their choice -- they'll probably do a far better job with them (than giving them some pre-assigned tool). An chances are, the students will gravitate toward the common tools already used in the industry.
The thing is, VBA may not be considered a grown-up language to you, but I can almost guarantee that if you run into a Physics Professor who's an expert in VBA -- he/she will be able to do things in it that you couldn't even dream was possible. So I would advise you against going down that road of trying to prove them wrong, I'm pretty sure you won't be able to. So let that Professor teach in VBA if he wants to, but don't let him force you to teach in a tool you don't want to teach in.
FORTRAN? (Score:5, Insightful)
Just like they say "Don't give a programmer a soldering iron", giving physicists something like C is probably giving them more than they need for most number crunching.
Constantly programming for science (Score:3, Insightful)
Physics studies fundamental effects (Score:2, Insightful)
As for the specific tools the students use for solving problems or analyzing data, sometimes Excel is all that is needed, and it is part of a physics education to develop a sense for the right tool for the job. It was suggested in another post to encourage the use of MatLab, which is one good choice among many powerful tools. Each has trade-offs and a learning curve. I have used Excel, Kaleidagraph, Mathematica, Labview, Matlab, Maple, Origin, Igor and others. A friend of mine uses MathCad very effectively. Excel will not do the job of one of these more sophisticated analysis tools. Because it takes a while to climb the learning curve on any of these it is important to choose one and stick with it. I never had the benefit of a class that covered one of these but it would be a great idea.
Nevertheless it is not the place of these tools to teach you programming. Understanding the fundamentals of how to program well deserves a class of its own. I studied Fortran for my first computer class as a physics major, which would probably still be just fine. C might be more appropriate now. Some of the above tools can also call routines written in C. I don't have a broad enough perspective to come up with the best curriculum for such a course off the top of my head, but it is certainly more than can be contained within the context of Excel.
Didn't the Computer Science department at your university ever offer a programming class geared toward physics and engineering students?
-Dan
Re:Science majors (Score:4, Insightful)
Something like Pascal or Python would probably have been better for learning programming, but Fortran was/is the language for science and engineering.
I'm very glad I wasn't introduced to something as inconsistent and inelegant as VB(A) so early in the learning process. It's much harder to unlearn than it is to extend your knowledge.
experimentalist too: science is transparent. (Score:2, Insightful)
Even experimentalist need to know what functions are applied to their data and they should use tried and true software. Stable free software comes with transparency which is nice.
The cut off thing happens to more than scientists. Engineers, CAD people, graphic designers, anyone who uses their computer for more than word processing faces the expensive software trap.
I imagine a theorist like you can run rings around most at the kinds of things Mathematica and Maple do. What do you use them for and what do you suggest as replacements?
Leave teaching programming to the CS department (Score:2, Insightful)
A good researcher is going to learn to use his tools, one way or another. Most (probably all) physics students are geeks plain and simple. Figuring out a computer language isn't really that hard. Learning good programming practices is harder, but truth is that most "trained programmers" have poor practices too. In my field, mission critical software is written by a people who have degrees in computer science and the like not by physicists. We also have frequent workshops and seminars to help us learn to effectively use the computing infrastructure built up around our experiment. This is big science with huge collaborations and millions of dollars, but I've also worked in a small AMO group and it wasn't that different.
Leave the heavy computing tasks to the pros, and let the scientists do what they do best tinker, experiment, learn and discover. I won't dispute the need to program, but I still don't think that there needs to be required courses on it in science curriculum in general.
Re:Necessary Tool (Score:1, Insightful)
I think any science major should take a programming course and properly learn the language he / she is using. You must not only fully understand the numeric methods use, you must be able to implement them in a clean and feasible way.
It it has to be a requirement of a science program I do not know. But one thing is important, don't try to teach them the difficult languages first (like C), something easy like python will do most jobs. If that does not cut it they can step it up and learn C++ or so...
Re:Science majors (Score:3, Insightful)
Fear. Plain and simple. I've seen too many otherwise intelligent people completely freeze up when presented with a computer.
I used to think that it was a case of the older generation not being used to them, but I still see it happening with people who are younger then me.
Once you get beyond things that they know how to do people seem to have an irrational fear of breaking things. Personally I think the first lesson in any basic IT course should be showing people just how hard it is to completely break modern computers.
Re:Science majors (Score:1, Insightful)
Intelligence is weird. Swap "computer" for "English" in your sentence, and you'll see demonstrations of the same issue every day in
People's brains are an odd combination of hardwiring and practice, and it is quite common for extreme skill to be demonstrated in one area while other areas are as extreme in their weakness. When someone is truly "generally intelligent", we usually call them a genuis, and it's quite a rare thing (and it ain't me!). From my experience, the expression of intelligence can be highly variable depending upon the skill being exercised.
Also, computers being a relatively new thing in society, there is a whole generation that grew up using them, and a whole generation that didn't, which probably leads to more disparity than usual.