Programming As a Part of a Science Education?
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?"
The introductory physics classes at Carnegie Mellon use VPython to run some simulations. It's pretty simple to use and intuitive. The textbook makes use of it too.
While a lot of computational physics requires speed, I find myself on a daily basis needing to write simple programs to collect, filter, transform and plot data. I have found no better language for writing these quickie tools in than Python.
Once they know Python, then they can pick up C++ or Java as context requires it. And if they never have to deal with really huge amounts of computation, then Python + Scipy might get them by for most everything. (And if not, Python has bindings for everything, practically.)
Physics requires number crunching. It's that simple. It's not much use learning differential equations if you're incapable of solving anything useful. Any physics or engineering major should learn at least basic numerical methods and how to implement them. For me, we did it with C, nothing fancy. As far as using Excel for scientific computing, some of my classmates tried to pull this in a heat transfer class. It's a joke, it'll work for something really simple, but it's no good for any serious work.
I'm not suggesting that all physics students must learn C++ and Matlab, but they should be taught a grown-up computer language so that they at least understand the concept of C++ objects, or how to begin solving the problem of communicating with a machine via a Matlab environment.
My examples are very specific, but you get the idea. Physicists need to be aware of certain computer programming concepts (which cannot be gleaned from experience with spreadsheets) otherwise they will fall flat on their face when faced with a real research environment.
The specific language is not very important, but physics tends to be dominated by C/C++ and Fortran, so these would definitely be a good place to start.
Even BASIC is better than Excel.....
All of the libraries and programs of interest are in C and FORTRAN. C++ is interesting and used but the other two still dominate. If you had to chose between the two for teaching people to program, take C. For utility, the two are about equal.
It depends on what you feel they MUST learn.
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
learning to program in excel / vba DOES do what you CLAIM to want (flow control, file handling, basic methods / techniques, troubleshooting), so why is your blood boiling? preconceived notions? and yes, excel IS surprisingly powerful (those who don't think so aren't leveraging its capabilities). someone who can PROGRAM in excel / vba (versus just manipulate a spreadsheet) will be perfectly capable of programming in perl / python / fortran with very little additional work if the need arises.
(i'm an aerospace engineer, and for work, i program in c, fortran, java, vb, and yes, excel / vba,depending on the need)
http://aps.arxiv.org/abs/0803.1838
DNA in your Linux: DNALinux
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.
Lacking <sarcasm> tags,
Back in undergrad, I helped my AtmoSci Masters' roommate out with several projects. At least in his case, the problems involved a lot of comma or space separated text files and mostly just limited data manipulation. Students had all been taught FORTRAN, weakly, and most classmates were trying to do it in FORTRAN. Several times, we created 20 line not-terribly-obfuscated Perl programs that worked much better than pages of FORTRAN for the task at hand.
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.
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.
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 , the proper companion to Abelson and Sussman's popular CS text Structure and Interpretation of Computer Programs !
Kent M Pitman
Philosopher, Technologist, Writer
The GSL 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.
...one might expect, given the ubiquity of computers, that everyone (not just science majors) have some basic understanding of programming, even if it's just -- err --- BASIC.
I'll go even further and suggest that this isn't appropriate for college, but would fit nicely into 6th and 7th grade algebra.
What good reason is there that would make Matlab insufficient for a physics major? What amount of programming does a physicist do on a given day at the job?
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.
Work Safe Porn
I am a experimental physics postdoc. Nearly everybody i know uses Matlab/Octave (theoreticians Mathematica). For simple (not heavy number crunching), matlab/octave is the de-facto way to exchange numerical programs. You get without much trouble results and a plot within a few minutes. And your students will learn what vectorization is, if they use matlab long enough. (if you can write you operation in a vectorized form, you can also do heavy number crunching). The documentation of matlab is excellent, and there are a lot of toolboxes which actually solve detail work (they have their price). You can use instrument control and DAQ toolboxes to control experiments directly. The matlab support is responsive and not arrogant at all (reporting bug is more a "thank you, we'll look at it" experience instead of a "what the fuck are you doing to trigger this bug? dont do it."). One big problem about matlab is that it spoils the programming style a little bit, but after all, these are physicists. The ones who can not program when they enter university will never learn it fully.
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.
Bill Stewart
New Fast-Compression-only CPR http://preview.tinyurl.com/dy575ks
Kind of kidding-at least in my uni the engineering and science depts. seem to use matlab for all their computational needs. It's sort of integrated into the curriculum as part of calculus 3, so invariably all the science/engr. kids take it-plus it gets thrown into other courses too, so a student's almost forced to pick it up if you want to do well.
open source modern art: laser taggi
I have mixed feelings on this topic.
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.
Lacking <sarcasm> tags,
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.
"Programming is essential to the sciences."
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.
I assume that Physics majors at your university are required to take some level of math classes.
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.
paintball
If Excel and Word are conceivably viable alternatives with VBA, why not Emacs? You could get lots of obscureness points for it being based on LISP, and you could write a grant proposal to develop it into something serious in, oh say, 20 years? (That's the way academia works, isn't it? ;-)
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...
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.
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.
There's a perfect xkcd for my sig but I'm too lazy to look it up. sudo someone go find it.
Every physics graduate should have a grounding in numerical methods. This requires some programming, but the critical point is that the numerical methods drives programming not the other way around.
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.
In theory, there's no difference between theory and practice; in practice there is.
There are those that don't know how to program. They generally respect those who do.
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.
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.
There are no strictly mandatory courses that teach programming. Even though, hearing a lecture on a programming language is recommended as is hearing a lecture on numerical computation which touches on numerical accuracy issues as well as basic numeric algorithms (interpolation, equation solving, splines...). Most students choose to follow that recommendation and end up hearing a lecture in C/C++ for the most part. Also, there is a lecture on computational physics, which introduces a wide set of useful tools for those that feel inclined to take that road. This lecture is purely optional and usually only attended by a couple of students.
I am not aware of any diploma thesis that was completed lately that did not include some basic scripting or programming by the author. Most topics require the students to do either considerable numerical computations (theoretical topics, mostly) or some heavy data processing, often in the form of image processing (experimental topics). Most students seem to be prepared well enough for these tasks by the time they start with the thesis work. I have never heard of any problems that arose because a topic required more elaborate programming skills than the student had or was able to develop during the thesis work (which lasts for a whole year).
Bottom line: the teachers here are quite aware that basic programming skills are necessary and although they do not force the students to acquire them, they still end up learning them.
http://www.moonlight3d.eu/
I know Matlab has really low (or no) cost for educational use, but could you guys please switch over to GNU Octave (matlab clone) or SciLab/SciCos (similar but different & has a Simulink equivalent)? That way, after school people can keep using low cost tools in industry. My department spends a ton of money for those tools simply because the people who make decisions don't know about good/cheap alternatives. And guess where these guys learned Matlab. Yep - back in school.
You're right, it's mostly the program flow/control issues that are needed in programming. Most interesting problems in physics require computers to solve, and so a good understanding of LOGIC is needed; once you know how to iterate with loops and use if-thens, its somewhat trivial to do so in any language you see fit. After that, you can focus on numerical routines for integration, differentiation, etc. Once they understand the basics, helping them to learn to use libraries (GSL? keep with the open source!) to tackle more difficult problems may be the best for undergrads.
My university required an introductory software design course, which was one of those more theoretical things that covered the logic and design methods, and not so much a specific language. While not required, it was strongly suggested you then took introductory computational physics, which focused more on solving differential equations and setting up general problems, as well as little things to watch out for (preventing divide by zero, etc). Again, no specific language, and the professor even allowed you to use whatever language you wanted. FORTRAN (90/95) was the default, but if you had more C experience, that was ok too, for instance.
It was also required we get some UNIX/Linux experience (apparently most of the supercomputers they used ran Linux and so they felt it was nice for us to have some familiarity with alternate OSes), so we had a computer lab with some Red Hat machines we were required to compile code on and make scripts for. In fact, it was funny, we had to scp our programming code (= homework) to the prof's computer for review, so that was another skill we learned.
Those experiences and skills really come in handy a lot for me, and I'm glad we had that requirement. The numerical methods have come in handy for certain projects in my graduate courses. Somewhat off-topic, but that class was also my first experience with Linux, and after using it and seeing it wasn't hard to use, I got the itch to try it at home when Windows started flaking out. Also, colleagues of mine, when they got jobs at various research centers, were given laptops and said "Here, use ssh to get data", and so had we not had some experience, it may have been harder to start off and get used to.
We recently had a talk here with faculty at my university about better integrating this type of stuff into the curriculum, even starting with the very first mechanics course. There are interesting equations of motion for somewhat simple problems that are tough to solve by hand, so instead of simply finding Lagrangians and calling it quits, why not ask them to use numerical routines (integrate, invert a few matrices, etc.) to solve those equations and do some sort of animation of the motion? It was suggested we use Mathematica for this reason, apparently the new version 6.0 has nifty easy-to-use animation functions --- I haven't used it yet, but if that's the case, nothing is better for developing some intuition and understanding than seeing things happen real-time.
Besides Mathematica, other faculty use MATLAB and FORTRAN and C/C++ for their actual research, so if you had to choose some programming environment, those seem the most common to me, and thus probably the best choices. Even if Excel isn't a bad choice in principle, there are so many other environments that are more powerful that I can't really see a good reason to use it.
I love all of these "reasons" for not using Excel that seem to boil down to "When I learned to program, we didn't have ones and zeros, just zeros, and were were glad to have 'em." I use Excel occasionally for fast, free-form calculations and even exploration, but never for real research. The reason is simple: it gives incorrect answers. Check out the the links here for details: http://scholar.google.com/scholar?hl=en&lr=&q=On+the+accuracy+of+statistical+procedures+in+Microsoft+Excel+97&btnG=Search This one is easy to read and gives a short, detailed list of some of the problems: http://www.amstat.org/sections%5CSRMS%5CProceedings%5Cy2001%5CProceed%5C00470.pdf
The issue at hand is the degree to which a specialized curriculum should "require" specialized skills from an outside field. This is a gray area and needs to be determined by the governing body/committee for whichever university or better yet field oversees the degree program.
;-).
:-)
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.
Back in 1974-78, all students in the University of Illinois' College of Engineering were required to take at least a semester of introductory programming. That included the Physics majors because the Physics department was under the aegis of the College of Engineering (unlike Chemistry, Biology, etc.). That this particular science was placed in the engineering school always seemed like a really weird, but good placement.
That is all.
I am a PhD student working in computational condensed matter physics. My undergrad did not have a requirement for programming - it should have. As a result, I have had to waste time catching up. The argument "they can learn it on their own" could be said about a lot of skills taught in undergraduate physics. I probably could have learned how to use an oscilloscope on my own, but I didn't have to. It was something we covered in first year lab. As a result, I know how to use this instrument properly, and the learning process was efficient. Based on what I have seen in graduate school, I think that an undergrad should learn how to use a language like C, C++, or Fortran (I'm talking about f95 mind you), as well as some scripting (bash, perl, whatever) and command line plotting tools (gnuplot for example). While environments like matlab are nice, they make it more difficult to run your codes on machines you don't own. I do a lot of this. No matter what, excel (and variants thereof) should not be promoted as an approach to scientific programming. Physics is not point and click.
1&1 - Cheap domain and web hosting.
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 spends almost no time describing any programming language. Of course, it helps that they do all their actually programs in Scheme, 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?
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.
Engineering is the art of compromise.
C/C++ is clunky, but once you know it, you can figure out most every other modern programming language.
;)
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
Yes! Programming should definitely be a part of every physicist's and engineer's undergraduate education. As a physics undergrad I learned Maple and MatLab. The last course that was required was all about numerical methods to solve differential equations. Most problems that physicists encounter are too hard/tedious to work through by hand. (You can usually guess which problems will be on the test just by asking yourself what is doable in 1 hour.) Having all the students learn basic programming allowed the professors to assign homework problems that were more in depth and we could explore topics in different ways. As an experimentalist, I rarely use my programming skills in my research, and I'm certainly not the world's greatest programmer. However, I do find value my programming training, and it's something I've found that I (usually) enjoy learning. At my graduate institution, programming was not taught as part of the physics curriculum. I have been less frustrated doing homework than other students because I have not had to wrestle with learning a new program and solving a difficult problem at the same time. Also, I was taught good programming methods. Once I was able to solve a problem in 15 lines of code when it took my friend, who was self taught, about 1 1/2 pages of code. Needless to say, my solution was much easier to follow and understand what the program did. As an instructor for a 400 level class, I get frustrated that my students are so uncomfortable using a computer to generate plots and such for their homework (even with Excel). The previous instructor for the class did the homework solutions in Excel. Yes, Excel can do the problem. But it takes me far less effort to do the problems in Maple/MatLab.
I'm a programmer that worked in the software industry professionally for a good 13-years or so before switching to science. I personally find that I'm always writing little scripts and other programs to carry out all manner of tasks. Everything from gathering data to organizing it, analyzing it, charting it, reporting it, sharing it ... you name it I do it. Now I cannot say whether this is a truly necessary function or whether it's due to my background. I am, if you will, a biased sample. It is a valuable skill, nonetheless. It saves a tremendous amount of time.
If I mod you up, it doesn't necessarily mean I agree with what you've said, sorry.
Forgot to mention... there's a reason you shouldn't give us programmers soldering irons. Did you know those things are really, really freakin' hot?! I never did get that firmware working again after that...
If I mod you up, it doesn't necessarily mean I agree with what you've said, sorry.
The chair of the physics department here at Augusta State University is definitely all for we physics majors graduating here with plently of MATLAB experience. Several months ago, I overhead him commenting how he was disappointed with the lack of programming skills with the majority of the majors. So now, MATLAB is a staple of the computational physics and electronics II courses. Prior to this change, I, myself, had very little experience with programming. But I got on to a research project this past March and had to learn MATLAB very quickly. Now, two months later, I`m working everyday with MATLAB on an Ising Model program. Needless to say, from an undergraduate stand-point, it seems that the need to code and implement algorithms will be of vital importance to future physicists.
As an undergrad in physics you need to learn about the fundamental laws that have been established before you came on the scene. I believe that, from a physics point of view, it is important to have a class that teaches about computers from the lowest level, giving a good overview of how gates are made from transistors, binary logic is implemented with gates, and how to program a little in assembly language. More specific classes on programming can be left to the computer science department and upper division classes in computational methods. I do believe that a basic programming course in the computer science department should be required for the undergraduate physics degree. This is completely separate from the question of what tool you will use for analyzing data, which is what you are talking about when you consider Excel.
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
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.
"I've got more toys than Teruhisa Kitahara."
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?
Speaking as a graduate of physics, I don't know that requiring a programming course is really that useful. I am currently working on a high energy particle experiment and most of what I do each day is write computer programs. None of my programming knowledge was gained in a class at the undergraduate or graduate level. I currently work in C++, Perl, and Tcl. The department can check with the CS department and give recommendations on classes to be taken during your undergraduate education, but making it a requirement seems a bit over the line.
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.
Ok, so I've got some sand... now what do I do?
Right, so preheat your oven to 1900 ÂC...
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.
Forty years ago, in the second semester of my freshman year, the physics prof told us of a wonderful opportunity to take a pass-fail class in FORTRAN. It was pass-fail because programmming was not really an academic subject, but, like using a slide rule, was necessary for doing physics. So, we all took the extra class in the evenings and did our homework with stacks of punch cards at 3AM just like all old-timers prattle on about.
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.
The first book I read on computers when I was 7 or 8 was sort of kids guide to the ZX Spectrum. I can't remember the name of it but it was a great book featuring the character "Speccy" and spent basically the first 4 pages explaining that nothing you could do would break speccy and not to be afraid to play around and do anything you liked which is probably the best advice you can give anyway trying to find there way around computers.
Of course Speccy was wrong and met a premature end when switching him on and yanking out his joystick at the same time caused him to smoke and shortly afterwards to die.
To the troubled new faculty member at a well-guarded institution: you are not alone. Try reading the article below. In fact the entire issue is devoted to the theme of computation in undergraduate physics. R. G. Fuller, 'Numerical computations in U.S. undergraduate physics courses,' Computation in Science and Engineering. 8 (5), 16-21 (2006)
I have also had programming (not math methods) classes in Java and IDL from a physics department. While I enjoyed them, most of the students who did not have prior programming experience found those classes difficult and uninteresting. Most physics students aren't interested in learning the details of why or how a programming language works, simply what they can do with it. The students who had taken a math methods/programming course found "regular" programming courses much more useful.
I've also had (and taught) classes with LabView. While theorists find LabView totally useless, it is by far the most common programming tool used in experimental labs. You can learn structure and flow with labview, but it's not a very useful learning "language". However, it can (and should!) be taught in advanced lab classes to make things like temperature controllers, timed electronic measurements, instrument control etc. The people who say experimentalists don't need to program are dead wrong. If you can't rig up a simple temperature controller, basic e-beam writing system or digital oscilloscope in software, you're going to be wasting money on hardware you didn't need to buy.
I've had to teach lab classes where the students were forced to present the data in Excel, and that was bad enough. Good luck finding a graduate student in a physics department who's willing to teach VBA and Excel well enough to do anything useful. Use of Excel as a programming platform is not as common as your peers think. I would try very hard to get them to move to something like Origin or Igor, which are much more powerful, produce better graphs and actually ubiquitous.
There is a fairly well organized group of physicists in the states that is promoting computational methods as an integral part of a physics undergraduate curriculum. There will be a working session at the Winter AAPT meeting in Chicago next February. Also take a look at the special issue "Computation in Physics Courses" of Computing in Science and Engineering (Sept/Oct 2006) to see what some other programs are doing (disclaimer: I wrote one of the articles). Also, the American Journal of Physics recently (April/May 2008) released a double issue in "Computation and Computer Based Instruction" with lots of information in it (especially the resource letter by Landau). As it happens, Landau, Jan Tobochnik (editor of AJP), and Norm Chonacky (editor of CiSE) are all part of the AAPT working group.
My school requires a course in computer methods as a part of the physics major, and I have been afforded a very recent opportunity to observe traditional-aged fellow students while taking this course.
Such a course is essential. While students at our school are introduced to Mathematica as part of the calculus sequence, this exposure is cursory and is only interactive; it does not require actual programming.
My computer methods course was a first presentation for its lecturer, and arguably was a bit too ambitious in breadth. We had programming assignments in Mathematica (both procedural and rule-based), and interactive and programmed use of GNU Octave (Matlab clone). We also were required to write a program in C/C++.
Throughout the class there was an emphasis upon learning and writing documents in LaTeX, including a considerable amount of equation-writing. We also used the old Bell Labs Graphviz "dot" program, both as an arcane and slightly bizarre introduction to programming per se, and to generate graph figures for inclusion into the reports written in LaTeX.
Adding to the confusion from breadth is the fact that one professor, for his optics class, prefers and supplies his examples in Mathcad.
I believe that it's fair to say that most students found this class to be a nearly excruciating experience, which is an indication that it had worthwhile and challenging content. The breadth and pace of presentation needed to be reduced a bit.
Out of the 10 or so students in the class, only I had any previous programming experience. I found the work load challenging, more in the underlying problems than in the technical aspects of writing code. By contrast, at most one of the other students had previously used any text editor apart from Word, or were aware of TeX/LaTeX.
The course had some challenging conceptual content (e.g. generating attractor maps by iterative solution of cubic equations with starting points gridded across a region of the complex plane) as well as fairly extensive technical content.
I will admit a pathological allergy to Excel, with the exception that it is somewhat handy for graphing and doing simple regression fits. I am glad that this course did not spend time on Excel.
Again, this course needed to be recalibrated downwards a bit in breadth of topics. Numerical stability and precision effects were only briefly mentioned, but did benefit by a good example or two.
There is no way that a semester course could approach both the extensive technical topics, and actual numerical analysis. That needs to be a separate course.
Also missing from this course was any coverage of experiment automation (which usually means LabView). This is another important topic, but there simply is not time in a semester to cover it alongside everything else.
At least two of the students gained some enthusiasm for LaTeX as a result of this class, and have used it to write assignments for other classes.