<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">
There is several ways to look at this issue.<div>Suppose your students totally fail as physics student and even more as future manager/teamleader and continue as computer science students.</div><div><br class="webkit-block-placeholder"></div><div>Then what language can they use best?</div><div><br class="webkit-block-placeholder"></div><div>If you open a job site, you'll find biggest companies interested in a few languages: C++, JAVA, C#</div><div><br></div><div>You'll find near to zero C jobs and even less Fortran.</div><div><br class="webkit-block-placeholder"></div><div><div>We can shredder JAVA and C# directly as those 2 languages you can never make a program in that's less than 3 times slower than the C/C++ alternative.</div><div><br class="webkit-block-placeholder"></div></div><div>C++ course is indeed hard to find, especially c++ courses where you avoid 1000 things of c++ that make a program slow.</div><div>The amount of programmers on the planet who know how to write for speed in C++ AND who are knowledgeable in C++, </div><div>like book writing level, you probably can list at 2 pages of A4.</div><div><br class="webkit-block-placeholder"></div><div>Object orientatien is of course the opposite of what we want in a speedy program. The idea of object orientation is to put everything, both code and data in an object.</div><div>Small fundamental problem of that, is that allocating and deallocating objects is getting done more or less automatic and happens to be one of the slowest operations on the processor, let's not even discuss the weakness of m$ which is memory defragmentation, especially shared memory - you never know where those DLL's were loaded.</div><div><br class="webkit-block-placeholder"></div><div>So C is a good start in that sense.</div><div><br class="webkit-block-placeholder"></div><div>A good C programmer at least with some help can find his way in C++ code, Fortran really is outdated by now. It has 0 usage outside of a few old programs that run on supercomputers and where teams of old grey professors try to force manufacturers to keep their libraries working for. It's that those machines are so expensive, </div><div>otherwise no fortran libraries would exist anymore at modern hardware.</div><div><br class="webkit-block-placeholder"></div><div>Yet you ought to learn them C++ rather than C.</div><div>Just avoid them coding using sophisticated things of C++ which kill speed.</div><div>Many companies will give you a big kiss if you learn them that, as that avoids them a lot of trouble.</div><div><br class="webkit-block-placeholder"></div><div>Now of course your hard job is then to figure out what is bad for speed in C++ and to find a good C++ course which is basically more like a C course,</div><div>than a C++ course.</div><div><br></div><div>Vincent</div><div><br><div><div>On Nov 20, 2007, at 7:33 PM, Nathan Moore wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">I regularly teach a college course in a physics department that deals with scientific computation.  After students take the course, I expect that they'll be able to write simple "c-tran" style programs for data analysis, write basic MD or MC simulations, and be fairly fluent in Mathematica.  <br><br>In the past, I figured that with the breadth of topics included in the course, Fortran, specifically the basic, simple, and reliable F77 dialect (w/ some F90 conveniences) was the language to teach.  In my own head, my rationale was: <br>- Most students can grasp the basics of fortran in half a day's reading, so I can spend more class time on science and math (probably because there are no pointers - I think that C is much harder for students and sometimes "seems" less like mathematical syntax than f77) <br>- "Classical Fortran" is a great text and is readable for self-study (I know of no such text for C/C++)<br>- several free compilers exist (g95 seems ok so far)<br>- Netlib, lapack, and numerical recipes cover the math library adequately <br>- F77 is compiled (Perl/python are too slow for an MD/MC sim and I figure that students should know at least on compiled language and one scripting language to be competent)<br>- MPI is a relatively basic addition to the language (again, no pointers, allocation, or addressing) <br clear="all"><br>After reflection though, I've started to wonder about the wisdom of my choice.  Specifically (like RGB), I love the GSL library, and extending GSL to fortran in an intro class is non-trivial.  Additionally, most vendors supply "fast" hardware libraries in C (I may be ignorant, but if a student wants to call an AMD ACML fast-math function( <a href="http://developer.amd.com/acml.jsp">http://developer.amd.com/acml.jsp</a>), or write a linear algebra function to run on a graphics card(<a href="http://developer.nvidia.com/object/cuda.html">http://developer.nvidia.com/object/cuda.html </a>), the vendors seem to assume that you'll write the code in C).  <br><br>Also, and more relevant, I assume that most employers word-associate "Fortran is to backwards as C is to competence".<br><br>So, I'm thinking about reworking the class to favor C, and fearing 3 weeks of pointer and addressing hell.  For those of you who teach scientific computation (and also those of you who hire undergrads), I'd be grateful for your thoughts.  One specific question I have is what text covers scientific programming and touches on MPI using the C language. <br><br>regards,<br><br>Nathan Moore<br><br>        <br>-- <br>- - - - - - -   - - - - - - -   - - - - - - - <br>Nathan Moore<br>Assistant Professor, Physics<br>Winona State University<br>AIM: nmoorewsu <br>- - - - - - -   - - - - - - -   - - - - - - - <div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">_______________________________________________</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Beowulf mailing list, <a href="mailto:Beowulf@beowulf.org">Beowulf@beowulf.org</a></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">To change your subscription (digest mode or unsubscribe) visit <a href="http://www.beowulf.org/mailman/listinfo/beowulf">http://www.beowulf.org/mailman/listinfo/beowulf</a></div> </blockquote></div><br></div></body></html>