Stories
Slash Boxes
Comments

News for nerds, stuff that matters

Slashdot Log In

Log In

[ Create a new account ]

Programming As a Part of a Science Education?

Posted by Soulskill on Thursday May 29, @07:58PM
from the part-and-parcel-of-the-information-age dept.
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?"

Related Stories

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • CMU (Score:5, Interesting)

    by allanw (842185) on Thursday May 29, @08:01PM (#23594163) Homepage
    The introductory physics classes at Carnegie Mellon use VPython [vpython.org] to run some simulations. It's pretty simple to use and intuitive. The textbook [ncsu.edu] makes use of it too.
    • Re:CMU (Score:5, Interesting)

      by cashman73 (855518) on Thursday May 29, @08:32PM (#23594459) Journal
      I'm currently working in the computational biology department at the school across the street from CMU [pitt.edu],... A lot of people don't think of "programming" and "biology" in the same sentence, and most biology programs are the last science programs that would even think of requiring programming as a prerequisite for graduation. However, once you get into the more specific structural and molecular biology fields, you almost can't escape programming. Almost on a daily basis, I use perl. Most of our software is probably coded in C or C++, and some of the older software is coded in Fortran, though that's not as common anymore. Some people in our department have been doing some stuff with Python, too, though I personally haven't. There's also quite a few genomic and database applications where SQL will come in handy for the database work, and an increasing amount of computational biology projects are coming online with web interfaces, so PHP could be useful.
    • by DancesWithBlowTorch (809750) on Thursday May 29, @08:58PM (#23594677)

      My university is in the US, but how is this handled in other parts of the world?"
      I studied physics in Heidelberg, Germany [uni-heidelberg.de]. During the first half of my first year (about 6 years ago), we had introductory courses in C (they liked to call it C++, but it really was glorified C). In the second half of the first year, there was a "technical informatics" (read: Hardware design) course, which involved every student designing a little 16bit chip which could decipher the DCF long-wave time signal. That part used mostly C, but had some bits were we had to gnaw through Assembler.

      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 .NET (I know, it sounds crazy. Please try it out before you flame. Visual Studio is certainly the best (maybe the only good) piece of software Microsoft ever made). But I'm a theoretician, so my focus is on being able to rapidly change my code to incorporate new ideas. Experimentalists, who mostly just want to control their machinery, need to know more about Fortran, C, and on the high-level side, LabView and MatLab

      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.
        • by LihTox (754597) on Thursday May 29, @10:54PM (#23595561)
          A word of warning about Mathematica, Matlab, Maple, etc: they're great when you're a student, but should you find yourself between jobs (e.g. teaching part-time while applying for tenure-track positions) for very long, you may be cut off and you won't know what to do. (Speaking from experience here.) This might not matter to an experimentalist who can't do research outside of a lab anyway, but for a theorist like myself it has been crucial that I be able to use open-source software (and therefore know how to do numerical integration, gradient searches, etc) so that I can maintain a research program, keep publishing, and not drop off the map professionally.
    • Re:CMU (Score:5, Insightful)

      by stephanruby (542433) on Thursday May 29, @10:22PM (#23595333)

      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.

      • Re:CMU (Score:5, Interesting)

        by somersault (912633) on Friday May 30, @03:46AM (#23596911) Homepage Journal
        Yep - one of the engineers at our company used to work for Rolls Royce in the 70s, and at some point was a professor at Aberdeen University. He used to use FORTRAN, possibly some other languages too, but basically at the moment he does most things in excel (I think he likes Matlab too but the stuff I've seen him do mostly involves Excel). It seems to be pretty powerful, and good for easily graphing results from large datasets, etc. I've been doing work converting a couple of the engineer's hydraulic simulation spreadsheets over to Delphi (so that people other than the engineers can use the calculations, and can't see or change what's going on behind the scenes, since these spreadsheets are simulating what the tools we build can do, and they don't want our competitors getting too much information). I can definitely see the attraction of doing calculations on large datasets the Excel way - or rather, the 'spreadsheet' way, since Excel isn't the only spreadsheet system, just the most common..
  • Necessary Tool (Score:5, Interesting)

    by MicktheMech (697533) on Thursday May 29, @08:06PM (#23594203)
    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.
    • Re:Necessary Tool (Score:5, Insightful)

      by the eric conspiracy (20178) * on Thursday May 29, @08:41PM (#23594545)
      I think you have made the case for an applied math course in numerical analysis that contains about 2 hours of class lecture time in computer applications.

      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.

    • by davros-too (987732) on Thursday May 29, @09:01PM (#23594703) Homepage
      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.
    • FORTRAN? (Score:5, Insightful)

      by EmbeddedJanitor (597831) on Thursday May 29, @10:44PM (#23595493)
      Want to crunch numbers, then Fortran is better than C. Even Java is better since it gives stronger type checking. Python is probably good too (but maybe a touch slow).

      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.

        • by s4m7 (519684) on Thursday May 29, @10:12PM (#23595259) Homepage

          It's actually one of Microsoft's better products.
          I'll grant that Excel is really quite simple and flexible. However it has some serious drawbacks when compared with something like SPSS [spss.com] when it comes to the management (and analysis) of actual data. like how sorting can be limited to one column and botch all your data. Like how data types aren't strictly enforced. Like how a single sheet can be only 256 columns wide or some such nonsense. (maybe they've fixed that since?) Excel is a toy when it comes to serious manipulation of data, and if you don't agree, you haven't actually done any. I was a data processor at a market research firm, and they seriously expected me to combine and normalize 20 different international datasets (60k+ records with ~350 fields) in Excel. Were it not for SPSS, I would have lost the scant scraps of sanity I have remaining.
  • by smolloy (1250188) on Thursday May 29, @08:09PM (#23594245)
    As someone with a physics doctorate, I am appalled to hear physicists suggesting the use of Excel for real scientific studies. What are those physicists going to do when faced with (for example) particle physics data stored in C++ objects? Or face a control system dominated by Matlab? Or are handed a simulation package built in Fortran?

    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.....

    • 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.
    • by hubie (108345) on Thursday May 29, @10:06PM (#23595229)

      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.

      • by udippel (562132) on Thursday May 29, @10:26PM (#23595357)
        I know Matlab has really low (or no) cost for educational use

        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.
  • by sirwired (27582) on Thursday May 29, @08:11PM (#23594267)
    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
  • by overshoot (39700) on Thursday May 29, @08:14PM (#23594285)
    Preface: I started out on a physics degree almost forty years ago but ended up with a CS. Meanwhile I have two children majoring in physics, and when I retire I plan to go back for the MS physics just for the Hell of it.

    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.

  • by Average (648) on Thursday May 29, @08:16PM (#23594303)
    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.
  • Matlab (Score:5, Interesting)

    by KalvinB (205500) on Thursday May 29, @08:21PM (#23594355) Homepage
    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.
  • Matlab/octave (Score:5, Insightful)

    by drolli (522659) on Thursday May 29, @08:21PM (#23594363)
    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.
  • by billstewart (78916) on Thursday May 29, @08:26PM (#23594399) Journal
    There's a certain extent to which students need to learn basic tools - I'm surprised to hear an assertion that they're already familiar with Excel but they should learn to use spreadsheets, because they're really convenient for many kinds of problems, just as (ahem) slide rules were when I was in college (and calculators were beginning to be, and PDP-11s were.)


    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.

    • 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.

      ...Of course it took forever to run a generation.

      ...And it was insanely complicated and wierdly convoluted.

      ...But he was able to demonstrate his mental capacity for having been able to visualize this arcane solution in the first place...

      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:Science majors (Score:5, Interesting)

        by arb phd slp (1144717) on Thursday May 29, @09:00PM (#23594699)

        I think even non science fields could benefit from having some basic programming course requried to graduate. like a quarter of haskell or something.
        Programming?? You're shooting too high. I'd settle for using the right app for a given job.

        I know this is going to confirm every bad stereotype the /. crowd has regarding social scientists, but the researchers in my program think I'm some kind of hacker genius because I can get Excel to sum a column and make a pivot table. The last project I got assigned to was keeping the raw data in Word tables.

        Maybe next semester I'll do a research colloquium on SQL and basic database construction.