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.
When I went to University to study Biochemistry you were required to do work on the computer (used as a tool including programing) but you used your own time to learn programing as you could have ready access to a computer. As the access to the labs was very limited it was a much better use of University resources to limit the formal education to the science at hand.
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.)
Programming is essential to the sciences. Having trouble with languages like C++ or Fortran I have found that graphical programming (e.g. LabVIEW) has worked well for me.
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.....
Iowa State's Physics department doesn't require any programming course. It's just sort of assumed that you'll pick it up on the way
As far as using a language for computation is concerned, I've always felt that Mathematica is a powerful tool (great programming functionality along with the built-in math & physics functions makes it a logical choice. Along with the $50 student price tag).
You may argue that Mathematica isn't a true programming language, and I'd agree. But it gives you everything you would need for computational physics.
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
As a mechanical engineer with a minor in physics we were required to take C programing (shortly after my class they moved to C++) as a first semester sophomore. About 4 other classes required us to activly use the programing to solve problems for class.
That was 8 years ago. I can tell you the one skill i use the most from engineering school every day in my carrier is the problem solving and analitical analysis of problems. It also taught me that if i didn't create the solution to the problem and merely relied on some generic output from some other 3rd part program, i am suspicious of it. (a reason the science and engineering world likes open source software)
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,
Its perhaps a bit Stats-oriented, but I do my data analysis in R (http://www.r-project.org/). Its free, syntatically similar to Scheme (so it teaches programming concepts), runs just about everywhere, and has good extentions to do data analysis. From its FAQ: "R is a system for statistical computation and graphics. It consists of a language plus a run-time environment with graphics, a debugger, access to certain system functions, and the ability to run programs stored in script files."
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.
While MATLAB can be a bit quirky as compared to C++/Java, it's an invaluable tool for engineering and simulation related work.
I'm a pretty competent CS/EE guy so I could just as easily be doing everything in C, but whenever I'm running simulations for signal processing or approximating systems my first instinct is to go to MATLAB.
For Physics students, it would be _nice_ to learn all about memory and objects, but if they want to be useful in an experimental and simulation sense, they really ought to just learn MATLAB... it was designed for all that anyway...
I'm currently a student doing a combined comp sci and physics program. Prior to this I have six years of experience with computational modeling in a professional context.
Very often when doing something I will first "draft" it out using an excel model. If I get a result that warrants more accuracy THEN I switch out of Excel - or sometimes just refine the spreadsheet.
While I certainly don't agree that an education in Excel can trump a few proper comp sci courses, it's not entirely useless.
...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.
Word. I've used it and with combined with VBA with access to pull datasets from a database, it can be quite powerful, and do exactly what you need it to. In my case, it was handling scheduling for a 40,000+ student university. The datasets pulled easily ran into the millions of records.
Do not downmod posts "overrated" simply because you disagree with them.
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
Even better than open office.
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.
When I was an undergraduate at Portland State University (Oregon USA) in the late 1970s, a semester of programming was required for us. In Fortran. Using punch cards. One card per line of code.
I managed to take the course about three times (like most classes outside my major) before passing. The first time was with a Chinese Grad student teacher. We didn't even have a textbook. He recommended that we buy the Donald Knuth series of books at about the cost of fifty hours of minimum wage work. No chance of that. I lasted about three classes. With any luck this guy is destroying the Chinese educational system.
The second class was with a computer technician who used what must have been a service manual for a mid 1960's 'big iron' mini-computer as a text book. I read the first two chapters about twenty to thirty times and still got nowhere.
The third class in Fortran was with a textbook that was actually clearly written in English. Programming is not hard when explained clearly and fluently. The class was about two-thirds women from the Middle East. I nearly choked to death on their perfume every class but I was able to 'learn' Fortran enough to write about twenty assigned programs that had about 30 lines each. Boy, the machines that punched the holes in the cards was loud! We would bring our deck of punched cards to the operator's window. They would run the program in a big batch with all the other student work. A few hours later, we could pick up a printout of the results. One little pissant mistake and the whole process would have to be repeated. CompSci for non-CompSci majors in the 1970s.
I bought my first microcomputer in 1984, a Radio Shack MC-10. Learned BASIC. Then mastered assembly language on the Commodore 64. Then Turbo C on the PC-AT 286. Then Visual Basic on the Pentium. Now I do assembler for Atmel AVR and C++ for the ARM. I believe that object oriented programming, like FORTH, is the product of a sick mind. But I do firmware and don't believe that any serious microprocessor should cost more than $2.50 US, which puts me into a limited subcategory of the programming community.
Tell us about your programming experiences in 'school' and your best training. Especially if you live outside the USA. Thank you.
... for physics majors to be required to learn programming. Programming is simple for physics majors, and they'll pick it up just fine on their own.
The psychology dept. likes me more for the science/programming background than any psych courses I've taken. Experiments have to be coded, data processed, etc. and having a student who has some background in coding is a big plus. I rec python 'cause it's an easy language that can handle pretty much anything a psychology student needs-but really any language would work, and I know some people in the dept. who like working in C/C++.
open source modern art: laser taggi
Seriously, don't they teach matlab/scilab in the modelling/statistical courses anyway? It's ubiquitous, free and purpose-designed.
Excel is awful - I use it at work and I hate it because it isn't built for experts.
Maple is also handy for the math.
Programming is an important part of a theoretic program or simulation program. Many undergrad programs are so general they don't give much focus to programming.
IMHO, all natural science, applied science, and engineering students should have some level of training in programming.
I would point out that Origin Lab is basically the same as Excel except that it has higher math functions available. Anytime you are using large data sets, you could certainly write your own programs to manipulate the data. However, what is the point of reinventing the wheel?
Much as I like some open source programs, they are not a panacea. The open office equivalents of Powerpoint and Excel are simply not as good as the original programs. Have you taken the time to use Excel and Powerpoint extensively?
As for the larger question of programming, what part of the physics curriculum would you give up in order to add a programming class? Undergraduates have to take about 60 credits or courses to achieve a physics or chemistry major whereas a liberal arts major, like English Literature, only requires 30 credits. How are you going to justify an additional requirement? I think that may be a bridge too far.
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
I graduated with a Physics BS recently and agree heartily that programming should be part of the physics curriculum. By not teaching programming you're depriving students of the ability to conduct sophisticated numerical experiments required to gain intuition for cutting edge problems. Not to mention programming skills puts you a step above cleaning glassware when you start doing 'research.'
I actually have experience using Excel for programming. I was never exposed to programming languages in middle school and instead started writing basic cyphers in Excel. I can imagine one could do some basic research in that environment and it offers a convent format for data entry BUT THAT'S IT. Now that I know half a dozen languages, I would never go back.
As far as preferred languages, I can recommend what I learned: a mixture of C, C++, and Matlab/Octave. I generally prototype in Matlab and if performance is too slow, drop into C/C++. I've also learned MPI and PETSc but haven't found occasion to use them in my research to date.
One final note. Any teaching of programming should be coupled with linear algebra and numerical analysis. Far too frequently I see students use very naive algorithms in their thesis work. One that particularly sticks out in my mind was a student using a rk45 algorithm to solve a 2D boundary value problem (shutter).
Good luck with the committee.
(P.S. My school required an intro to programming in Matlab, but no numerical methods courses for the Physics BS.)
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.
I'd like to make the point that physics majors are going to come in with VASTLY different levels of programming skill-- much more variation than in mathematical background. Some will have never programmed at all, while others may have programmed professionally. Any requirements you set up should take this into account: a placement exam of some sort is what I have in mind, although it could be relatively simple: "Have you programmed before? Do you know what a loop is?" etc. Even the simplest programming skills would be enough for students to get started, but you want to filter out those with ZERO aptitude so you can get them started before they actually need it (or before they've enrolled in a computational physics course
I am a physicist, and I learned how to program in BASIC when I was 8 or so. I took a class in Pascal my freshman year in college, and from there I learned what programming I needed as I went along: Mathematica as an undergrad thesis student, C as a graduate student, and C++ recently. It was possible to pick it up as I went along, given my background... but on the other hand, I was a third-year graduate student (doing hydrodynamics simulations for a professor who knew very little about computation) before I heard the words "Runge-Kutta" or discovered the inherent flaws in forward-Euler integration, so in retrospect a computational physics class would have been very useful indeed!
If they need to program to do their work, they need to learn to program. If they don't, well then, they don't.
If they need to know the conceptual basis, they can get that from math (which physics students get plenty of) or in a more explicit form, from a course in logic. These prepare one for programming by teaching those concepts and so already serve the purposes of background material. If the students needs training in the thinking process, these should do, or else they're not doing their jobs.
Teaching them to program without an explicit need for it is just putting up hoops for them to jump through. I hate hoops. I always hated them as a student, as most I'm sure most students also do, and I hate them as an educator as a waste of time better spent in more profitable work.
Another source of training in the orderly thinking required comes from teaching/learning methodology. What math doesn't cover, language does, and this is where it happens. Experiment design is programming of laboratory methods, including choice of the necessary math involved. If they graduate without being able to do this, they're much farther behind the curve than if they simply can't write a computer program. And if they can, then they know the thinking process.
People used to complain that handheld calculators would cause a loss of mathematical ability because people wouldn't bother to learn what button pressing could accomplish. Asimov rightly replied that the math would still be required to know what buttons to push. I reply that the complainers, Asimov, myself and virtually all reading this can't calculate things like the 7th root of a 9 digit number with arbitrary decimal place without very easily a calculator, yet virtually no one can write a program on a calculator to do these things which are already built in. And still no one decries the lack of programming education for handheld calculators.
"I may be synthetic, but I'm not stupid." -- Bishop 341-B
I'm a physics undergraduate and my research is computational, so of course I think programming proficiency is a wonderful thing to have. But many physics students and professional physicists never use it. I've found C++ to be the most useful, though a grasp of at least one common computer algebra system is also necessary. Avoid Maple. Also, many professional physicists have a terrible grasp of computer science. I can tell this even though I'm mostly self taught. Many physicists still think FORTRAN is great. This could be largely an age thing. Probably physics students should just go to the computer science department for electives if they want to learn to program.
Simon's Rock College
It seems to me something like MATLAB would be much more appropriate. MATLAB is designed for numerical computing, and has a programming language that allows for easy manipulation of vectors and matrices and creation of graphs. Lots of common functions that would be useful for physics are built in.
The low level details that computer science students should be concerned with, like the internal representation of a matrix, are things that most physics students probably don't need to worry about.
Here in the UK its a standard requirement. Certainly at good unis (Oxbridge, Bristol, Manchester, Imperial, St Andrews).
At Imperial, they teach C in the first year (dressed up as C++, but mostly avoiding pointers + OOP). Standard 'big' project is a simplified double pendulum, numerically integrated & used to investigate chaos.
The second year sees OOP introduced rather counter intuitively via a HEP-orientated labscript. I don't like this second year script one bit, as it teaches the 'kids to program stupid access functions that never get use and build an enormous 500+ line cathedral to eventually do a calculation that could be written in three 5-line functions.
In the third/fourth year there is a computational physics option, partly lectured (FFTs,linear algebra,numeric integration,monte-carlo/Metropolis, lots more I've forgotten) and two bits of lab coursework (metropolis model of magnetic domains, solving a simple tight-binding model electronic structure with matrix method... others I've forgotten). Code can be written in any language, though most people keep on using C(++).
Other than the 2nd yr OOP via heartache, I think its pretty good.
I believe Oxford trialled using python to teach their course. You might even be able to google down the handbook.
That said; there really is room for teaching people basic data mangling (+ gnuplot scripting?) in the aim of training experimentalists to analyse their data. Its heartbreaking to watch PhDs struggle with origin to handfit things that should be batch scripted (with provisos to avoid certain areas of data from fit etc.), or hand edit a 1000+ line file of data in Notepad to cludge it into a binary-only analysis tool.
Given the vagaries of university curricula, not to mention the ever-present inter-departmental fighting and politics, I'm not surprised that would be a lot of science departments that would not require a programming class of some kind.
..bruce..
Which is not to say that they shouldn't. I note that my own alma mater (Brigham Young University) has a required course in 'Computational Physics' for all Physics majors, but that is primarily solving integrals and differential equations using MAPLE.
Bruce F. Webster (brucefwebster.com)
I did a Physics undergrad in the UK about 10 years ago, so I can give you one overseas data point.
They made us learn FORTRAN77 (shudder) for one semester, but it honestly wasn't used much in the curriculum beyond that class. I did a bunch of programming outside of that because my senior (third year...same thing) projects were entirely theoretical, but that was entirely self-taught...there was little to no formal system for getting students into serious programming.
For an undergrad curriculum, I'm not sure you really do need programming. For grad work, or for some of the advanced theory, you *definitely* need it.
The question is, are you aiming to teach just the science (which doesn't really need programming to be understood, let's be honest), or are you aiming to prepare students for research/grad school (where they will definitely need it)?
The real question is, what are you going to remove from the degree in order to put in the programming requirement? Or are you going to make an already requirement-heavy degree program even more stuffed?
I have a Ph. D. in Chemical Engineering and am from the old school -- I got my BS in 1973. I cannot understand a university who would allow graduates in science, math or engineering to not have some background in programming a general purpose language like Fortran, C, Python, etc. My preference would probably be Python, but I'm not going to get too excited if it was another mainstream language. Python is ubiquitous and easy, and after you have learned Python (or other general-purpose language), whipping up some VBA to automate an Excel sheet will not be a problem.
When I was an udergrad you were not considered an "educated person" unless you could speak a foreign language and I had to demonstrate a "reading abiltiy" of a foreign language for my Ph. D. You could argue that in the 21st century programming is at least as important as a foreign language. I have used the Fortran I learned as an undergrad a hell of a lot more than the French.
I wasn't a physics major myself, but I did know several in college (graduated five years ago), and they all had to do some amount of programming; if not for actual coursework, then for their summer research assistant jobs. As I recall, Fortran, Matlab, and IDL were all used, probably C as well. I don't think actual CS courses were a requirement, but I know that many of them took at least an intro CS course anyway. My take from this is that while it may not be necessary to require students to learn programming, they're pretty much going to have to do so one way or another.
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.
C, FORTRAN, Matlab
Latex is a plus
First, equation solving. This means numerical integration, root finding, and so on.
Second, spectral methods.
Third, numerical error. What does it mean for a numerical calculation to be ill-conditioned?
If they start out without the skills needed to write a trivial program, the physics department should not have to teach them. Don't people learn that much in high school?
The most important thing is the hardest to teach in a course of limited scope: writing readable, maintainable, debuggable code. Most scientists suck at this.
What language? Something that graphs! Something easy to debug (they don't need to spend their lives chasing one-off indexing errors). Good languages with OSS semi-equivalents are Matlab (Octave) and IDL (GDL). Is a spreadsheet appropriate? I don't know enough to say. If someone learns on a spreadsheet, will they be able to more-or-less understand a piece of code in F90? I also object to forcing people to purchase from Microsoft.
It gives the students the skill of pointing at pictures in Excel 2003 (or whatever release they use) which translates poorly into pointing at pictures in other versions of the same application and gives them no concepts they can carry to other applications or programming languages. Everything else forces the student to consider each action in such a way that it can be presented in several ways.
A good teacher could use macros to teach programming concepts but I suspect most students would merely be left with the memory of pointing at pictures with a mouse. If they are forced to do it as text the syntax they remember will be of very limited value as VB changes in very major ways (basic -> pascal -> java) every few years and there will be Excel specific behaviour.
It would even make more sense teaching them how to use logo.
Anyone caught using Excel for real science, other than real quick and dirty stuff, ought to have their geek card revoked immediately. Lately, I've found that xmgrace and gnuplot are great plotting programs for linux, and freeware!
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
As a computational physicist my answer is probably biased, but I see programming as a fundamental tool one has to learn in the Physics curriculum.
As an undergraduate (in Spain) I had two courses devoted to numerical methods, with practicals in Fortran 77, and at least two more where coding was part of an optional practical. Then I had a PhD-oriented course about Fortran 90. At times I wish I had been introduced to C/C++, but switching languages is very easy compared to learning the first one. I did my PhD (in the UK) on Computational Physics, and now I'm working as a postdoc in the same field.
But regardless of whether the student uses programming as a tool afterwards or not, learning programming means learning different ways of thinking. You learn that problem-solving is a matter of dividing a complex task into trivial pieces and putting them together, and you learn to express your ideas into a strict language. This broadens the student's capacity to pose and solve problems, which is what Physics is all about.
The state you are in while your HEAD is detached... - wait, what?
If a scientist can't program they are extremely limited in what they can do. Not only is it impossible to do original work, it's not even possible to keep up with the state of the art. I'm continually amazed at colleagues who can only do what the commercial packages they use offer which is usually 10 years behind the literature and all too often wrong to boot.
BTW most of my exploratory analysis is done w/ awk & gnuplot though I can change to octave, C or FORTRAN in an instant if needed.
rhb
I don't see a correlation between a Science degree and programming. I don't see Biology, Chemistry, or Physics majors needing or necessarily gaining anything beyond an understanding of logic. Engineering and Math majors might be good candidates, or any other science type that saw a potential job in Information Technology and the degree as a way in. OTOH I have known several people with degrees in Physics, undergrad and grad that work as programmers. That said, unless a person KNOWS that they will not be working as Physicists, I don't see programming as being an integral part of the curriculum. Of course it does not hurt anything, I just believe it should not be required. There are already enough things required that are never used after graduation.
--Cally
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? ;-)
Well, in my engineering physics classes we were put through lots of different programming regimes, ranging from: Excel, Matlab, and also NI Labview and C for collecting and processing data directly from sensors. They were all very different, but the emphasis was always to be able to graphically plot and present your data repeatably and consistently to others. If your students won't be able to do this, they will have to rely on others that can... and frankly you don't want to put them in that position. And even if they are in that position, they'll still have to have some rudimentary understand what the programmers will be doing with their equations and algorithms downstream.
On the other hand, the pure physics courses I took rarely needed anything more than a nice calculator - they were much more algebra and calculus dependent.
To support your arguments on expanding upon Excel, it might be fine for doing basic statistics but any "real" number crunching for analysis will be qualitatively different using just about any "real" language, and it's important to get your students to be able to think a little different. For example, they ought to know how to operate on variables and matrices rather than cells and cell ranges. Plus, it's much easier to show your work.
These days I'd recommend Python... in particular look at the SciPy and SimPy packages, which both have very good tutorials on doing very interesting things.
It ought to be a requirement in many technical/nontechnical degree programs methinks. Either that, or a choice of programming/math/logic/statistics/mixture of them. Visual basic is a dumb language to teach programming with, but one shouldn't get bogged down debating about what language/programming paradigm should be tought, etc. That might depend upon the student's goals or the particular major. The trouble with most of the pure sciences is that the typical student won't have a clue what to do with themselves after they earn their Batchelors unless they intend to go directly into grad school. The other thing to remember is that for physics, you should be very good at all forms of math and familiar with electronics.
I just want to second this. Both universities that I have attended have had a Numerical Methods class taught in Matlab, and that class is fantastic for scientists and engineers. On one hand they learn all the fundamental, theoretical issues related to approximating calculations on computers, and on the other they learn a practical, industry-standard tool that they will use for the rest of their careers.
During my undergraduate I had issues with them teaching a proprietary language, but with the phenomenal progress that the Octave team has made in the 3.0 release, that simply isn't a concern anymore.
If you are going to have them take one class on programming this is it. If they are taking two, then they should learn C as performance still counts very much in this area.
In my first year at the University of York, we had to learn Maple and had an optional FORTRAN 90 course.
Computer science students seem to think that FORTRAN is funny in some way...
# cat
Damn, my RAM is full of llamas.
Our university taught Matlab. It simple enough to learn, has good library support.
dominionrd.blogspot.com - Restaurants on
University scheduling with Word and VBA? That's nothing. I used Timex Sinclair BASIC to pull records from a database and used the results to navigate and control a nuclear submarine! The costs easily ran into the billions of dollars.
End joke. Please, end joke.
You can use assembly language to teach all the things the fine physics teacher needs but it's not practical. It will take a long time to teach, be a nightmare to grade, be system dependent and it teaches students nothing about the tools that people actually use for physics. Those libraries are written in fortran, C and have thousands of man years worth of testing in them. You should teach what you use because that's what you know and that's what you think is useful.
I am a name troll of Westlake. Visit my homepage to learn why.
I seem to recall from the MSOOXML debacle that some of the numerical routines in Excel are based on incorrect definitions. I don't think I would suggest it for analysis of experimental data without some testing of the routines to be used.
I think it is much more important as a Physicist to be facile with math, hence my liking Mathmatica. It is very important that I can set up some DiffEq to represent my problem, but at least for me I need the help of something like Mathmatica to do anything beyond a simple harmonic oscillator. My limited (and ancient) experience at SLAC and LANL is the FORTRAN library is already written in most cases, and if it is not you still want to use FORTRAN if you want to run on a fast computer - Cray X-MP last time I did it.
And I say this as a professional programmer fluent in C++ and Java.
Ok, now I understand why NASA guys have so many troubles...
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.
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.
Computer programming is HARD. In fact it is so hard and difficult that I wouldn't force incoming students (in general) to take a programming class. Yes they should know how to work a computer, email, internet, etc. A specific degree, like Physics? How important is iit that they write their own program? Would it be easier to use prebuilt software? Excel IS a useful and powerful tool. Is your blood boiling because it isn't open source? In general Excel is fairly easy to use, and does allow one to focus on the science. The kids took Physic to learn physic, not to become computer scientists. Later in life if they need a more powerful language, they can hire a computer scientest.
I'll preface this with saying that I'm currently at the AGU Joint Assembly -- but I'm not a scientist. (I'm in information science, not physical sciences) I'd actually say that we're getting to the point where I could actually see that it's quite possible that future scientists might not need to learn how to program.
Now, there are going to need to be scientists who can program, but there were plenty of scientists in the past who couldn't program -- coming up with the theories and thinking about their given discipline in new and interesting ways are more important. Knowing how to program might make the scientists think about the problem in such a way that it fits within the given language -- and it might bind their hands, keeping them from thinking as freely about their disciple. (and that being said, you'd have to go to a completely non-number crunching educations system, where even spreadsheets aren't used).
But, there's another aspect -- all of the scientists I work with can program -- but to significantly varying degrees. Most of them don't keep up on the languages, so they're still writing Perl 4 code or IDL, Matlab, Fortran, whatever it was that they learned during grad school, and don't use the majority of the features of the language. If they learn a second language, they'll probably still write it as if it were their first language. (ever seen IDL code written in Perl? It's not pretty -- imagine pre-initializing the size of your array, rather than using 'push'.) In many cases, it may be better for scientists to have a pool of programmers to assign jobs to, sort of like the old secretary pools.
Also, if everyone knows how to program, they end up making their own solutions to every problem they run into, rather than looking for existing solutions. I just spent most of the day in session on data informatics, with people talking about how they're trying to get scientists to work to common standards, so that we can share data, and ultimately make better use of it. We won't need every new experiment to write all new visualization tools -- you make your data set, you register it with a federated data system, and you can plot / generate movies / whatever to your heart's content. With some of the new semantic systems being built (eg, SESDI), we're getting closer to that point.
That's not to say that there won't be a need for scientists who are programmers, or programmers who are scientists, I'm not saying that I don't think every scientist needs to be a programmer.
Build it, and they will come^Hplain.
I think the bigger issue may not be what language is taught but whether the teaching is applicable to actual scientific uses. As an undergrad astro major I took two CS programming classes, Fortran and PL/1.
While Fortran was the standard when I went into graduate school doing particle physics, it was not as helpful as one might think because of how it was used - learning how to do bubble sorts is nice, but not when you needed to interact with actual hardware, like NIM and Camac crates.
Similarly, when we were building the computer farm to process the data we brought in a sysadmin who just got her MS degree. While she knew a lot about OO programming, she could not swap a drive out of a server.
So what might be useful is providing some general background knowledge of programming methods, system admin, and hardware. One can then learn whatever specific language when needed, etc...
Eric
Eric Aitala
www.f1m.com
Not all physics students are geeks. Indeed, not all science students are geeks, though the non-geeks do seem to be the minority.
If you haven't been down-modded lately, you aren't trying.
Sacred cows make the best hamburger.
Scheduling isn't scientific data. Excel doesn't have near the precision or consistency that's needed to really work with it. I have numerous examples from my work with just product data of Excel screwing up interpretations of data. I really wouldn't trust it with significant data.
My blog. Good stuff (when I remember to update it). Read it.
Have them learn Fortran. It's easy to pick up and well suited for number crunching. It would be useful for them to learn simple constructs in their first year and be required to solve some problems with it.
Later they can be introduced to C. It doesn't really help them understanding physics, but you can give them an appreciation of how the computer manipulates data and how tuning your algorithms i.e. considering things like cache and stride, can make intractable physics problems solvable.
Lastly, they can learn Matlab since QM is all matricies. I say Matlab last because I think the students will learn more if they actually have to work with the nuts-and-bolts of their first algorithms.
"I must admit that when I hear such arguments I cannot have a rational discussion and my blood nearly boils"
Then your first order of business is to calm down. This isn't religion, and it's not a life-and-death situation. You're not going to accomplish anything if you stress out when your colleagues are making real arguments. (And if you say "toys rather than tools" you're not helping. It's possible to do great science and engineering with lousy tools.)
Have you calmed down yet? OK.
Figure out what you want students (or rather, graduates) to be able to do, and list why Excel fails at this. For example:
- be able to compute something on Linux (or a Mac or Windows box which doesn't have Excel)
- inspect the methods they're using
- compute something at greater than the CPU's default precision
- use complex numbers, or rationals
- load data from an arbitrary text file which random digitization device dumped on you
- deal with a dataset which contains 66,000 numbers
Perhaps give a homework project which is really hard in Excel, but really easy in Python, and then have an extra class showing how to do simple things in Python.
But I wouldn't worry about it that much. Is it important to be able to do this if you have a science degree? Maybe, maybe not. Just a couple years ago, it wouldn't have mattered, and it's not like science itself has changed *that* much. A degree (in science, especially) is about teaching yourself to learn, and not a specific set of techniques or technologies.
So long as its not fortran, you're in good hands.
So long as its not fortran, you're in good hands.
http://thepoliticalgeek.com/blog/ Politics for Geeks.
I don't agree with the assertion that a physics major should be required to take a programming class.
There is little doubt that knowledge of computer programming would be valuable to any science or technology major. But it's one tool among many and depend on what they do with their degree, it's a tool that might go to waste.
As a CS major, my time an energy in college was wasted with several math courses that I hated and have never, I repeat never used. Had I gone in to a different kind of software development they would surely have been valuable. But I didn't. And I'll never get those hours back.
Requirements are for subjects that EVERY graduate will need. Not just some.
Moderating "-1, Disagree" is simple censorship. Have the guts to post your opinion.
I have a BS in CS but took a course in numerical methods taught by a joint chemistry/cs professor who also taught computer graphics. Later they added a scientific computing major and minor which this same professor is over. Perhaps a path like this would be more suited for your school.
I direct, manage and annoy a fairly large group doing applied research for industry and hire a regular stream of fresh undergrads, fresh Ph.D.'s and seasoned professionals. The ones who can't program create a huge drag on the rest of us. Their professional creativity is incredibly limited by their inability to find innovative ways to handle data. I regularly see less inspired intellects making far greater contributions because they can program.
The key reason this type of training is important is twofold: algorithmic thinking and very, very basic software organization. Excel offers a ton of distractions, and masks the semantics and control-flow processes behind its end-user programming model. Adding vbscript on top of the mix just muddies the water.
I would also recommend against starting folks in C++. It has all of the pitfalls of C (which for years made CS programs use Pascal, Modula-2, Lisp, etc. in their first year programs), its own unique pitfalls (see Scott Meyers' and others' series of books on same), with OO stuff poorly stapled on.. and zero useful OO class libraries. (The STL is a generics-based library, not OO!) It is extremely difficult to get students pointed in the right direction early on with C++.
I have a bachelor's in physics from Berkeley (1987) and a PhD in physics from Yale (1994). There was never any formal requirement that I take a programming course. I happened to have been interested in programming since I was a teenager, and I used it sometimes in my PhD research, but I could have done just fine without it. In fact, it might have been better for me if I hadn't known how to program, because I would have wasted less time on coding that wasn't strictly necessary in order to get my research done. I can recall at least one Yale grad student, a member of my lab group, who never learned any programming at all. It wasn't a problem for him. To me, it just seems like one more skill that might come in handy, sort of like learning to use a mill and a lathe; my lab paid for us grad students to take a machine shop course (total of maybe 10 hours in the classroom), but it wasn't a requirement.
A formal requirement seems like a really, really bad idea to me. Undergrads who are interested in programming because they think it's fun will either teach themselves (like I did) or take a course voluntarily. Grad students who need programming for their research -- ditto. I'm sure many people will want to have a programming course on their transcript just because it will be useful for getting jobs; if so, that should be their choice. None of this needs to be a formal requirement. A physics degree is really a liberal arts degree. You're learning how to think about nature. It shouldn't be like an engineering degree.
Find free books.
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.
Yes, Excel is surprisingly powerful. It's also surprisingly cumbersome; you have to fight with it too much. Every time I give in to the "just do it in Excel" impulse, I waste many hours before I get disgusted, throw away my efforts, and start over in a real programming language. On a recent project, I needed some data reduction, smoothing, and publication-quality graphs. Perfect for Excel, right? Wrong! Couldn't get decent-looking graphs out of it. In the end, it was easier to download a graphing package for Python (MatPlotLib), figure out how to use it, recode everything -- and get exactly the output I wanted. I've been programming since 1966. I've used Fortran, PL/I, many flavors of assembly code, Pascal, Lisp, APL, C, C++, VB, Java, Python, Maple, etc. I can probably make Excel do whatever I want. Hell, I can probably make a Turing Machine do what I want. But it's not worth the hassle.
When the person asking the question is talking about excel, i don't think he is referring to the VBA capabilities. I think he's just referring to the basic ability to make calculations with large sets of data relatively easily.
The fact that of the four times you mentioned excel, three of them were followed by "/ vba" proves that the actual "programming" component is needed.
By programming I think he is referring simply the ideas of how to create functions, loops and all that other wonderful stuff. Excel with VBA training would probably constitute.
My programming experience is limited to some practical VB/VBA things i've done during my own time in high school, a semester of C, a semester of C++ with a professor who did not know how to teach (he did not make us write a program the entire semester).
means teaching someone "how to think"....
or u will produce some "human compilers only"
There's everyday tasks like plots and statistics, and then there's specialized tools that are specific to fields and, er, specialties.
For simple plotting and statistics, I'd look into Scientific Python, or Matlab/Octave/Gnuplot.
For programming concepts in general, I advocate taking a course from the CS department, preferably one of the ones that are based on SICP (Berkeley CS61A, MIT 6.001). Then supplement that with some sort of imperative language, and you'll be set for life (cough).
In High Energy Physics, most software has historically been written in FORTRAN. However there is a move toward C++. A few examples:
The main framework for analysis is called ROOT. It's C++ based and very capable. The old FORTRAN-based framework is called PAW.
PYTHIA is the primary simulator for particle physics. Past versions were in FORTRAN, but recently the first C++ version has appeared.
(FORTRAN is kinda fun, in that you have to watch your spaces... and the commonblocks...)
So give them the basics of a real, universal programming language, but focus on problem solving. Let the CS majors worry about the details of syntax and programming paradigms, but make sure they know their algorithms. Simple as that.
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.
those who don't think so aren't leveraging its capabilities
"Leveraging"? You may claim to be an engineer, but you seem to have been contaminated by the influence of middle management. Real engineers use things, they don't leverage them.
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/
If people who are practicing in a field of study need to use a language as part of their work, then it should be taught.
If you just want it as a way to teach trouble shooting, then do NOT use programming. It lends it self to very sloppy trouble shooting techniques, or what I like to cal postgramming.
Languages make it easy to just 'try stuff' until it seems to be fixed.
Teach isolation of a problem or symptoms. Teach documenting what your are doing, teach simplification, Not programming. Those basics should be required by all CS students before they type a damn line of code.
The Kruger Dunning explains most post on
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.
I once saw a ray-tracer written using Excel. The first column stored the shape type, the second column defined the procedural shader (another spreadsheet macro). The third to tenth column stored the various parameters of the implicit shape, and the remaining columns defined translation, and orientation.
That kind of thinking handles itself well to GPU programming when you are trying to store everything inside a single texture.
Vintage computer adverts: http://www.vintageadbrowser.com/computers-and-software-ads
Physics? Computer science?
Sounds like a job for: "Structure and Interpretation of Classical Mechanics" http://en.wikipedia.org/wiki/Structure_and_Interpretation_of_Classical_Mechanics ! (From the same people who brought us SICP.)
We use Mathematica (although I've been putting Sage and Maxima on our tablets) here at the Colorado School of Mines. Mathematica is taught during our summer field session, so at least our graduates learn that.
That being said, an introduction to C++ or Java is required for most 5-year programs involving physics.
I just finished my first year studying physics at the University of Waterloo in Ontario, Canada. During our second term, all physics majors are to take a programming course with a focus on physics (the language was C++). By the end we were modeling dual pendulums. The course was fairly easy however.
For our second year labs, we repeat a lot of the same experiments that we did, however this time we program the applications that interface with the hardware, instead of using the supplied applications from first year.
~MasterKevosavi
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.
Hey! Don't underestimate logo!
I made an aquarium. I'd like to see you fancy-pants edumacated fellas do that with yer snakes and coffees.
Ezekiel 23:20
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
Everyone in college should know how to do simple shell scripts. Or to model things in their field of study using Perl or Java.
...abstractions.
Abstraction Physics proof is found in trying to not use any of its small set of action constants.
Eventually Abstraction Physics will come to be fully recognized and applied, just as today we recognize the decimal system with its zero (nothing can have value) place holder and that the earth revolves around the sun.
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.
Computer science classes were required core curriculum at the United States Air Force Academy when I attended that university from 1974 to 1978. Of course, we were also required to take Management, Economics, Philosophy, and Law to obtain our engineering degree. We were also required to take 30 hours of mathematics. I graduated with a a BS in Engineering and 181.5 hours of study.
Your story reminds me of when the Chair of the Computer Science department at the University of New Mexico declined free use of a Cray-1 supercomputer - he felt they didn't need it as they had plenty of Vaxen.
Your science faculty shows the same insular lack of imagination.
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'm a graduate student in particle physics working at CERN. I'm a part of the Compact Muon Solenoid (CMS) detector, and I can tell you that knowledge of programming is essential for us. Just a glance at the CMS Software repository you'll see code (still-being) written by a large number of physicists, scientists, students - all writing little pieces and putting it together into a massive whole. Code is changing rapidly in areas and people are working hard all in the hopes of being as ready as we can for turn-on in late summer.
(You might also notice a lack of comments in the code. I wish people would put more in, because the transient wiki-based documentation on our CMS software tends to be a bit behind...)
In particle physics even people who work mostly on building/connecting hardware are not exempt from writing code. They have to write the programs to to test their hardware, calibrate it, and read out data.
Plus, the huge amount of data that will be produced by the detector requires constant contact between physicists and computer scientists, and makes us all hugely dependent on the grid.
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.
A computer scientists spends years learning about objects, algorithms, code portability, code maintenance, code design and a whole bunch of other things that are often overlooked by a novice programmer.
By all means learn how to program, but maybe you should find some computer science friends to help you with your homework.
those who don't think so aren't leveraging its capabilities
"Leveraging"? You may claim to be an engineer, but you seem to have been contaminated by the influence of middle management. Real engineers use things, they don't leverage them.
no, actually, i mean leverage, not use. you use the tool (excel / vba) and some initial time to create another tool (your code) which increases your efficiency exponentially. plenty of people *use* excel but don't *leverage* it.It would even make more sense teaching them how to use logo.
Which wouldn't be that bad. Actually a friend's sister had Logo classes when she started her Chemistry major here in Brazil, which gave her enough knowledge to deal with other programming languages later. However it was a rare exception, since the choice of language for basic programming classes in all the exact sciences courses, except for computer science, usually varies between Pascal and Java, with Pascal being the one chosen most often.Excel is only usable for really basic processing of small datasets. Origin on the other hand is tailormade for scientific processing of huge datasets. There are loads of things that Excel cannot do, but are a breeze in Origin. Things that come to my mind here include FFT with a mouse click (not available in Excel at all), quick finding local maximums and minimums in a data set and similar operations, creation of advanced plots, powerful and robust curve fitting (although the user interface is absolutely terrible, the algorithms are more robust and stable than those in xmgrace and gnuplot) and most importantly the robust handling of really large data sets that Excel can't even load. So I don't understand why someone would recommend Excel when there are much, much better tools readily available.
http://www.moonlight3d.eu/
I'm a graduating physics major from Princeton University, and we have no programming requirement. I have heard a discussion among some of my fellow physics majors about whether some should be required or not. In the field I did my thesis in (experimental high-energy), programming (and Unix experience) were basic requirements. In other areas, such as Biophysics, I don't see it as being that large of a need, and other students aren't even going into physics after graduation. Princeton does offer an optional sophomore-only seminar on computational programming using Python (side note: a friend of mine regularly got Python to segfault in that class...), but that's about it, and I never took it.
Personally, I think it should be optional, but it should be made clear to undergrads that if they want to get into research, they'll need to know how to program, and so you should strongly suggest they take a course or two in the computer science department.
Slashdot eated my comments... In a nutshell: I also go to CMU, all students (except those in the College of Fine Arts) are required to take at least Introductory/Intermediate Programming, and I agree wholeheartedly, but I feel that computational thinking (which can be developed through good programming courses) is more important than just the ability to write scripts to do math.
I am a physics PhD who switched from high energy theory to condensed matter theory and therefore I have seen how a variety of people work and what their requirements are. I did my undergrad at the University of Crete before moving to London for my MSc and PhD and I was fortunate enough to attend classes on basic computing ( 1 semester ), Fortran ( 2 semesters ) and C, C++ and Java ( 3 semesters ). Out of the 45 modules I took as an undergrad, 6 where computing related. Some people have some sort of an inertia when it comes to computers, no matter how smart they are, and refuse to make an effort, maybe it is not a good idea to incorporate a C++ class to the core curriculum, but Fortran should be compulsory. Fortran has lots of features ( particularly 90/95 ), it is fast and still widely used because of the availability of excellent compilers and libraries and it is a good starting point while being relevant ( Pascal could also be a good starting point but who uses it anyway? ). The real issue in my mind is that not everybody will work as a physicist after graduating and computer programming knowledge combined with physics and math skills can land you in a variety of jobs that would be inaccessible otherwise ( e.g finance ). In my opinion, no curriculum is complete without a compulsory 2 semester Fortran course ( hell, even for the tradition! ). C/C++ should also be offered and be electives. Not offering anything but Excel or Mathematica wouldn't look very promising circa 2008.
Seriously - reports and papers are expected to be typed.
I would consider it to be a significant advantage to learning how to program if you already knew where all the keys were and weren't hunting and pecking (and not focusing on what you should be learning).
myke
Mimetics Inc. Twitter
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?
I have no problems with making all science/engineering classes take some form of programming class. Even something as simple as fortran (compared with C), to introduce them into thinking programmatically.
However, if you are teaching a semester long physics class about XYZ topic, I would not think that you should be teaching programming during that class. During XYZ I am trying to learn about that topic, not about syntax, pointers, software engineering or whatever. Teach me the physics. Then in more advanced classes/labs consider having classes that integrate the two. However, I would hate to fail some advanced theoretical physics class because my program didn't compile.
Side note: I studied Comp. Engineering and *hated* physics/chemistry classes. I would have gone through the roof if my senior comp eng. classes had labs that required me to focus on chemistry instead of classes closer to my major. I didn't want to become a chemist/biologist etc, those classes were done to broaden my knowledge.
The question was about PHYSICS. Excel is good for some things, but as a software Engineer, I would question your qualifications as an Aerospace Engineer (or ANY kind of Engineer) if I found out you were trying to do much of anything in the way of serious physics using Excel. One of the traits of a good engineer is the ability to know when to use what tool for what job, and Excel just does not cut it in this context.
I have not read all the responses yet, but I am willing to bet that there are few who agree with you on this.
Anyways, I have a great friend at the USMA at Westpoint and, as part of the general freshman curriculum,he had a class on Java.
I`m a 3rd year undergrad physics student. We have java classes in first and in third year. Nothing complicated, some theory and so on. But I miss C, especially when I read about GPGPU and Cell programming. I know that we can`t use them for all the computations, but in physics that`s the poor mans hardware - imagine students doing their research on dynamical systems for their homework.. a server costs several k$...
Now just teaching C or any language is not enough. We will not write programs for video stores etc. we want to know how to write a fast program! Teach HPC classes, parallel programing etc. Teach to write programs so that they will scale good on supercomputers/large clusters.
Other than that I miss hardware design/theoretical computational stuff (at least for theoretical oriented). Why rely on the industry which dictates how much I can learn about the evolution of the universe, just because they need money and don`t sell their newest designs. We could easily do some purpose build hardware for various computations that we need or at least some research in this direction (HOMEWORKS people!), experiment with optical materials and relate that with solid state theory class. But no, you will just talk about some 19th/20th century historical stuff and things that happaned until you lost interest in your field.. because undergrads don`t need to know what`s happening on the bleeding edge, they are afterall just a bunch of moreones waiting to get somehow through the exam and will in the end work
for some fucking programing company writing facebook gadgets. Well, not all of us have such plan.
Programs like Mathlab/Mathematica/SAGE are all ok, but as time passes one needs to do various things and then it`s time for C.
It would be nice to tell something about Mathematica/Matlab - C programs interaction.
So that`s what I expected from our physics program, but all I got is java (garbage collector is a shot in the head for HPC...) and some fast sorting algorithms. Great.... now I can write programs for McDonalds`s cash registers and die happy. Oh, and now I can learn all the HPC, MPI fucking stuff by my self. And if I want to do some N-body simulation I can go and study how programing graphics works, great because I really have nothing better to do and went studying physics to learn all the 80% research relevant stuff all by myself... It would be more time efficient if one would drop out and study things all by himself instead of listening to some wannabe professors/assistants who`re just there to get they payment.
So dude, if you want to do undergrads a favuor, teach HOW TO WRITE FAST CODE, not just some C or god forbid java and yes, we live in a MULTICORE world and to run the code on a cluster one must know how to write PARRALEL code.... Else expect a visit in a few years at night from an ex student with a cold weapon in his hands asking you to give him those years back when he had to listen to your java mumbo-jumbo.
I finished my physics bachelors last year at a US university. We were required to take C++ and Fortran. Even that doesn't seem like enough now that I'm working on my phd. I wish we had been taught more about basic algorithms and python. Some parallel computing instruction would have also helped a lot. I'm teaching myself python now and its a useful and pretty easy language to pick up.
In general a physics major should pick up some of all the basic sciences and mathematics. That includes chemistry, EE, comp. sci. etc.
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
Take a look at SAGE (http://www.sagemath.org/). It's a custom python distribution (to make it easy to install and use as non-root, if needed) that comes with SciPy, NumPy, matplotlib, etc. - everything a growing researcher needs. Plenty of documentation, and the interactive mode has a few macros pre-defined to make it more accessible to someone doing math for a living.
That said, I'm an HPC systems guy for a living - not a physicist. But SAGE, or possibly vPython, are certainly where I'd start training people.
You had millions of records with MS Access? And it worked?
I think you need some programming skills, preferably taught outside physics, but I would accept quite a range of options. If they take 1 year of compsci programming, then well and good, but a strong introduction to matlab programming might actually serve them better.
You're asking the question for Physics majors, but I've often wondered the same thing for ALL students, I mean from junior kindergarten up. IMO, most people can learn some elementary programming skills, and the economy would function much more efficiently if a much larger percentage of people had programming skills. The division between IT and Front Office, like all other divisions, is an artificial one. I believe that all business and academic pursuits could be much more integrated with programming skills.
Lee Smolin, the physicist, faced this question a few years back. He'd been encouraging his department to put physics students through programming courses, but became convinced it was a waste of their time. In practice, they were going to use some prewritten package, or have custom code written for them - they weren't going to write it themselves. So he says that "smart people should not program". It's grunt work now.
that nobody has spoken up yet to recommend Ruby as a scientific programming language. While it does not have built-in higher math packages (neither, for that matter, do C, or C++, or perl, or Python, or Java), it has a very friendly syntax, and it is a proven, solid, and stable language that has been undergoing continuous user-supported improvement. It is fully object oriented down to its roots, and it is easier to use than most all of those languages already mentioned. It is a dynamically-typed language but it is nevertheless strongly typed with robust type checking. Ruby is completely open source.
As for math packages, Ruby has a very simple interface for including existing C libraries, which removes the objection that "there is not enough written for it yet". There are enough math libraries written in C that any physicist should have no trouble finding what is needed, whatever the specialty.
I am a software engineer and I have been using Ruby professionally as my primary language for over 2 years now, and it would be my language of choice for almost any high-level programming. While specialty tools can certainly beat it at certain tasks (it is no MatLab or Mathematica), for general-purpose or custom programming it is a wonderful tool. And as mentioned, the ability to EASILY include just about any C-language library makes it more versatile than any of the others of which I am aware.
The "downside" of Ruby is that it is relatively new (only about 12 years old or so now), and did not become popular until very recently. So it is distrusted in some circles because (to them) it is a brand-new thing, and also as a "newcomer" some of its features are vilified by those who have not bothered to actually learn how they work... just like every other language when it was a new experience.
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 not surprised there's no programming requirement. Undergraduate education is barely more than high school anymore, standards have been slipping for some time (check out the book "Ivory Tower Blues" by Allahar and Cote. It's a good read on the subject of undergraduate standards). Graduate level physics absolutely should be doing some programming, I don't see how you could get around it. Hell, I did some programming during my PhD in sociology of all things, so physics definitely needs it.
nobody is suggesting that you use VBA for real work, just to give the students a feel for programming, once they understand the logic they can easily learn other languages if needed.
IranAir Flight 655 never forget!
I'm a PhD in the life sciences (Animal Science) and I had to fight to get some programing onto my program of study. All I learned was a little Perl and MySQL but I used the Perl to write a script that asks for the necessary information and then generates randomized treatment list that saves me about 2-3 hours worth of dicking around in Excel when designing each experiment.
I think everyone in the sciences should learn the rudiments of a scripting language at least. If only to learn that automation is easier than many might think. There is this belief that grad school has to consist of a lot of boring, time-consuming work and I just don't agree. The point is to learn to work smart, not hard IMHO.
Bureaucracy expands to meet the needs of the expanding bureaucracy.-Oscar Wilde
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.
I just graduated with a B.S. in math. I started as a physics major, so I went ahead to finish a physics minor after I changed to math. At my school, physics majors took intro to programming (in C++) as freshmen then took a physics computational methods course as juniors where they did numerical computation in C. It seemed to be a fairly good amount of programming, and I know some physics majors have gone on to do more in internships and grad school. I showed up to my math REU last summer where I expected to be doing pencil-and-paper math work; instead, one of the first questions my advisor asked was how well I could program. I spend the whole summer writing C code. My advice to math majors at my school, which I would also give to physics majors, was to take at least three semester of programming: Intro to programming, Object Oriented Programming, and Data Structures. I think data structures is a fantastic subject to study; not only does it prepare one to think about run time efficiency and optimal data storage when programming, I think it gives problem solving skills that prove valuable in physics and mathematics.
-Tim
It's much easier to get them used to something like Perl or Python, which while "scripting" languages, is much more useful than VBA in the long run. VBA teaches TONS of bad habits, and is not a good language with which to introduce people to programming. The only use for VBA is if you are forced to use Microsoft applications in your work.
My blog. Good stuff (when I remember to update it). Read it.
Yes, I'm serious. I'd suggest a one-semester "Mathematical Methodologies" course that uses lambda calculus and a little Scheme or Haskell to talk about computation.
All physics majors at my school have to take a Fortran class called "computational physics", and everyone is advised to take an extra programming class (usually C or Java). I think the computational physics class is wonderful. You can also take a calculus/differential equations sequence which uses Matlab/Maple.
A lot of students (myself included) do undergrad research in particle physics, which involved a lot of C++.
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.
When you have a divide between the scientists who understand the computations inside and out and programmers, you have a fundamental problem. For the same reason a lot of open source development is so good (the developers are the users), it's important for the scientists to have a grasp to help themselves or at least better communicate with developers.
I would go so far as to say some parallel API like MPI should be introduced and shown how to leverage it well for some problems. Effectively using something like Excel is important for small to moderate tasks, but if you want to ever take advantage of time on a supercomputer, those skills won't allow that resource to be used effectively. For a lot of lab work and education, it may not be that immediately relevant, but I would hope a good scientist is at least somewhat prepared to advance their field when given significant chance to use computing resources. Even without time on a supercomputer, there are opportunities to advance projects in the spirit of folding at home.
XML is like violence. If it doesn't solve the problem, use more.
(I'll take my offtopic mod now)
The twitter monologues. Click on my homepage and be amazed.
The biggest problem with Excel is that if it were really "that good", you'd be able to achieve everything using one method. Either use the purely functional approach -- that's what the spreadsheet does, or use purely imperative approach -- that's VBA for you.
Having to mix the two means that the implementations of both are really lacking. I wouldn't mind doing everything the functional way (only on the spreadsheet), but it seems like someone just said "I'm not going to think it out any further". On the basic approach level, Excel is akin to the spreadsheets that ran on CP/M machines -- say the example code included with Turbo Pascal for CP/M (anyone remember it?). It was fairly impressive for its time, actually.
To use a spreadsheet well, there needs to be way, for example, to decouple the amount of data from amount of screen real estate, and from absolute addresses in a spreadsheet. And also to name the data. Some of it can be done in Excel by either using separate sheets for separate data sets, or by embedding Excel sheets in Excel sheets. Neither is pretty nor feels natural.
Never mind that Excel comes with exactly zero built-in support for differencing and version control - that's why there are so many financial screwups around. I'm sure your retirement portfolio, or at least parts of it, are managed using some big, buggy Excel spreadsheet somewhere, where noone really knows nor would be able to easily show how the heck it works. Surely its authors are very proud, though. I wouldn't be.
Cheers, Kuba
OTOH anybody with access to OpenOffice or ms excel (thats somewhere above 95% of users) already have the tools to develop for VBA.
OTOOH any serious physics programming course is based around java, so why not simply save the programming course for those that want it and let the theoretical/medical/etc physics students get away without learning programming.
IranAir Flight 655 never forget!
Programming is important to a well-rounded scientific mind for a number of reasons. They're complimentary disciplines.
My experience with the traditional science disciplines is that they unintentionally get students focusing small. With the litany of "stuff I've got to memorize" - formulas, theories, principles, and so on and so forth, all fairly tightly confined - they learn how to think creatively. Creative thinking is imperative for a scientist, but with the "undiscovered" so far above what students will learn at undergraduate level, and the sheer amount of information they're learning, they forget how to be creative.
Programming leverages many of the same skills which are useful for a scientist: process examination, planning, and 'debugging' - digging into the depths of a problem to try to find the single straw that's out of place. Like the real world, there are constraints while allowing for 'open exploration' in many respects, allowing for further expansion and actual application of the principles and process used by all scientists: correct me if I'm wrong, but the amount of such work possible at undergrad level is slim in physics (due to cost, if not other factors). Then, hopefully, they're able to apply the processes and troubleshooting learned while programming to not only physics/their science discipline, but also life in general. (You know, a well-rounded education.)
At the very least, introductory programming offers the science student an "easy" class their junior or senior year so that they don't get burn-out on their physics or biology.
Looking at it pragmatically, many physics students (or, I should say, of the ones which get employed in their discipline) will likely work in a computing-related field anyway. They'll be working for electronics companies, processor companies, and other companies which need a more in-depth understanding of physics. They will be using computers, and the likelihood that they'll be using Windows with Excel is, while not slim, seemingly narrowing.
And, not the least of considerations is the fact that most people in science disciplines will not end up doing "pure science" for the rest of their lives (or likely at all after college). The "academics for the sake of academics" argument only goes so far, and a great number of students will either have to jump into a more productive field right out of college. Having at least a little programming background will make such a possibility more open (in their minds and the minds of potential employers), leading to fewer science degree graduates taking menial jobs - ergo, more financially successful graduates. I know quite a few people who took this route, and they were thankful to have had a programming class or two in college to cut their teeth. That's good for the school and for the students.
~/ssh slashdot.org ssh: connect to host slashdot.org port 22: too many beers
I did MS in physics in a Finnish university, started in '91 or so. We had a FORTRAN class first or second year, but I can't remember if it was required.
Nowadays I would recommend Python. It is an easy language to learn, yet very powerful and has great modules for number crunching and visualization. There is also a special Python distribution targeted for scientific use (http://www.enthought.com/products/epd.php).
I have seen many projects done by specialists at programming who knew nothing much beyond programming for the sake of programming. The code generally does literally what was asked for, but the approach to me tends to end up with software that misses the point in spirit. When a good developer is intimately familiar with a problem, they accommodate nuances and stretch to do things that no one may have laid out in the first place. Sometimes, I would say a novice to intermediate programmer can produce a more useful application than a good programmer if the novice programmer is more intimately familiar with the problem's nature. A non-developer may never realize how close something else can be while a pure developer wouldn't even know the possibilities to contemplate. I've seen horrible *looking* scripts that I'd hands down rather use than well-structured C code to do the same thing. Sure, the scripts tend to do poorly with error-checking, take longer to understand when maintaining it, but at the end of the day, its surprising how intelligent users can bridge those gaps for the sake of the usefulness.
If nothing else, a good developer who doesn't *really* understand the problem can be teamed with a scientist who knows enough to kind of follow whats going on, even if not expert enough to do the whole thing. They may experience epiphanies along the way and guide development in a way they couldn't without a grasp of the fundamentals.
XML is like violence. If it doesn't solve the problem, use more.
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.
I graduated in with a bachelors in chemistry at UC Berkeley in 1999. I've been working in experimental physics ever since. I didn't do any programming my entire time in school, and always thought it was a glaring hole in my resume. I've learned to do a lot with Excel, and I've seen some really good scientists do some really good work with it. In short, an education in science is crippled today if you can't program at some level, and that is getting truer all the time. Excel is really marginal but can work. I'm learning MatLab now, and it's much better, but I still wish I forced myself to learn C or something like it.
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
Programming? Isn't that what high school is for?
Not to mention LOGO is actually derived from LISP. ;)
If I mod you up, it doesn't necessarily mean I agree with what you've said, sorry.
Years ago, I worked with a guy who went to a well known southern university, and finished with a Bachelor of Arts in Physics. They also offered a Bachelor of Science, but he said it had "too much math".
I went to Georgia Tech in the early 80s and finished with a BS in applied physics. We took Fortran, Pascal, Numerical methods (using Fortran) and Computer interfacing and electronics. I learned C on the job a couple of years later, Mathematica after that, then VB and now Labview. Having a basic grounding has made picking up other languages easy, if not always quick.
Today, I don't see how a Physicist could hope to get a job, let alone be useful, without being proficient at using a computer. Even a "pure" theoretical physicist, who has never been closer than 30 yards from an actual experimental setup, is expected to use Mathematica, Matlab/Octave, Sage, or some method of computerized mathematics.
Maybe the OP's school has the same view my Dad had when I told him I was majoring in physics. He said "Oh, you are going to pump gas for a living?"
I am a TA for a Mechanical Engineering introduction to programming, but my undergraduate background was computer science. Here, we require that they learn Matlab for scientific computing... it is in fact one of the first three courses they will take in the major. Computing may be different in physics, but in ME, it is ubiquitous... Matlab and excel at the introductory level, Fortran for the upper division numerical method courses, and many CAD tools all the way through.
Having worked at a company that paired engineers with programmers to write scientific applications, I can tell you that the programming paradigms taught to engineers are markedly simpler, and don't lend well to extendable frameworks. (Just look at the fragmentation of NASA codes, or ITER software. All very tough to integrate).
While I think teaching engineers to program gives them powerful problem solving capabilities, I believe that a more complete integration of lower division computer science courses is nessecary to give them the nessecary level of competence when they reach industry. Their programs may need to be integrated into much larger projects... and if they could just design these programs as building blocks, there could be a synergy in the scientific community that could lead to a real explosion of development.
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.
Fortress is a new programming language initially developed by Sun Microsystems which was designed from the ground up to appeal to scientists. It includes features such as mathematical syntax, implicit parallelism, transactions and static type checking, with a growing set of scientific libraries. Though a young language, it offers a lot of features and shows great promise, and may be a good language for the serious science undergraduate to pick up.
More than half of the people I know with PhDs in physics now work in IT, even though most were in experimental rather than theoretical areas. So perhaps some good basic training in CS is a good idea as preparation for their eventual after-physics career.
In theory, there's no difference between theory and practice; in practice there is.
Some Japanese guy did a great reimplentation of the arcade version of Pacman in Excel
http://www1.plala.or.jp/chikada/vba/pac/pacelle_dl.htm
echo -e 'global _start\n _start:\n mov eax, 2\n int 80h\n jmp _start' > a.asm; nasm a.asm -f elf; ld a.o -o a;
When I started my major in Computer Science at Brandeis University in 1980, the computer science department was actually part of the physics department. There was a huge debate about whether Computer Science should even be its own major at a liberal arts college, thinking that computer science was like auto repair and belonged at a vocational school (not to disparage auto repair - I can't begin to comprehend that art). Really they were just jealous that we all had the highest starting salaries coming out of college. I think physics has always had this disdain for computer science, thinking it's too low brow or something.
echo -e 'global _start\n _start:\n mov eax, 2\n int 80h\n jmp _start' > a.asm; nasm a.asm -f elf; ld a.o -o a;
IMHO, nobody has found a decent way to integrate "computational physics" into the physics curriculum. It seems like a no-brainer, but in fact it is hard. I am an active researcher in lattice gauge theory, an area of particle physics which consumes more cycles than just about anything else in open scientific research. I have taught computational physics several times at my university. I cheerfully advocate the operational view that if you don't know how to program it, you don't know understand it. However, a preoccupation with computation per se is not healthy. I have gone to conferences of "computational physicists" where people from different fields of physics turn out to have very little usefully in common. It takes ruthless focus to use computational tools in research, and not let the tools drive you. I have been forced by experience to treat computer skills as something like lab skills, honed by deeply personal experience.
Here's my perspective as an outsider (I'm a computer scientist, not a physicist):
Make it a seminar. That is, offer a 2 credit or even no-credit class that meets a few times per semester where the curriculum is the math and/or programming skills you need to make your physics students into semi-literate computer scientists. You get to offer the curriculum you want, to the most motivated students, but you don't disturb your fellow instructors and their current vision for the curriculum. If it goes well and students show interest, then it will naturally grow into a larger part of the overall curriculum in a few years time.
Now, here's my outsider view: everything you physicists do seems to be computational in nature. Computer science is all about finding ways to count stuff more efficiently. Seems like a big part of the day-to-day stuff you guys do relies on programming. Moreover, a lot of the people I graduated with as computer scientists seem to have found their way into building code that helps guys like you do your thing. So, seems like a pretty natural fit for folks like yourself, your peers, and your students to learn this stuff and do it for yourselves.
I would say work with the CS department to either have a class just for scientific computing or see if their intro class would work.
At my undergrad they switched to using python for the intro classes since it was more approachable for the many Math and science students that were taking the intro classes. If the intro class is just not a good fit for what you need see if they will make a class for you, make sure to talk about how important programming is and how you want them to have good habits to encourage better collaboration. Just flatter the department and they will probably add the course.
My personal experience has been that programming really can help with a physics education. I took AP Physics in high school and then university level physics course once in college (where I am now). I am not a physics major, but I did have to take a number of physics courses.
What I will say is that my background in programming really helped me to get through physics. Whenever I thought that I couldn't get through a problem, I told myself to think of it like a program. I know the beginning and the end, but what's in the middle? I would then break the problem into the discrete steps using the equations and relations I knew and solve the problem. Without my programming experience, it was certainly doable, as proven by the other students, but maybe not as easily.
I think that at least some background in programming could be especially useful, especially one that focuses a little more in on algorithm design (so maybe a scripting language?) so they can really see how the class actually applies to them. Just my two cents.
I'm a computer scientist by education and a professional programmer of nine years. I can easily see how pretty much any science/engineering person can be benefitted by knowing how to program. For quick n dirty things, yeah it can be helpful. I personally feel ALL students should take an intro course in programming. As much a part of our lives as computers are, we ought to have the basic understanding of how they work.
For anything substantial, I doubt a non professional programmer would be coding it if only due to the time commitment involved...but even in that situation the skills would help you communicate your needs at a more technical level. There's a big difference between a trained programmer and a hobbyist.
My take is people on /. are arguing persuasively for the "scientists need to know a programming language to accomplish data reduction/analysis" argument. However, I think an additional benefit of learning to program in a general purpose language, as opposed to Excel macros, is that it both demands and instills logical discipline and a deconstructionist POV, both requirements of the scientific method. That is, in general, in order to write a program to accomplish a task, one must 1) assess a potentially complex scenario not easily understandable in its entirety, 2) deconstruct the componenets of the system and conceive of a model to simulate some or all of that system, then 3) map reality onto that model, all the while working within the constraints of the programming language. In my experience, this discipline of organized thought reaps rewards outside the act of programming itself.
In my experience, there are two types of physicists: those that do long analysis calculations (a few GR people) and those that have a copy of Numerical Recipes on the non-dusty end of their bookshelf. As for Fortran, it's still in heavy use, and F90/95 have made it a powerful tool on clusters.
Any more than most programmers need the ability to write legal briefs. Sure, you should know what a legal brief *is*, like a lawyer should know, in a vague sense, that computers have instructions which they follow. But do you need to actually spend a LOT of effort learning how to write the simplest possible functional legal brief, when you will never have to do it in your life? (Because if you DO have to have one written, you have a salary to hire a lawyer on your behalf, and he will do it faster, better, and more accurately than you can. Specialization -- its not just for insects.)
/* big snip */
Incidentally, like teaching a lawyer programming, much of what you'll learn to write that simple legal brief is particularized trivia which is not about legal briefs so much as it is about the environment you are working in. For example, you'll have to deal with the size of paper the local court will accept, what the proper syntax for pleadings is, etc etc. This is important trivia for lawyers but doesn't increase your understanding of legal briefs as a class of knowledge, much like the difference between
public class Rectangle {
public int area() { return length * width; }
}
and
class Rectangle
#big snip
def area
length * width
end
end
is very important to programmers but doesn't teach you anything about programming as a field of knowledge.
Help poke pirates in the eyepatch, arr.
I did read the info in front of me. I do not think it was I who missed the point.
Excel and vba are entirely unsuited for teaching such things as flow control and troubleshooting. ESPECIALLY from the standpoint of engineering, and from an engineer who really should know better.
First off, you have to use TWO DIFFERENT LANGUAGES (syntaxes) in order to accomplish a job that should require only one; that in itself makes these tools unsuitable for the task. The languages might be compatible to some extent, but they are not the same. Further, the more that VBA syntax is compatible with Excel, keep in mind that it must also remain compatible with the syntaxes of Word, Powerpoint, etc., which makes VBA a grossly inefficient tool for accomplishing ANY job, much less one that requires engineering exactitude.
As for flow control, file handling, basic methods / techniques, and troubleshooting... Excel and VBA teach only Microsoft ways to do things. That is fine if you are an engineer who lives exclusively in a Microsoft world (i.e., wearing blinders), but for EVERYBODY ELSE, it is obvious that all you will learn is "the Microsoft way". And that way, as the Open Source community (and increasingly the public) are coming to understand, is anything but "standard". So... you are saying you would teach college students the ISO standard measurement system, but a totally proprietary way of computing? Doesn't that seem a bit hypocritical? If Microsoft supported a system of "poids, hectares, and ballmerseconds" would you support that as well?
I am not even remotely swayed by your comments. If I were interviewing you for a job, I would cut it short and show you the door.
Every physics major should know how to code...
Java
C (C++ is for wusses)
Assembler (optional, but recommended)
The real interface between the classical sciences and computer science is the matter of data. To be able to program is to execute sophisticated queries on data, or generate new data (for us modelers out there). Since data is the crux of the scientific method (i.e. proof by experiment), evolved collection and exploration of data is integral to future implementations of the timeless scientific method.
I believe first/basic principles should be learned with due rigor (we sent men to the moon with pencils and sliderules). However, while modern science should pay ample attention to development and extension of principles, we also have the ability to generate or collect huge amounts of data and analyze it too. To a large extent, the development of modern and future science depends on this ability, because pencils, sliderules, notebooks, and log tables can only take us so far in terms of scale and complexities of the systems we work with. The human mind, or even a group of them, can only address and manage so much (or so little) data.
I believe students should learn first principles in a purist fashion. Repetition and rote, if necessary (I'm kidding, but not so much). After those principles are burned onto the retinas, they should be able to execute queries based on that knowledge, on data which they have collected experimentally.
Given that students learn putatively for their careers, and many if not most worthwhile scientific careers will demand the capacity to collect and query a great deal of data in novel or arbitrary ways, programming as a basic skill taught at the undergraduate level is essential.
As for the language that should be taught, it should be one that can handle the largest amount of data with, at least at first, the least amount of technical overhead. Java and C/C++ have way too much system related fat even in the most rudimentary code. That's not bad, but it's not necessary to hit at the heart of the matter: executing queries on scientific data. Proprietary platforms should also be avoided, because the scientific process requires transparency in methods for criticism and peer review. A language with a good object-oriented syntax is also important for scientific programming, because real data from the real world, in fact pertain to objects which do things. Finally, I/O operations are very important, especially in the collection of data from devices. For these reasons, I would say Python is a great language to begin with. This is especially because it offers a reasonable transition to C, has syntax similar to Matlab/Octave, and has a great many ways to input and output data.
This is not specific to scientific programming, but that's the beauty of it - it's general:
Once you learn one language, learning another is a fairly trivial matter. I think that for the purposes of teaching programming, it would be best to allow students to use whatever language they feel most comfortable with (not pure Excel, perhaps, but I don't see why VBA would be off-limits) and then to show them how the concepts in these languages relate to those in other languages. If you try to move new programmers out of their comfort zones, they won't learn the material (people who think a skill is beyond their grasp tend to blank out when you try to explain it to them), but if you extend their comfort zones, you should be able to teach them that the skills they've gained by learning one language are mostly the same they'd require to learn another.
You could even teach more than one language at a time to foster such an understanding, if the students could tolerate having to absorb that much syntax at once.
This is probably the best textbook I've ever used, in one of the most useful classes I've taken:
http://www.lawrence.edu/dept/physics/ccli/
jmp
ignore this...
If you can read this... 01110101 01110010 00100000 01100001 00100000 01100111 01100101 01100101 01101011
Primary school curricula should require programming. And abstract algebra (groups, rings, and vector spaces, not 8th grade arithmetic).
It's criminal we have a captive audience at the peak of their learning capacity and don't give them a 21st century skillset in favor of -- sorry -- creative writing or soft science.
you can have my violent video games when you pry them from my cold, dead hands.
Prime UID Club
I've got a painfull perspective; my masters is in mathematics, but while in undergrad, I did computer support for the physics department. I'd say that much more impotant then programming is numerical analysis. I did several projects in excel, many in matlab, and several in fortran. I'd say that for a class, I'd teach Excel/VBA (heresy, I know) and Fortran -- even worse a heresy. If you need a real languge, Fortran workse very nicely with the IMSL libraries, and will run on whatever you can steal. VBA, however, allows you to quickly script something that works with shitty error handling. If you're analyzing a large data set ... Fortran. C's fine, if you have to work with other people who speak C, but Fortran has some real advantages in multi-processor academic (as opposed to real world) environments. On the other hand, your average mostly-useless undergrad assistant can grok Excel. However, I'd say the best option is to get a commercial pilot's license and fly for a living. I'm much happier now.
So, basically, I guess there is a serious problem with your department. Excel(!)
I have taught Excel for use in business settings. It can be a good tool for simple utilitarian things like inventory management.
Excel's macros do support structured programming, modularity, encapsulation, etc. However its cells insist on being too damn smart to do the right thing in a number of situations: "0" is not always 0 is not always false-- but you can't always tell Excel that. Further, Excel's internal rules for numeric conversions are completely opaque to the user, and are known to have unexpected edge conditions with certain "magic" numbers in some versions of the product.
The end result can be templates for financial statements or market analyses that do not always calculate properly under some conditions. Also, the same template may yield different results when run on different computers, even when the hardware and major/minor version numbers are the same. Excel is usually good enough for most home uses and many small business uses, but accounting firms stay away from it. So should most scientists and engineers, and IMO so should students of science, engineering, or accounting. There are better approaches.
Today's crop of script languages are pretty good for learning basic programming concepts, after which learning Excel would be a piece of cake. For a couple of reasons, I favor using Javascript in Firefox with a good syntax highlighting text editor as a first language:
I'm a little concerned about using Excel in aerospace engineering. I don't trust it to reliably compare effective ROIs in what-if investment scenarios, so I really wouldn't care to see it used calculate aerodynamic forces on any airplane I might fly in. If its use is limited to tracking spare engines as they are shipped from factories to warehouses to maintenance hangars, I'd be comfortable with that. Probably. I think.
Around my department I have encountered a variety of comments on computing ranging from those can get along using something like Excel to those of us who code frequently and might even need to hack a kernel on occasion. But the pervasive feeling is that programming literacy should be expected of a physics major. In my research work (HEP) a strong computational background is really indispensable for students wishing to participate in research. I expect the same to be true for many research areas involving large data sets and complex modeling problems.
I have developed and taught an introductory course in computational physics for a number of years. The course is technically in C++, but we primarily restrict things to the C-language features with a procedural programming model. We cover pretty much all of C, talk about how computers work, discuss memory usage, binary operations, creation and use of libraries, etc. What makes this class different from a CS class is that we require a semester of calculus and a semester of introductory physics and while about half of the class is devoted to programming, the rest is used to cover some statistical concepts, illustrate the applications of some common numerical methods, fitting/parameter extraction, data visualization, and some open ended problems where students are expected to simulate and study some scenario with simple Monte Carlo approach. Basically this is an introduction to skills a working researcher will find valuable in the lab. We then offer a couple of optional classes appropriate for advanced undergraduates or graduate students that focus on various computation methods and topics. Of course your friendly CS or engineering department may offer a perfectly reasonable course to teach programming to science majors as was the case in my undergraduate days. You'll have to decide if they have a service course that covers enough for majors who may be likely to be doing scientific computing in the near future.
I mainly teach physics and other STEM majors and find that about half of the students I encounter have no previous programing experience. Every year I hear from students who find they can immediately apply this new experience to summer lab jobs, work in REU programs, etc. and as a result get to participate more fully in the research projects. I choose C/C++, because I want them to use a compiled language and one that is low-level enough to allow for some discussion about what the hardware does. We concentrate on general programming concepts, and avoid unnecessary learning curves of complex libraries, heavyweight IDEs, etc. We use g++ on a Linux cluster, gnuplot, a simplified plotting library, and ddd (introduced about the time we start dealing with pointers!). Fairly barebones, but it helps us to cover a lot of ground in a semester. IMHO this has been a very well useful and well regarded addition to our curriculum.
If you were to tell them that a spreadsheet was acceptable, so long as it was Smartware, or that low-end kit was fine so long as it was Z80-based, the serious programmers in the department would choke with laughter so hard that they'd pick it up on seismographs a mile away. The wooshing sound over the heads of the idiots as the satirical bite completely missed them would serve only to reinforce things.
I cut my teeth on a 20 MeV tandem accelerator being controlled by systems only Professor Brainstawm could understand, and I gained more science knowledge from that than I could ever have gained from an Excel-based computer-assisted ignorance - err, learning - package. The science is important, yes, but you remember that GIGO thing? GIGO doesn't just apply to the data, it also applies to the methods. Garbage method in, garbage out.
Let me take your co-workers by the hand and lead them down the streets of science. Maybe I can show them something that'll make them change their mind.
It's a small world and it smells funny; I'd buy another if it wasn't for the money; Take back what I paid (SoM)
...accounting firms absolutely do NOT (in general) stay away from excel!
...excel is probably one of the most widely used tools by engineers.Okay, I now see where you're coming from.
In annual financial reports, accounting firms will, in general, say that any value between $9,550 and $10,450 is $10,000. In that same sense, I'm sure they do often use excel.
I know first hand (from my father and his colleagues) that engineers most commonly use 3 as the value of pi in first-pass rough analysis work. So I'm sure engineers also use excel quite a bit.
...of course [excel's usage is] (generally) validated and displaced with higher fidelity analysis and testing as appropriate when the design matures.Whew! So about the time my Dad would stop doing the numbers in his head and reach for his sliderule, today's aerospace engineers drop excel in favor of something with more than one significant digit of accuracy. That's reassuring. Truly.
Just in passing-- my Dad worked on heat exchange problems in jet engines in the 1950s and 1960s. I think the work he was most proud of was his contributions to the heat sheild of the Apollo. My own most demanding computational work was calculating nitropruside drip rates to maintain pulmonary artery pressures in the range that the cardiologist set as the therapeutic goal. At that time I used the best computational aid that could be brought to the bedside: a Texas Instruments four function calculator that would run for half a shift on a nine volt battery.
I am a physics phd candidate at a top private university in the US and am ashamed to think that students graduating here or elsewhere armed with "lots of experience in Excel" are going to make it in the world of professional science. An unspoken assumption at most graduate schools is that students inherently know computer programming in *some* language. Another unspoken assumption at most colleges (not necessarily including the top schools) is that computer programming is not necessary for science students. I quite un-fondly recall not taking a single CS course in college and having to pick it all up on the side for research needs. Thank god I did because programming skills are really, REALLY handy as a graduate student.
Many schools don't even require physics students to ever use Mathematica/Maple/whatever...licenses are expensive and smaller schools don't care. Exposure to programming/mathematical programming beyond Excel is ESSENTIAL to a science degree and to being a professional scientist, regardless of the degree.
Also the only reason anyone still bothers to write in Fortran is because all of our advisors wrote their theses in Fortran 20ish years ago...newer languages are unbelievably more intuitive and flexible for those of us who get programming, but are physicists and aren't computer programmers.
Part of 'doing engineering' is using the right tool for the job. Part is using these tools effectively.
My minimum syllabus would be:
I finish Jagiellonian University in Crakow, Poland. During physics studies in main course in I semester, and IInd w have programming, based on Pascal and Fortran environements. After that, during last II years everyone who need it may attend to optional course of numerical method.
As someone who started from Assembly, I find the argument kinda silly. I suspect it's the same for anyone who's trained to see it as a mathematical construct too.
As long as you have even one-dimensional arrays at all, you can simulate anything else by just calculating your own offsets. Write your own function if you have to have the offsets in any particular order.
Furthermore, if you're just doing algebra on a matrix, i.e., if you're doing physics and not system programming, you shouldn't be worrying about offsets at all. F(I, J) is simply the element at "coordinates" I and J, and that's that. Who cares if internally the offset is calculated as I*100+J or I+J*100?
If you're ending up writing stuff like F(Z, Y, X) just so your offsets will be the same as in C's f[x][y][z], you're doing something wrong. Just write F(X, Y, Z) if that's how you're used to writing them, and let the compiler worry about how to arrange them in memory. Even if you have to optimize for the CPU's read-ahead buffer and cache (which, again, is something you should only be doing in system programming, not in physics) just iterate by Z first and X last, and there you go.
Caring too much about such details will land you into trouble with a lot of other languages. E.g., a two-dimensional array in Java is a one-dimensional array of _pointers_ (ok, ok, "references") to one-dimensional arrays. And four-dimensional space/time will be an array of pointers to arrays of pointers to arrays of pointers to arrays of the actual values. The offsets are... well, all over the heap. There is no way to calculate the offsets by hand without writing some native library (and then wondering why it crashes your JVM) that can peek under Java's skirt to see the actual values of those pointers.
A polar bear is a cartesian bear after a coordinate transform.
I am a phd student in theoretical physics in germany. Saying it as it is, I did not need any programming skills that go beyond simple spreadsheet calculations until I started a semi-numerical project for my diploma/master thesis. Though I did a voluntary programming course at an undergrade stage I have to admit that I had almost forgotten everything at that time, even where my lecture notes are ;)
So - as with all the stuff you teach - if you want your students to learn programming, you also have to force them to use these skills later. Give them homework they can only solve using a computer in all/most of the succeding courses, otherwise they will simply forget everything they have learned.
I'm currently second year physics in Exeter, UK. In the first year everyone covered the basics of matlab. In the second year there was a choice between an several modules including electronics and scientific programming in C with the option to do a further module, in Computational Physics. Neither of the C modules were a requirement though - I ended up doing electronics instead but I have an option to do the first C module next year (I think).
What I was trying to get at (I think) is that for number crunching, row major layout makes more sense due to the layout in memory keeping a more sane locality with respect to 'left to right, top to bottom' reading of a multidimensional array. And like you said, this is a systems programming concern and not one of physics. But, it would probably suck for performance, on a large array, if you scan a row and blow your read aheads on every iteration and have to go back to RAM. Even more so if you have an SMP and have to worry about ping-ponging and coherency at the same time.
Also, IIRC, Java's arrays are immutable, which only makes them that much uglier. Although I don't know enough about JITs to even know if that's a Good Thing (SMP/multithreading win at the cost of GC?) or Bad Thing.
I should note that I've never programmed a single line of FORTRAN, the closest I've gotten to writing a 'real compiler' is parsing a toy language in ADA95, and if I had to write more than a single line of non-trivial assembly to save my life, I probably couldn't do it. View my comments from the point of view of a naive software development student, and they'll probably make a bit more sense
If I mod you up, it doesn't necessarily mean I agree with what you've said, sorry.
1. computers are inseparable part of modern economy
2. programming is everywhere - sms is a command line - so basic programming is inevitable
3. programming projects more than 1000 lines of ocde requires thought organisation and management skills. These skills are not taught as part of all other standard disciplines.
4. programming makes the difference between "where's the any key" people, bad managers, poor project plans.
5. Successful hacking at programs teaches you how to successfully hack around life's problems.
For reason 5 alone, programming must be a compulsory part of all vocational education.
"Creative vocations" can also take help from markup training.
10-15 years from now, if you want to make any kind of money respectably, you need to have many of the above skills, which means programming and hacking should make it into your brain in some way or the other.
[Of course, all my opinions. YMMV.]
Hackers have long memories. It works both ways.
I'm not sure what you mean by immutable in this context.
You can't change the size of an array once it's allocated (which simplifies memory management, rather than the JIT), but you can change its contents. I.e., it's certainly not the same kind of immutable as that of, say, String.
Re-allocating a larger array and copying the contents is only two lines of code, if that's what you had in mind, although, admittedly, it does involve an expensive array copy. I.e., it's probably not something you'd want to do in the inner loop of that 4-dimensional time-space calculation.
You can also reallocate the rows in a two-dimensional array (or generally any inner arrays in a multi-dimensional array), which can produce some funny stuff. E.g., if you have a 3 by 3 matrix of double, you can do: Producing a triangular array.
Or what did you mean?
A polar bear is a cartesian bear after a coordinate transform.
Could you give a more lengthy explanation for this?
Because I do use some 2+-dimensional arrays in my code right now, and everything seems to be running reliably and as fast as before...
Even my wife had to take Basic and Pascal - and she's a LAWYER !
Although, naturally, this is not in the US but in Russia.
If you fail to stop being afraid of teaching your students things that are useful to THIS society and not the society your parents used to live in, we will eat your lunch.
I think your society has to be very careful what you're aiming for, or any future work that require education and cerebral capacity WILL move to the regions where its amply provided - and right now it seems as though you're planning to fail.
Excel is indeed slow, and indeed will not teach you algorithms. However, if all you have time for is a few lectures as part of Lab class, or just crammed into some other intro class, Excel is about all you are going to be able to have time for.
As a bad analogy: A single-speed bike with recently removed training wheels isn't used in the Tour de France, but it is what many of us learned to ride on. Yeah, it doesn't teach you how to change gears and is slow, but it is still riding a bike.
SirWired
... And that is best done in a language with support for high level mathematical tools such as MATLAB/Maple or Octave/Mathematica if you want to go OSS.
Matlab allows you to use a C-like syntax without spending half a lifetime writing an adaptive RK-4 solver that can handle stiff equations. It allows students to quickly get on with what they need to do without much hassle, it teaches flow control and is very good to make simulations with.
Not to mention the widespread use of Matlab in the industry.
For pure physics students they're probably going to be doing simulations so Matlab/Octave/Maple etc are a valuable asset, much more so than being a C++ whizzkid (nothing wrong with that), and the occasional course in other software used in the field such as COMSOL MultiPhysics.
A good grounding in programming is vital in many area of physics, especially experimental physics for simulations and analysis.
Doing my physics doctorate I used a wide variety of languages and programs. These included C, C++, Matlab and, yes, Excel.
There are indeed times where Excel is a suitable tool for the job. It is a convenient way to store data and do simple analysis. It also allows easy notation of data which can be extremely helpful.
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.
I'm not going to read all the posts here. Just posting what the requirements were when I was studying for a M.Sc. in Engineering Physics in Sweden. (note that in Sweden we usually sign up for *either* a 3y B.Sc. or a 5y M.Sc)
A mandatory programming class. (back then it was Pascal and covered pointers and linked lists. That was later replaced with Java..)
Projects in many physics and maths courses that were to be completed in MATLAB.
Appart from that I took several other programming classes that were optional.
- BASIC (I didn't take this course as I already knew BASIC)
- FORTRAN (Some bunch of yawn assignments; this course was run by the CS department)
- Measurement and control (build a PID controller in software using Turbo C)
- C++ (3D graphics in Turbo C++)
- mc68000 assembly (3D graphics on an Atari ST)
- computer hardware (design and build your own 68008 system; write the ROM too)
- computational physics (gravitational collapse of a 10000 star globular cluster)
Those are roughly in chronological order, I think.Just as writing isn't a requirement for a literature degree, programming doesn't need to be a requirement for a degree in science. Sounds like wishful thinking on The Nerd's part.
Take for example my old school Boston University. They stopped teaching C/C++ for Electrical Engineering and Computer Systems Engineering majors ... and replaced C/C++ with Matlab. Why? I'm not sure why. Matlab is too slow and too inflexible to EVER be used as a finished commercial product. I would never have a job if I didn't have experience with C because the job I got does all C programming where performance is the number one priority and when it isn't the number one priority it is a close second.
... i guess old guys who never learned how to program properly will never make the right decision.
I point out how my old school made the wrong decision to show how decision making by colleges about programming languages
-----
I feel like your physics guys never learned how to program. And when they did... they learned excel... and that became what they thought of as a 'programming' language. So that is what is driving all the defensiveness in your department. ( I feel like the same thing happened in my old school with Matlab )
My suggestion is to make some really cool examples that illustrate why you need something more than Excel. Then it will become abundantly obvious.
-----
Which programming language would I suggest to you? Well physics tends to be more about research and less about speed and flexibility. So I would say something high level that lets you easily do complex operations. Like Matlab.
( p.s. Matlab is an elaborate script language in my opinion. Very elaborate... but still a script language in my opinion. And once again you could never have a commercial final product made with Matlab. )
My father is a physics lecturer in the UKâ(TM)s 3rd oldest university.
I think we need to keep most undergraduates away from low level (OK ⦠low levelish) languages like C. He doesnâ(TM)t think much of their basic numeracy skills â" never mind their ability to program a computer.
Im surprised by the comments saying that many of the programs use large datasets â" I would of thought it would be more in line with traditional number crunching with a few basic parameters fed into the application.
However if this is the case â" then why not just use Oracle? Any idiot can create a test schema with a few tables youv created yourself and load the data into them.
SQL/PLSQL within Oracle is pretty easy to use (especially if you are âoeonlyâ doing commutative mathematics and not complicated database work).
Most universities already use Oracle under a free license â" and even if they donâ(TM)t Oracle XE is free for databases under 4Gb.
But maybe fear of having to learn yet another language will put graduates offâ¦
You then had optional courses afterwards, one digital electronics (actually building circuits to do things like basic osscilliscope, calculator etc), and a advanced numerical analysis course (actually touched models eg protein folding, condensed matter lattice models, and various "advanced methods", simulated annealing, monte carlo, runge-kutta, etc) You had to do a project that took about a month of work to do as well, for example I did a simulated annealing optimized model of Lennard-Jones atoms with periodic boundary conditions.
Then again my school was consistently in the top three in the world on the ACM contests, and in general a geek friendly school (U of Waterloo in Canada). Definitely a big bias towards computers there.
I'm not an academic, but you should be able to fit in 50 hours of real programming somewhere in the third semester or so (somewhere near Math 3), no matter how your curriculum is designed. If done correctly this should be enough to get anyone going on the subject. Especially those smart enough to survive into the 3rd semester of physics. You can then let them sort out wether they want to emphasise in programming or not. A practicum or two in the lab later on will help each of them figure that out by themselves.
Take one of the faviourite PLs used in number crunching (since that's presumably the main area of physics programming), preferrably an open source implementation, and walk your sheep through SOPs of number crunching on various examples. Maybe have them do some practical stuff by having them optimize some outdated simulation algorithims for speed / efficiency. A little graphics stuff or maybe even an open physics 3D kit might be a neat extra if you have time to spare. I know of physics people and universities visualising stuff in Blender.
My 2 cents.
I'd suggest *nix or anything that somehow resembles a non-desktop super-computer OS - do *not* do the mistake and have your scholars mess around with MS Visual Studio or even Eclipse for that matter. We've got enough IT junkies as it is. Unless you yourself work in a field where a more generic PL like Java is actually used (which probalby is rather unusual). You want your students to gain knowledge of the principles and learn to apply them effectively when the need arises. And we all know that number crunching is about the most effective use of a computer in existance. No need to spoil the bastion of hard science with bad end-user habits that aren't really related to real math programming. This is about problem solving. Having them dick around with regular desktop OSes on lecture time is a complete waste of time.
As far as number crunching is concerned, I presume that most code doesn't go beyond a few hundred lines per module and that even OOP isn't an issue. Correct me if I'm wrong, but it's mostly procedural implementation of physics formulas. If so, leave OOP out and only get knowledgable low-level and C people on board from CS if you intend to ask for inter-disciplinary support. Considering all that it's probably best to just have them work with the command line and an editor. When they've learned the basics of automating tasks that way, they'll be very thankfull later on in their jobs.
We suffer more in our imagination than in reality. - Seneca
Yes, I know that will get a number of people out their chairs, but programming in this context is simply a skill you pick if you need it. I studied maths and physics, admittedly a while ago; programming is quite simply not the way to learn good research practise, and it is not relevant for your theoretical understanding. I personally think it is in many ways very wise not to teach programming as part of most science education - you have to learn to walk before you can run.
Because the slashdot crowd is going to immediately say python, ruby, scala, or whatever the "hip" new langauge is, no matter what the question is.
Also, the poster seems just as bad, foaming at the mouth about using excel and vb. There's nothing worse than dealing with a co-worker screaming at you about about open source when you're trying to make a decision on rational merits.
The truth is that you should be using something like matlab, or mathematica, only more geared towards physics. My school's statistics course uses the R package, a programming language, library, etc designed specifically for learning about statistics.
I bashed the people who would recommend python a bit ago, but python is actually a good bet for problems like this. I merely despise those who argue for python because it is "cool" and not for technical reasons.
Keep in mind that it's pretty easy to teach people about procedural programming, but things like object orientation, or how to do package management, operator overloading, or any nontrivial language feature is just going to get in the way of people not interested in programming langauges in and of themselves.
A beginners programming language should always have a means of
1. Assigning values to variables
2. doing arithmetic
3. calling predefined functions
4. if then style conditionals
For people that have *never* programmed before, these are the basics, and the only things that will come intuitively.
The next step up are loops, and writing your own functions, and dealing with arrays.
Do *not* use a language like java that requires you to be exposed to a number of unnecessary abstractions (classes, importing packages, defining methods, and lots of keywords like "static" that mean nothing to a beginner) to just write hello world.
Python is linguistically a good choice, because it has no boilerplate. However, python requires libraries to display graphics, (say of graphs of data that has been collected) which will be problematic. Thus, you will either want to create a python runtime with various convenience functions preimported, or use a different scripting language that already has things like a basic graph function already imported into the glabal namespace.
How to program a computer (ie knowing flow control) is essential for many (most?) technical fields today.
It is not at all uncommon to come across problems that are just unpractical to solve by hand. Solutions to large systems of differential equations is usually not something you want to solve by hand. And these systems arise quite frequently in science and engineering.
I just finished my degrees in Computer Engineering and Mathematics and I spent the better part of 1 semester doing some work with Diffusion Tensor Imaging. To get the tensor I did a multi linear regression with a system of 25 equations (at least in my case). Sure, I could have done it by hand, but I didn't, it just isn't practical.
Our math department didn't have any programming requirements due to their belief that "programming is Computer Science". Computer Science is most assuredly not just "programming". Programming is simply a tool, and it should be viewed as such.
A physics major arguing about what computer language is best is like an English major arguing pencil vs. ballpoint. It's just a freaking tool. The universe it's so darn complex you should be worrying about dark matter and time symmetry. That cool stuff that rocks. Computer languages are cool, but when it comes to string theory and black holes, a blackboard and a piece of chalk will do.
- these are not the droids you are looking for -
The basis for an undergraduate degree is to demonstrate and/or acquire the skills needed to learn a basic concept and build upon that foundation. There is a reason that there exists a computer science major. Physicists should not be required to learn how to program, but should be well versed in the ability to explain to a programmer what they need. It is why in post-graduate research things are done in teams...
Only three things are certain; death, taxes, and apocryphal quotations - Ben Franklin.
I would circle the (was) for FORTRAN being the language for engineering. FORTRAN does seem to be the language of choice for older engineers, but MATLAB is the language of choice for the younger engineers. Many of the older engineers have preconceived notions that FORTRAN code executes much faster than MATLAB code, but if you adequately vectorize MATLAB code (avoid "for" loops), the execution times are similar; however, with MATLAB editing code is quicker (no recompiling), generating figures is easier, and it is amazing how many routines you can find for MATLAB. As a disclaimer I must say that I have limited experience with FORTRAN (learned C and MATLAB in Engineering school), but some of the people I work with have many older programs written in FORTRAN and they tend to use MATLAB for new simulations.
Back in 1985, I developed a course for our geology majors I called Computer Applications in Geology, in which students were required to write programs to perform various types of calculations that one encounters in geology. Students were allowed to use any programming language they knew (and would run on the computer lab's IBM PCs or the Apple ][+ in my office). I spent one lecture introducing the PC, another on BASIC (for those students who didn't already know a programming language). Each week, I'd spend one lecture describing the algorithm, then turn the students loose to actually write their programs. I didn't worry about coding style (that was the domain of the CS department, and I didn't want to step on their toes), only whether or not the program worked properly. Given that introductory programming courses today aren't a whole lot different (except, perhaps, for the language taught) from those offered 30 years ago, I'd probably offer something similar to my 1985 course today were I still teaching.
Geology - it's not rocket science; it's rock science
I am also a new faculty member at a very well-ranked university. My background is in computer science and biology. I cannot imagine doing any biology (*forget* physics) without knowing how to program.
There is only one language that is required: MATLAB. That's it.
Unfortunately, MATLAB provides a very good environment for doing scientific calculations, but it isn't a particularly good language from the CS viewpoint, and it really isn't very efficient at all. So to manage big data sets (as I encounter from time to time in biology, and imagine that you would see in physics), you need to be able to program in something like C/C++ for efficiency. Most people don't however. I've known one colleague who had absolutley no programming knowledge, and he got by through hiring a programmer. Not the best of situations.
A good physics curriculum, being more closely related to mathematics than biology by a long shot, should include proper training in higher level languages. Choose what you want, but Scheme is a fantastic educational tool and has a better developed pedagogy than any other language (note I wrote "better developed" not "more extensive"; quantity is not the same as quality). It also has been used to solve some really hairy physics problems (eg, proving that the orbit of Pluto is chaotic by doing extremely high fidelity N-body simulations spanning millions of years).
But since you're probably not at MIT, teaching C++ is probably as good as you're going to get for a theoretically somewhat advanced language. MATLAB, however, will have much more practical utility.
Just scan through Science or Nature and check, when the authors specify, which language they use. It will be either MATLAB or LabView. I find LabView difficult to do anything more than toy applications (and I'm not alone in this, having seen two separate teams of colleagues struggle with their large computationally intensive projects in LabView). And MATLAB is the Lingua Franca of scientific analysis.
Put my fist through my alarm clock with its ding-dong death inside my ear. - The Blackjacks.
In all honesty, It should not be required for physics majors to take a programming course (Newton and Einstein didnt need to). Sure its a helpful tool that will make your work easier, But the whole goal of a physics course is to learn the concepts, theories and equations that will help you understand Physics.
Physics itself is really the all purpose science (my Girlfriend had to take it for here Biology major). Those who want to specialize in Physics, should take programming classes to help them get that edge in a research project.
Think of it this way, I'm a web developer (PHP, JS, PERL, and learning Python), I'm not a designer, However, I know how to Cut a Layered PSD, Work with CSS, code the form, and set up the web server. All are normally handled on there own by a single person or team. The reason why I taught myself all those tasks is so that I understand the whole web process from start to finish.
Imagine telling you mechanic that he now has to learn Electrical Engineering, and Computer Science because all cars nowadays have Computer controlled components in them. When really all he needs to do is know how to install that part when he needs to replace it. He is not going to go and take the time to figure out that part failed because a Diode failed, or there is a flaw in the logic.
Academic Physics Departments introductory teaching and texts have evolved to some of the most boring materials ever published. It is a nature of the collective culture that has evolved in these socialist kingdoms to toss out anything good or challenging because it would require work and create friction with the bulk of the retired(tenured) staff. Eliminating tenure or possibly salaries would improve the teaching. Programming for physics should be at most a one credit course and simply be used in all the courses with the responsibility on the student.
I've just finished the first year of my physics degree.
It so happens that I've been programming for a couple of years, and I'm reasonably proficient in C, the language they chose to teach us.
The programing course was split into two sections, weekly lab sessions, and lectures.
Talking to friends, the lectures were next to useless. The lecturer would basically just read globs of code, or spend hours talking about such complex things as 'if' statments. When I asked someone I was helping if they had gone to the lectures, the whole room stated laughing... Lectures don't work.
The Lab sessions were good, they gave us examples, and told us to get on with it. There were plenty of people there to help if we needed it, which was great.
The only problem was the syntax. Everyone I spoke to was far more obsessed with the syntax of C, non of them were thinking about what they were actually doing, there was next to no thought for flow control. C is just to picky a language. Fine for a second year course, but in an intoduction to programming concepts it's just distracting.
My advice then is to give your students practical experiance with something simple such as python at first, then move them onto something like C or Fortran.
Just my $0.02
Starting as a physics major 20 years ago at a lowly liberal arts school (JMU - ok, not so lowly, but the physics dept was still small with only 10 majors / year), I had the requirement of taking numerical methods programming with Fortran (we used Flex Fortran, some of the features of which eventually ended up in Fortran 90).
"But remember, most lynch mobs aren't this nice." (H.Simpson)
-- Joe
When I was an undergrad for mechanical engineering, the engineering department reached a compromise with the university that a course in computer programing could be substituted for the core requirement of philosophy of logic. This substitution was allowed for students in any college in the university, but most non-engineers took the logic course because it was rumored to be much easier. Computer programing was required for engineers; I don't know if it was required in any other sciences.
I was taught MATLAB for a semester and then given a conversion sheet for functions in other languages. I found that I can understand most programing languages, but am only good at writing code in BASIC or similar. The only one that I have a real problem with is JAVA (that I'm aware of, I haven't tried Perl or Python). I also found that MATLAB is widely used in my field in industry (thermo).
I also had a thermo class in which our professor decided to challenge the grad students in the class by having them write their simulations in a different language each time. They constantly wined that it was a class in thermo and not programing. I tend to agree with them, but part of me also thinks that they are much better engineers because of it.
One of our competitors trademarked the term "hypothesis". From now on, we will call them "boneheaded ideas".
I agree that knowledge of SQL is hugely usefull in nearly any field of Science and Engineering.
I left school with an Electrical Engineering Degree 4 years ago with 0 experience with Database languages such as SQL and had to learn these things on the fly. Fortunately, it is not essential to learn every language out there all at once.
A good knowledge of the basics (C/C++ and numerical methods) goes a long way and can be used as a springboard to other skills.
You should leave school with the ability to pick up new languages as the need arises, but this requires at least some exposure to these ideas. (Matlab is a fantastic way to become exposed to programming)
When you understand why you dismiss all the other possible gods, you will understand why I dismiss yours-Stephen Roberts
It really depends on what you intend to do with your degree. For general use, and some research programming is not needed. There are things it will help with, but you can cope. A little bit more time, and a spreadsheet will let you do all the data crunching needed. For theoretical work, it is a must. That field essentially ensures that you will be either writing code, or writing code to run on an available modeling suite. Either way, the more you know of programming the easier it is. I got a PhD in an engineering discipline w/o ever learning to code 2 years ago. It is not essential, but it can help out a lot and save time. I did all my number crunching in Excel w/o Macros mainly because each data set was different and there weren't that many to justify learning a language for it. My biggest issue is that each professor in U-grad was into a different suite, so I'd learn what was necessary for that suite at the time. Learn some Matlab, learn some Mathematica, learn some Maple, etc. then never use it again for 3 years and forget it. Not that they are hardcore programming languages but serve the purpose. If I did it again, I'd learn a language earlier so it'd be available to me. It is also a valuable skill to employers.
Origin does make much nicer graphs than Excel every could dream of though.
Personally, I can't imagine a curriculum that doesn't include it. I was mostly baffled by physics until I started writing programs to simulate it.
I find it quite odd that you can have NO requirement for even a basic software development course. Heck, it was a requirement where I went in 1980!!! Every A&S student had to take a 3 credit programming course (which was FORTRAN back then).
There are quite a few reasons why Physics majors in particular REALLY need to be exposed to computer science. Maybe they don't need to learn much programming, but there are critical things they DO need to understand. They need to understand computer systems architecture, because it is going to have a significant impact on what they can and can't do computationally. Beyond that virtually all data is processed by computers today and they REALLY have to understand the limitations and pitfalls inherent in data processing. This is a very non-trivial subject in and of itself, and one that you simply cannot grasp without a fairly detailed understanding of what goes on inside a modern digital computer.
Beyond that the logical problem solving skills and general mental discipline required are good. And one can achieve a good bit of insight into some areas of higher math by practical exposure to numerical processing and computer algebra.
Besides, 95% of these people will end up working in industry where they WILL have to work on practical problems and they WILL find that they need coding skills or at least an understanding of what is involved.
There's nothing WRONG with learning Excel. I think you should consider that a handy tool, but just one amongst many. It is not a substitute for understanding software or learning a programming language. Sure, there is some overlap, but tools like Excel are all about HIDING the things that go on behind the scenes inside the machine, and those are exactly the things someone needs to understand if they're going to successfully use computers in science.
So, sure, students can learn Excel, but it shouldn't substitute for a programming class. Personally I think there should be a specific course designed to teach science majors about data processing in general. It can cover Excel as well as Matlab, and provide an introduction to programming as well as system architecture, data reduction and analysis techniques, etc.
"Malo periculosam, libertatem quam quietam servitutem." -- Jefferson
The price of freedom of expression is now often jail. But then this is an old idea. Just ask the ghost of Mohandas Ghandi!, Nelson Mandela!, Jon Johannsen! Having said that, I was a teacher in a religious school run by the Lutheran Church. There philosophy was not to teach programming. This was not original, as the principal behind this idea had a wife with a business relationship on an executive level with microsoft, and the two probably had a vested financial interest in using Parish funds for personal gain. Both sides of the deal gained. The family of the principal gained graft; the micro$$ corp gained ill gotten profit; and the only losers were the students who did not realize that they were being cheated of a quality background in real programming. To be truthful, most of those students could'nt have cared less, viewing their time in the computer labs as a fun time to talk, to send notes, and to surrepititiousely listen to music on the internet (taking advantage of multitasking and its ability to hide background tasks from the ordinary teacher not technically backgrounded enough to know what to look for. None of my fellow teachers save for one had a clue to even using Excell, much less programming in it, and none of them even remembered the simplest computer languages, like BASIC, that older computer users from the early eighties used and loved on simpler computers like the TRS-80, the Commodore VIC64, and the Apple ][+ that we all used then. We all knew BASIC then, and some studied Pascal?! We were given a better education at home and self taught by so called 'primitive machines' than all the spying corporate windowing machines in the world today. Today's computers do not teach, they spy, denounce, and foster foreign tyrannies into American homes. The refusal of micro$$ to get behind programming....they USED to have GWBasic on all their early windows offerings, like win2.0 thru win3x.... may be traced by an unholy alliance of micro$ and the DRM cartel today (RIAA, MPAA, ad nauseum) In truth, the corporate cartels making fantastic billions from computers today really do not want the average person to even legally be able to know how to program, especially outside of a sandboxed corporate profit product like Excel. Why to program is to know how to 'hack' or to 'break DRM', and this constitutes a kind of 'burglar tool' for 'penetrating their systems'. Under this kind of system, only a select corporate security cleared few will be allowed to even possess an instruction book, much less a machiine able to create, compile, and run programs. Linux has much to fear from these politically connected cartels that are busy today creating armies of deluded robots of limited and stultified abilities in schools all across the world. Such robots are constantly propagandized with corporate party lines using methods straight out of "Mein Kampf" and Hitlers propagandist Doktor Joseph Goebells. Words like 'piracy' and others have been redefined and perverted in their meanings and endlessly repeated, just like Hitler advised his party Gau's to do in his "Table Talk" in the 1930's. Eventually the targets of this vicious propaganization come to have Orwellian religious belief in this nonreason, and are willing to accept without question the concommittant redefinition of "black as white, Heaven as Hell, and Hell as Heaven" as stated in Mein Kampf! This is the real reason that those books are locked up in backs of university libraries everywhere. These books contain ideas that are being used on us today, effectively. Their instruction in the arts of propaganda are the real 'classified information', and propaganda is a weapon wielded with equal destructiveness by its users at any target they like. Programmers today are being silently liquidated as a class, to quote Joseph Stalin, to accomplish goals of the IT cartel. We will all be the losers for it, for these monsters control only the United States and not the world, and the curtain of darkness that they are drawing across the land extends only the borders of the English speaking countries, transgressing them only briefly. One day a vastly poorer and dispossessed populace will discover the true depths of their being deceived.
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)
We've been going through a process of evaluating this very question as we start to set up a general access course for "Programming for Science" as part of our graduate student access courses. This would be in addition to our Java and C++ specific courses, along with XML/XSL and SPSS/Matlab (we've also just started up a LaTeX course which is heavily over subscribed - validating a 3 year long campaign!).
So far we've come up with the following generally applicable core:
Software Engineering (software lifecycle, reqs/specs, quite high level and generic)
Web programming (PHP / MySQL)
Procedural Programming (Perl - possibly some python - VPython is very useful)
Maths / Stats (Matlab / SPSS)
Declarative Programming (XSL)
This covers the most commonly requested ground and the specs have had good feedback from Heads of Schools and Student reps. It'll probably be a 20 class course - still finessing details
I don't usually take the time to write a comment on Slashdot stories but this one has hit home. I am a physics graduate student now here in the U.S. and I find it amazing that there is not computer programming course requirements. Now that is not completely true. We have a course called computational where the students are supposed to use a computer language to solve various physics situations. The course has a prerequisite of computer programming if the student is not competent, but I have never heard of a student actually taking the programming course. They just complain that the course is hard and get other people to help drag them though the course. Very aggravating to see that happen.
I agree with other posters that it does not matter which language is learned, but it is the technique that matters. One thing of importance though is the idea of object oriented coding. I have had to help people who where Fortran coders trying to write C++ code using an API that an experiment wrote (Go D0!) So I think that at least one semester should be dedicated to programming techniques and data structures and then an additional semester for programming tools and how to use the effectively. The productivity would go up pretty quick if these two classes were required.
SIGSEGV caught, terminating
wait... not that kind of sig.
At my university we have a computational physics course, which focuses on solving differential equations, and numerical methods to solving problems. In this course we worked in IDL and Mathematica (previous years also had a LaTex component, this year we had a new teacher, and were left to learn LaTex on our own, while covering more material). We also have a mathematical methods course and an advanced computational physics course, both of which are highly encouraged (though I haven't taken them yet). I feel that learning the concept of how to do physics computationally is better than which tools you use, but I also think that it is important to have an exposure to many languages at the undergraduate level, so that when you get where you're going, you aren't starting from scratch. At the very least, students should learn how to look up what they want to implement, to figure out how to do it.
Back in the stone age ('82 or so) my physics program required a year of introductory programming, and the math program required just a junior-level class in numeric methods. Or maybe it was the other way around. Either way we still did almost everything in both programs in the classical way.
I noticed something interesting in the our CS classes, though. We caught the programming aspects in about a week. Our classmates struggled with the math all semester. But they did better on the presentation, even when their answers were wrong.
This makes sense, when you think about it. Proofs are analogous to programs in a very high-level language -- with extremely strict compilers. Anyone who's survived several years of physics will be comfortable writing software, so you can collapse several CS courses into a single term.
The key is what you keep. Having worked as a software developer working with PhD-level scientists, I think it's fairly simple -- algorithms, data structures and numeric methods. The guys who stayed in science could "write software", but it was usually pretty bad from a CS perspective. A few simple data structures, a few standard optimizations and the code would be much faster and more reliable. The scientists didn't need to know these things well, but it would have helped tremendously if they knew they -existed- so they would know they could ask the right questions later.
For every complex problem there is an answer that is clear, simple, and wrong. -- H L Mencken
Good luck getting a literature degree without writing anything.
The Kruger Dunning explains most post on
If it were my call, scientists would be required to take a statistics nee optimization course, whose course required the use of the R programming language: http://en.wikipedia.org/wiki/R_programming_language. R combines research grade tools with a language much like Scheme. It has interesting concepts for creating data sets and manipulating them. Finally, some of the algorithms available in this environment simply couldn't be written by a clever student with a semester of comp sci and a copy of "Numerical Recipes".
More info here:
http://www.r-project.org/
I already have a literature degree and I took zero writing classes in college. What I meant was that you don't have to take classes in Writing to be able to write well enough for college level Literature classes. I assume the same applies for programming and science. I see a lot of other posts stating the same (i.e., learn programming in High School, don't waste time on it in college).
As a physics (BS) and EE (MS) major I agree completely. There has been nothing in either major university degree program that Matlab wasn't able to do just fine. Unless you are doing hardcore lab data-crunching for your grad thesis work, I can't imagine that one would ever need anything more.
I have on occasion used Mathmatica, Maple, and Mathcad as alternatives, but only because they were a little easier for the task at hand, but Matlab still would have sufficed.
The Physics degree is a theoretical and conceptual curriculum, very heavy in math and logic, but it is not a CS degree.
----- And all that the Lorax left here in this mess was a small pile of rocks, with one word...UNLESS.
Yes, you can write major applications using excel and VBA. You can also build houses using legos. Neither is a very efficient approach.
When I started as a freshman Physics student in 1969 we were required to take Fortran. After almost 40 years of working in Scientific Applications Programing I'm convinced that introductory programing should be taught using pseudo code so that a student learns concepts and structure separately from the syntax of any given language. Once you know the logic of programing, and the particular problem that you need to solve, then you can make an intelligent choice about what tool (language) to use to solve the problem. The one that you are most familiar with is NOT necessarily the best tool available.
Matlab has always been a tool for crunching numbers. Nothing more, nothing less. It excels at matrix calculations, or parallel scalar computations. It has limited symbolic capabilities, from it's Maple integration. It has only a few real intended uses: scripts to perform simulations, common calculations, etc, and command line one-off tasks. Now don't get me wrong, when I say calculations I am including things like image manipulation and processing (it works very well for that) and other DSP style tasks, and much more, but it is still a calculation tool. Matlab is not a programming tool! It should be thought of as closer related to the other mathematics tools like Maple, MathCad, and Mathematica.
Now it is quite common for Schools to include Matlab in an Engineering Curriculum. The idea being that Matlab is what they will most likely use for most number crunching in the future. Your school decided that learning how to do numerical calculations was more important than learning to program. For EE that is probably the case. They also erroneously believe that because Matlab has some programming-style control structures teaching it doubles as a basic programming course. That part is the problem.
Stylish sheet to fix many problems in Slashdot's D3: https://gist.github.com/801524
e.g. give a try at the science examples provided at http://www.funsciencewithyourcomputer.org
The site uses short Java programs. It contains instructions to run them inside the free Eclipse IDE. Instead of asking users to understand every line of the code, it's focused on editing small parts and immediately see the effect. It helps to have a Java guru to get things setup the first time though.
I found it fun to see how PI could be estimated using random numbers. Computers can help make Science feel 'real' to students, i.e. experiment and see what happens...
I also built an instance of LIFE in Excel, using conditional formatting, the SUM function, and the IF function. Turned off autmoatic recalculation and F9'd each generation.
Did it work? Yes
Was it quick and dirty? Yes.
From a programmer's perspective, it was Fugly. But from an Excel user's standpoint, it was nifty... I guess.
Your friend who wrote a LIFE instance in Excel did not use the correct tools in Excel. He used stored VB code instead of native functions -- bad move.
So my point is this:
While any programming language has its strengths and weakness (and boy, does Excel/VBA have a lot of weaknesses as a programming language), the programmer's skill with, and understanding of, a language will often determine whether a particular language can be used effectively for a given task.
I've written instances of LIFE in Excel (5-6 years ago -- no VB needed, except when I wanted to automate generations, add in extra options, etc), Pascal (about 15 years ago), Basic (about 18-20 years ago). I'm not a professional developer (obviously
Use the right tool for the job. If you have no experience using a band saw, then it is not the right tool, and you should stick to the hacksaw.
[1] This is probably becuase Excel is the tool I use most on a daily basis. YMMV.
"Trolls they were, but filled with the evil will of their master: a fell race..." -- J.R.R. Tolkien on Olog-hai
Many years ago I taught Pascal. I got into an argument with another faculty member who wanted to teach C. His argument was that it was more useful in the real world. I agree with that, but I thought it was more important to have the first language be one that was strict about doing things right. I've used (and taught) many languages since then, and I've seen many clever students who would have been better programmers if they had started with a language that disciplined them as Pascal would have.
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.
[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.]
Did these techniques come from programming or did programming come from these techniques? Programming is simply a tool like a calculator. Science methods are learned, but not by being one with programming.
I once managed to code Langtons Ant in Excel, with Visual Basic. Of course, thats far easier as it is only a single point changing each iteration. When I tried to do more complicated cellular automata things slowed right down. This was when I was young and foolish!
Anyway, I'm currently an undergrad at Oxford, studying physics. We study C programming in the first year as part of the practical course. They specifically don't teach C++ due to time constraints - they dont want to rush it. Some people get it, others struggle. I was one of the lucky ones, possibly because I already had a little experience.
I feel that programming should definitely be taught, in some guise or another. It provides a different way of thinking about things, and whichever language you learn you will find others easier to pick up. So as a part of the first year course it works very well, teaching students to think things through.
Haskell should appeal to their sense of mathematical beauty. It is an efficient, terse, and pure language.
Another more mainstream but similar language is Scala.
Don't forget Structure and Interpretation of Computer Programs -- required freshman course at MIT. All course materials online.
By the way, a really fantastic introduction to programming for kids is Scratch.
Well my physics undergrad course was PASCAL...and an additional numerical methods course. Served me quite well....then in grad school (physics) I picked up C and a tiny amount of Fortran. My classes and advisers didn't care that I did some homework with a combination of C and Mathematica. I had one adviser get huffy that I didn't use C (actually Fortran I think) to do some numerical potential modelling for my thesis, but my main adviser was happy to let me use Mathematica.... A language (visual basic is surprisingly powerful) is definitely a necessity for a physics undergrad course...but it has to be a complete language..not just a scripting thing like running a macro in Excel. The systematic thinking makes other languages a piece of cake to learn...and obviously helps with problem-solving skills.
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.
I'm not a physicist, but a computer scientist. So I'd really stay away from the programming language specific teaching.
I'd recommend to at least make sure a physics student understands the limitations of computational math (rounding errors, error propagation, etc.) and the algorithmic computational theory (O-notation, etc.).
Of practical value should also be to understand parallel computing and how to split large problems into smaller one's that can be computed separately (in parallel).
Another important aspect for any science student should be data bases and SQL, may be even some OLAP design. And also here a hint of performance implications.
Busy helping non technical users of OpenOffice.org - http://plan-b-for-openoffice.org/
If you aren't going to teach your students computational physics, don't waste your time teaching them. Computation is so pervasive in science that if they can't translate their ideas/equations into computational algorithms, they will simply not be competitive. Computers are to science what chalkboards and pencils used to be. They are essential tools to performing research. I'm not just talking about Excel or even Matlab either. I'm talking High Performance Computing. During their careers, today's science graduate students will be forced to run their codes on compute clusters with thousands of processors (and that's just in the near term). You, as their professor, need to make sure they have the tools they will need. Things like basic knowledge of languages like C/C++, F90, and python/perl; MPI programming techniques (and probably OpenMP which may be making a comeback); parallel application debugging; and supercomputer hardware architectures (including parallel filesystems). They don't have to be guru's, but they do need enough exposure to give them a starting point. Not giving them some basic skills in HPC is like not teaching them calculus.
Physicists, with all their number crunching simulations and calculations, will make more use of computers than most people. If they want to make any important decisions about when and where to use computers, they'll need to understand what computers are capable of and have some understanding of how difficult it is to make computers do different tasks, and be able to understand what computer geeks tell them about the memory requirements of performing a simulation of every particle in the universe.
The best way to achieve this is to require the physics students to take a programming 101 class in a procedural language like FORTRAN, Java, or C.
I often don't like the choices people make, but I like the fact that people make choices. That's why I'm a conservative.
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.
Being a graduate student in astrophysics (currently working as a game-programmer) in a Denmark - here are my 5 cents:
Learn a programming language - like you would learn mathematics - it's a handy tool, you'll need it. FORTRAN 90/95/03 and IDL are the most handy programming languages in that respect, bacause of tradition.
Apart from that - do whatever works for you. No matter what - you'll need concentration and pen and paper.
...accounting firms absolutely do NOT (in general) stay away from excel!
...excel is probably one of the most widely used tools by engineers.Okay, I now see where you're coming from.
In annual financial reports, accounting firms will, in general, say that any value between $9,550 and $10,450 is $10,000. In that same sense, I'm sure they do often use excel.
I know first hand (from my father and his colleagues) that engineers most commonly use 3 as the value of pi in first-pass rough analysis work. So I'm sure engineers also use excel quite a bit.
well, maybe back in the day, but even first pass stuff is a lot more accurate than that these days...
...of course [excel's usage is] (generally) validated and displaced with higher fidelity analysis and testing as appropriate when the design matures.Whew! So about the time my Dad would stop doing the numbers in his head and reach for his sliderule, today's aerospace engineers drop excel in favor of something with more than one significant digit of accuracy. That's reassuring. Truly.
well, you get the basic idea, but excel is used for stuff way higher fidelity than that- what's considered low fidelity these days would have been relatively high fidelity back in the day.Admittedly, this is the same kind of argument as 'nobody ever got fired for buying IBM equipment'.
Today's high school students are a tough sell when it comes to taking programming electives. They've all grown up with Xboxes, Playstations, Cell Phones, web 2.0. When they find out that it takes a page of complicated code to move a square across the monitor (Looking at you Java!), they leave the class.
Back in the early eighties, there was no World of Warcraft. Atari had just come out. Not everyone had an Apple IIe or Commodore computer. So programming classes were really cool (well, compared to today). It was easy to impress a high school student.
I think that India and China are going through what we did in the eighties. When you are poor as dirt, and a computer is really cool, then there's a larger pool of applicants.
So you are finding less and less people that have any programming background entering today's universities. You won't get many people in science excited about using programming.
Slash dotters seem to want to ignore the value of Excel. The writer calls Excel a cartoon. Excel, and, more specifically, Visual Basic for Excel is about the most useful tool ever made by MS. You can load a spreadsheet with data, hack up a macro, debug the macro in minutes, (what other IDE lets you change your code while stepping through it???), and there you have it: data in whatever format and computaional structure you can imagine. Nothing I know of is even close in pure utility to Excel thanks to its Visual Basic extension. Sure, for 3D modeling, you need something like VPython, but a lot of real world stuff is more mundane. I think any scientist and engineer should have this tool in his belt.
Social Credit would solve everything...
if you're just tossing numbers about, then a spreadsheet like excel might work. But it's going to require some bending to get some jobs done, and bending it will make it brittle...
I've really come to value Python. Once you learn it, it's easy to write code in, and it's relatively easy to read other people's code. But I wonder, though, if it's really good enough for some high-caliber applications. It would be embarrassing to do some scientific work that later falls down under peer review because of faulty programming. That why I wonder if Ada/Spark wouldn't be better in many applications. Because it's so explicit, you can learn a lot just by reading the code. You can extend the work that others have done, people who you never even get to talk to about their code. But I have to admit I haven't learned Spark yet, but it fascinates me. Maybe it would be too painful for a lot of physics students to learn, but the pain might end up being worth it in the long run, when it comes time actually putting that physics to real world applications. Real world applications of physics these days are often very expensive places to make mistakes, so quality code is a must. And, nothing says quality like Ada/Spark.
I also believe that 'whatever floats your boat' is the wrong answer. Trying to make various code that students and researchers have written in a variety of different language is a nightmare, especially when the programmers have moved on to other projects and different institutions.
As a past physics major here, the physics department I was in taught C and FORTRAN in our Computational Methods class (which was required for the degree) and required that all students take the Intro to Programming class, which is a really shitty introduction to C++. I was able to acquire a waiver that allowed me to skip out of Intro to Programming class due to my 1337 linux h4x0r skillz (in reality, I talked to the professor teaching the class and got a recommendation based on my past experience in programming)
I am just a lowly middle school science teacher, but my take is that these kids need all the help they can get in learning how to think. One of my objectives is my students need to learn how to think like a scientist. What better way to help these kids learn about thinking than learning about programming! These kids are in the computer age and donâ(TM)t know how they work. I have just received a mobile lab for my classes next year and want to develop a unit on thinking using computer programming. I think therefore I amâ¦.
Yo dawg, I heard you like the Ackermann function, so OH GOD OH GOD OH GOD
I appreciate seeing this cross-reference--thanks for posting it.
However, I do disagree with your conclusion. The regions of non-conformance that Excel cites are issues that are commonly discussed and sometimes actively disputed, and in any case that often require very skilled understanding to navigate. Although I've not been in on any internal discussions at Microsoft about how they organize their product line and who they intend to sell to, I feel confident in saying that Excel's target customer is not typifically a physics student. This is a product for business, and the mathematics of binary-coded decimal (BCD) seems more appropriate to its intended end, even if they don't actually use BCD in practice, probably for efficiency or convenience. But the banking community is not wrong in preferring to do things in variance from IEEE's floating point standard either.
Note that Microsoft has not assigned an incompatible meaning to the situations on which they don't conform (although it might not be unreasonable if they did), it has merely said that it doesn't support some cases. I actually think that even the brief passage you cite offers credible justifications for their decisions. (I'm frankly surprised that the things they do are classified as non-conformances. There are other standards where the decision to simply not implement part of a standard and to signal an error in that case is considered a subset and therefore to be strictly conforming. Maybe there is some subtle way they deviate, or maybe they're just being careful in classifying what they did as non-conforming when it's really a judgment call so they aren't accused of hiding the issue.)
But back to the point of this thread, there are two take-home points:
(1) Excel does not seem to me an appropriate first choice as a tool for doing math or science, and especially as a tool for learning about that. A program in those areas should pick one or more tools that accommodate the notation, computational power, library base, and other factors required to support serious computations.
(2) Students of math and science should be taught not that there is one particular way that numerical computation is done, but rather should be taught why fixed point / BCD is different than floating point / IEEE 754 so that they can make informed decisions about which tools suffice in which circumstances. For that matter, I'd also like them to understand the difference between numeric computation and symbolic computation, and why each of those has its place. School ought not be about dispensing dogma. It ought to be about preparing people to be good decision makers as circumstances change.
Kent M Pitman
Philosopher, Technologist, Writer
I have a 3D space sim implemented in Python here: Spacecommander
It isn't the most sophisticated thing you've ever seen, but its definately pretty sciency. Personally I think that the vector math and matrix transformations are pretty cool if you take a minute to stop and think about the amount of data that the program is processing while it runs.
Clickety Click
Someone on the thread said "when you're only tool is a hammer..." and I think that HAS to be true here. Using Excel/VBA as the first programming language environment for physics majors sounds akin to forcing them to hand in their pen-and-paper numerical assignments with calculations done in Roman numerals.
There's many ways to skin a cat, but it seems to be that the OP's university/college really needs to have an in-department numerical methods/programming course, not a course taught by CS people. At my undergrad physics department, we had that (circa 1992 for me). It was way more useful as a pragmatic course than a numerical methods theory course alone would have been, although it blended a good deal of theory, and it considered most of the problems in a physics programming context and not a CS context. Most students at the time had NOT had a formal course in programming (though I had had two), but most had programmed a bit on their own, lightly.
Our course was patterned on Numerical Recipes perhaps 1/3 of the time. We also had Bevington's book. I agree with other posters on the thread that Numerical Recipes may not be a useful construct for 100% of the material in such a course. I definitely think Bevington would not be a good choice in 2008, although at the time it was appropriate. I also agree that the language doesn't matter. We weren't railroaded entirely into Fortran, but it was clear that the prof knew only Fortran, so there was some pressure in that direction. A course in 2008 could still use 1/3 of its material from NR and cull the rest from elsewhere, I think.
This course is useful around the time of say second semester sophomore year. In my undergrad physics dept, we also had a senior lab course and there was usually data analysis and programming as a heavy component. At that time this was again done off of Bevington, which to reiterate is now fairly outmoded. One main reason for the introduction of the programming course appears to have been that most students a few years earlier than me were having trouble doing programming to analyze a semester's worth of data in one or two weeks since they hadn't already done any real scientific programming before.
I'm studying civil engineer in technical physics at the norwegian university of technology and science, NTNU. At undergraduate level we learn pure object oriented programming languages like ANSI C/C++, courses from the institute of computer science. I'd really appreciate these courses, knowledge of elementary computer programming is a necessary tool for any serious scientist in these modern times.
Besides, I already had a deep passion for POOP before I headed for the university. At my spare time I work on some open source projects, which requires more than an average skill in computer science.
I'm a physics undergrad at Guilford College. We are taught LaTeX (and are required to use it to write lab reports) starting week one of the first introductory physics class. In the second class we are introduced to MatLab, where we design a Newton Half Step program that is then integrated into the presentation of the material; this technique enables the learning of new subjects; we learn to program within a scientific context without being required to take an extra class (read: no physics classes are replaced by a CompSci class, and the physics classes we take are enhanced due to the programming exposure). By the fourth semester (max) we take Mathematical Physics, which is primarily taught through MatLab; through that, we get quite a bit of data structures and other prog. elements that are useful, while learning powerful tools that are used throughout the field. Sure, I would agree learning some C++ (I'm also a Math and Computer Science major) would be very useful, and in fact we (physics students at Guilford) are encouraged to do so, but I think that learning basic programming in a physics context enables the learning of physics; after all, as a physics student I have performed an experiment on this process, and the result is within two sigma :-)
> "how is this handled in other parts of the world?"
At the University of Bergen, Norway, all physics students has to take "Computer programming for science" which is programming in Python.
I'm just graduating, and on my course they mainly used Visual Basic 6 and Mathematica. I have no beef with Mathematica at all - it's one of the nicest pieces of software I've ever used. But teaching VB6 was a rather dumb move - it was dying at the time, it's slow as hell when dealing with equation solvers (as I can attest when running the Metropolis method on it), and the most important thing is that it's not portable in the slightest. Also, it's not easily available - I found I had to give everyone VB6 copies for them to be able to do the coursework, as the newest version, .NET was completely incompatible with anything we were doing!
I remember one of my professors saying they were proud they had taught us to code, but most of the stuff I know is from before college when I was messing around with C++!
They are getting a bit better, though - we have a new department head who realizes VB6 sort of sucks and is changing to pure Mathematica...
I'm on a curriculum committee for a local college, and the Excel argument holds a certain amount of water...at the community college level.
I agree with the writer that a university-level program in physics or chemistry, especially one involving basic research, needs more. Programming should certainly be included. It's a basic tool of the trade and in addition, the associated skills it teaches will find application throughout the student's life.
And I speak, by the way, as someone whose lack of programming skills has been an impediment at certain times during my career.
I've calculated my velocity with such exquisite precision that I have no idea where I am.
I'm a former mainframe programmer in the business world. I have seen Fortran, Python, and a couple of the other things mentioned here. Frankly, if all you need is a way to get reports from your data, you can not go wrong with Easytrieve Plus. Yes, you can do some math functions with it, but nothing too fancy, that's not my point. If you want to do statistical functions, it's in there. But again, fancy graphs are not included. Easytrieve's strength is it's fixed logic cycle, which takes a lot of the grunt work out of producing a simple report. The only cons against Easytrieve, are it's limited platform availability. I'm not sure of the cost, but I'm pretty sure that it's not what I'd consider "free". Zippy
My European based science education lies some years back by now. Those days it was expected to get to grips with Fortran somehow with no compulsory courses offered. Later in the career we had to administrate the computing environment as well. I can't imagine that a scientist can be successful without sound programming skills. I think a start with C is preferable since it is very versatile and base of many Unix/Linux programs. Furthermore C++ as well as scripting languages like Perl, shell scripting are desirable.
Yep. I will admit sometimes it was slow, but that was more due to network lag than anything else. Basically, Access was just a front end retrieval client for records in the oracle database. That was key though in my ability to data mine the records and prepare reports with VBA.
Do not downmod posts "overrated" simply because you disagree with them.
When you get to training candidates for research, the curriculum is so tight that although the need for programming skills is acknowledged by reasonable department heads, the priorities are for other things, not programming. This is true of all experimental sciences where data are increasingly overwhelming. Greg Wilson did this workshop at the AAAS meeting a couple of years ago:
http://www.osl.iu.edu/~lums/swc/
When he had outlined both the need and the solution, he asked for a show of hands for agreement. Almost every hand went up. Then he asked how many would adopt and the number went WAY down.
Any preoccupation with ideas of what is right or wrong in conduct shows an arrested intellectual development. (Wilde)
Ahh, ORACLE... I thought it was an Access database, hence the utter disbelief.
Yes programming is an essential skill. I've taught a number of undergrad programming courses to all sorts of majors. Programming is mostly just structured thinking. It's a valuable skill that translates to many areas. Any complex plan benefits from basic algorithmic knowledge.
Two semesters of programming ought to be mandatory for every science major, just like calculus and physics. That includes social sciences. I'd recommend it for everyone, but wouldn't require it for the humanities.
First you have to ask what the purpose of your degree is. Are you preparing these students for graduate work? Preparing them for employment in the field? Giving them a general education which they'll employ in other fields?
The answer determines what tools you should teach them. Teach what is relevant to the destination. For grad work & research, I'd guess Matlab would be appropriate. I don't know what practicing physicists outside academia use (are there any?). For general employment, I'd suggest c or python. C is ubiquitous and interfaces with everything, but it's a bit clunky these days. Most people don't need to delve to that level. Python isn't that widely used (unfortunately), but it's a very clean and powerful language/platform. It's an excellent tool for teaching basic programming concepts without messy syntax, complex data structures, and arcane minutiae getting in the way. With a solid foundation in python, students should be able to apply those lessons to other languages on their own.
Democracy is two wolves and a sheep voting on lunch.