|
|||
|
Hi All
I asked the question in the subject over at my blog and would appreciate feedback from Fortran programmers. http://www.walkingrandomly.com/?p=1397 Best wishes, Mike |
|
|
||||
|
||||
|
|
|
|||
|
On 11 jun, 13:53, "michael.p.crouc...@googlemail.com"
<michael.p.crouc...@googlemail.com> wrote: > Hi All > > I asked the question in the subject over at my blog and would > appreciate feedback from Fortran programmers. > > http://www.walkingrandomly.com/?p=1397 > > Best wishes, > Mike I can not reach that link (according to my browser it might be broken), so I am not sure how to answer this one .Regards, Arjen |
|
|||
|
On Thu, 11 Jun 2009 06:26:32 -0700 (PDT), Arjen Markus
<arjen.markus@wldelft.nl> wrote: >On 11 jun, 13:53, "michael.p.crouc...@googlemail.com" ><michael.p.crouc...@googlemail.com> wrote: >> Hi All >> >> I asked the question in the subject over at my blog and would >> appreciate feedback from Fortran programmers. >> >> http://www.walkingrandomly.com/?p=1397 >> >> Best wishes, >> Mike > >I can not reach that link (according to my browser it might be >broken), >so I am not sure how to answer this one .I didn't have a problem. There is a slashdot article discussing Michael's claims. The majority view seems to be that if you are in engineering or the hard sciences you are being short changed if you are not taught fortran. The article suggests python as a first language instead. Richard Harter, cri@tiac.net http://home.tiac.net/~cri, http://www.varinoma.com If I do not see as far as others, it is because I stand in the footprints of giants. |
|
|||
|
On Jun 11, 9:26*am, Arjen Markus <arjen.mar...@wldelft.nl> wrote:
> On 11 jun, 13:53, "michael.p.crouc...@googlemail.com" > > <michael.p.crouc...@googlemail.com> wrote: > > Hi All > > > I asked the question in the subject over at my blog and would > > appreciate feedback from Fortran programmers. > > >http://www.walkingrandomly.com/?p=1397 > > > Best wishes, > > Mike > > I can not reach that link (according to my browser it might be > broken), > so I am not sure how to answer this one .> > Regards, > > Arjen This page now resolves as it also did when I followd the link to it from Slashdot. Should students learn Fortran? In my opinion some students clearly don't learn Fortran well enough. -- e |
|
|||
|
Since that page will become dominated by slashdot groupies, I'm sure I
can predict what kind of answers you'll get. At my university's aerospace dept, there's been some recent conflict about this same issue. Many are advocating ditching fortran entirely and focusing on Matlab (currently both are taught to some extent, but fortran comes first). As someone with very little experience with python, would someone care to enlighten me as to how python could even be considered as a "replacement" for Fortran? It's all well and good to use python as a tool for learning the basic concepts of programming, but engineering students have limited time to focus specifically on programming. Starting with such a high level programming language and subsequently being forced to learn a much lower level language seems like a considerable waste of time. |
|
|||
|
Dear Mike,
I think that the answer to your question depends enormously on what the students are studying and, perhaps, what stage they are at. Being a bit long in the tooth, I was introduced to programming with Dartmouth Basic and went on to Fortran II on a PDP8. Subsequently, as a practising research scientist and, latterly, engineer, I have been through phases of F77, F95, C, C++, Python and Matlab, depending on the environment and the geological epoch. Frankly, from this experience, I have concluded that it really does not matter, which language is taught, even though the languages are so different; the significant conceptual leap is to programme at all! I would recommend, if possible, an interpreted language such as MatLab/ octave or Python/SciPy, largely because the feedback is so immediate: The x = [1:100]; y = sin(x/10); plot (x, y); of MatLab/octave is surely a rather direct way of learning the concepts. If latter, the student finds the need to learn fortran, then fine. I happen to believe that it the best for all sorts of things. On the other hand, I could not survive without MatLab.... Cheers Paul |
|
|||
|
On Thu, 11 Jun 2009 04:53:55 -0700 (PDT),
"michael.p.croucher@googlemail.com" <michael.p.croucher@googlemail.com> wrote: >Hi All > >I asked the question in the subject over at my blog and would >appreciate feedback from Fortran programmers. > >http://www.walkingrandomly.com/?p=1397 > >Best wishes, >Mike I read the above text, not maybe as carefully as I should've had, so some of the following may be repeating the already mentioned. But still, these are the reasons why I think fortran should be taught to undergrads of engineering studies of various fields, *except* computer sciences. They have C/C++/Java, and I won't argue that it is better suited for what they do. 1.) Fortran, as everyone here is aware of, has been with us for a long time (well, hardly any language has been with us longer) - that being said, it holds a vast amount of programs and libraries which have been written and tested by people smarter than you (students) - this usually works as an ice-breaking statement :-) 2.) That being said, and contrary to the public opinion nowadays, fortran that was used 20 years ago is not fortran that is actual today. Mention this at the start since a lot of people think fortran has stopped developing 20 years ago. At least most of them think of fortran in view of fortran77, not anything newer. 3.) It is a very easy language to learn - I'm not talking about knowing the standard by heart, but for most uses a scripta about fortran can be put it less than 50 pages (with examples). 3.) Fortran has 1-based arrays - for most engineering fields, which have been developing not only in the last 30 years, this is a much more natural approach. 4.) It has excellent multi dimensional arrays support - although one would think that multi dimensional arrays are not that rare nor difficult to implement, most languages still have trouble handling them. 5.) New fortran standards have very nice array handling features (e.g. A=B*C, almost like matlab syntax, but with compiled speed). 6.) Parallelism features build and developed with the language (others in here will know more on this) - many smarter people than me (that would be, what ... all ?) think this is the way to go. 7.) It is easily connectible with c, python, matlab ... so you can do your calculations in fortran, and your frontend in, for example, python, ... if you feel so inclined 8.) Has exceptional backward compatibility. 9.) Is very very portable (as long as you use standard features, may have some problems with compiler extensions, but certanly more portable than most). 10.) And the last, but not the least important, it's problem oriented solving community - since fortran users are usually not cs, but math, phy, engineers ... people with no programming, but rather problem solving experience whose knowledge about your problem can be very helpful Python - why not ? ------------------ Although I like python, and regard it as a wonderful little new language (I know it's been active for somewhat 20 years or so, but let's be frank, it has only gained its popularity in the last few years) there are some things I still don't like about it. -- it is a one man's language. It isn't standardized, has no corporate backing standing beyond it. What would happen to it if Guido got hit by a bus today, or killed his wife (Reiser) ? -- it isn't backward compatible. Although they're doing their best, switching from ver.2 onto ver.3 still required rewriting a lot of stuff. -- although it has nice iteration features, and has nice science people oriented support in terms of numpy and scipy, it is not good, imho. Why not ? For example, you can handle multidim. arrays in pure python, and it's hard. Okey, said somebody, let's use numpy. Fine, but when you start using it, you notice, it's not exactly python any more. It is similar, but not the same. Different syntax. -- it is slower - however you put it, it is slower. -- it is a dynamic language. Nice at first thought, but when you start putting parts of programs, onto parts of programs, maintaining all of that and debugging it becomes hard. On the other hand, it does have its advantages. I cannot deny that. It is a language with libraries for pretty much anything you can think of. It's community on the web currently is huge, and it is very popular even among the cs guys. For putting things together to see if they'll work, it's a great lil'thing. It is a nice tool to have around, no doubt about it. Matlab - why not ? ------------------ I've used, and still use this one. When I do some weird matrix transformations which I've never done before, and I know I'm gonna be doing it this one time, matlab is super. ++ it has a junkload of functions build inside ++ nice plotting capabilities and intuitive way of going through toolboxes once you get their 'way of thinking' ++ on the usenet it has a very active support community but, it also has its drawbacks -- it is one company's solution (I don't like things which depend on one centralized person/company) - what would happen if MathWorks got hit by a ... uhmm, no ... what would happen in MathWorks got hit by a falling MIR space station ? -- it is not standardized, and you still see backward compatibility issues -- it is still slower (you have to vectorize things to get efficient code) -- expensive (unavailable for most students, personally) and no alternative to it (no other company makes an interpreter for matlab code) THE END ------- Well, anyways, these were the points that popped into my head while writing this. It is not much organized, but I think you'll understand what I'm trying to say. Others in here will probably add something as well. Now I gotta go and put the kettle on. Typing this much makes me thirsty. And a little reward for those who made it till here: http://www.daybydaycartoon.com/cartoons/11-24-2002.gif with regards, Luka |
|
|||
|
michael.p.croucher@googlemail.com schreef:
> Hi All > > I asked the question in the subject over at my blog and would > appreciate feedback from Fortran programmers. > > http://www.walkingrandomly.com/?p=1397 > > Best wishes, > Mike Mike, I would say yes. As a scientist, I think that some calculations with complex numbers are too hard to do in C. For the rest I am biased, still have problems coding in C. Kind regards, Jan Gerrit Kootstra |
|
|||
|
In message <b6j2351mobmsgln4g7q254sno1268pamhb@4ax.com>, Luka Djigas
<ldigas@?.com.invalid> writes >3.) Fortran has 1-based arrays - for most engineering fields, which >have been developing not only in the last 30 years, this is a much >more natural approach. True by default, but of course you can have 0-based or any other based arrays, which few other languages allow, surprisingly. I agree pretty much with your summary of the pros and cons of Fortran, Python, and (though I know little about it) Matlab. One additional point about Fortran versus other compiled languages such as C/C++ is that Fortran is much safer. The only thing all programmers have in common is our propensity to make mistakes. Fortran prevents many classes of mistake or makes it easier to detect them then when using many other languages. Just a few examples: Fortran compilers nearly all have array-bound checking as an option, and (unless you really have a speed problem) it's sensible to use it all the time. In Fortran pointers are available for when you really need them, but they can only point at objects explicitly declared as a target (or other pointers). That's so very much safer than C/C++. A huge proportion of security problems on the internet are caused by buffer overflows in C strings. In Fortran strings are essentially of fixed length, and it's extremely hard to engineer an overflow which the system does not detect. Having said that, I have used Python for many simple applications, and I think it might make a better introduction to programming for the true beginner. After that I think those doing scientific/engineering subjects ought to learn Fortran, but of course modern Fortran (there are too many who still persist in teaching Fortran77, which is an extraordinary thing to do). -- Clive Page |
|
|||
|
Luka Djigas <ldigas@@gmail.com> wrote:
> Matlab ..... > but, it also has its drawbacks > -- it is one company's solution That's a huge issue with it for me. If you send a program to someone else, they are required to deal with Mathworks to use your program. Not that I have anything in particular against Mathworks, but it becomes a big problem if you *have* to deal with any specific company. Don't think Mathworks doesn't take advantage of such situations; I've seen it happen. The facility where I used to work paid over $100k per year to Mathworks, and had gotten themselves in the situation where they had zero negotiating leverage. No, things like Octave did not substitute viably; tried that; got nowhere. Things like that become bigger issues the bigger the application. Big applications tend to have long lifetimes; they need to. I know that projected lifetime was a conscious part of some of the design decisions I made for one of my apps back in the late 80's. It wasn't even a big app at all, but parts of it were going to end up getting used in lots of other apps. I designed with the assumption that it had to be good for at least a 30-year lifetime. (It is still going strong at over 20 and shows no signs of slowing down; seems likely to hit that 30-year figure). Having a standardized language supported by multiple vendors is critical over that kind of time frame. You don't want to have 20 years of time invested in an application that can be shut completely down by one vendor... and have that vendor know it. -- Richard Maine | Good judgment comes from experience; email: last name at domain . net | experience comes from bad judgment. domain: summertriangle | -- Mark Twain |
|
|||
|
mlohry wrote:
> Since that page will become dominated by slashdot groupies, I'm sure I > can predict what kind of answers you'll get. > > At my university's aerospace dept, there's been some recent conflict > about this same issue. Many are advocating ditching fortran entirely > and focusing on Matlab (currently both are taught to some extent, but > fortran comes first). > > > As someone with very little experience with python, would someone care > to enlighten me as to how python could even be considered as a > "replacement" for Fortran? It's all well and good to use python as a > tool for learning the basic concepts of programming, but engineering > students have limited time to focus specifically on programming. > Starting with such a high level programming language and subsequently > being forced to learn a much lower level language seems like a > considerable waste of time. I don't see anyone suggesting python as a replacement for Fortran. There was no popular interpreted language when I started; python seems a reasonable starting point with broader appeal than the others discussed here. I, a seat of the pants Fortran programmer, found myself explaining recently to my son on the other side of the world how python insists on indentation to define block structure, minutes after debugging his beginner attempts and using them to learn a little myself. I don't see your high level/low level distinction, nor do I think it relevant to the current discussion. I supposed that Matlab had become popular as a vehicle for introductory numerical analysis, in hopes of making it accessible to a broader audience than it would be if a compiled language were chosen. In my view, that misleads people even more than python would into thinking they don't need to go further to solve real world problems. I would say you found some people thus misled. I had the interesting experience yesterday of collaborating with a numerical analysis professor who does know Fortran much better than I know numerical analysis. Glossing over my superficial understanding of what he was talking about, we managed to debug his code in a session of little over an hour and achieve the expected performance. |
|
|||
|
Richard Maine wrote:
.... > ... Don't think > Mathworks doesn't take advantage of such situations; I've seen it > happen. The facility where I used to work paid over $100k per year to > Mathworks, and had gotten themselves in the situation where they had > zero negotiating leverage. No, things like Octave did not substitute > viably; tried that; got nowhere. My observation is that TMW is becoming far more difficult to deal with as time goes by and, unfortunately, the rate seems to be increasing. It seems to me they have reached a critical size where revenue generation to feed behemoth is harder and harder to generate; hence more effort to generate revenue from all possible avenues. Great product; difficult to cope with the proprietary issues... -- |
|
|||
|
In article <b6j2351mobmsgln4g7q254sno1268pamhb@4ax.com>,
Luka Djigas <ldigas@@gmail.com> wrote: > 3.) Fortran has 1-based arrays - for most engineering fields, which > have been developing not only in the last 30 years, this is a much > more natural approach. The 1-based arrays are only the default. If your problem is formulated with an array a(-10:10), then you just declare the array that way and use the natural indexing. Or a(-n:m) where n and m are variables if that is appropriate. There is no need to write the code with offsets, or change the indexing to match the restrictions of the language, both of which can be complicated and error prone especially for multidimensional arrays. This is not a new feature, this was standardized in f77, over 30 years ago. $.02 -Ron Shepard |
|
|||
|
You have recommended Python be used along with "Standard python
modules such as matplotlib and numpy", rather than Fortran. It probably would be more useful for students to have Python + matplotlib + numpy than just the g95 Fortran 95 compiler installed on the department computers, but this is not a fair comparison IMO. On Linux, g95 could be supplemented by numerous useful programs and compiled libraries, such as gnuplot and gnuplotfortran (for graphics) http://gnuplotfortran.sourceforge.net/, Matran (a wrapper for Lapack that has much of the Matlab matrix functionality), SLATEC (a general- purpose library). Maybe people could describe the suite of programs they use for scientific programming. For me on Windows, it is g95, Python, gnuplot, Excel (for viewing csv input and output files), nmake, and Epsilon (an Emacs-like editor). I have subroutines to generate gnuplot graphs easily from Fortran. |
|
|||
|
On Jun 12, 12:43 pm, Beliavsky <beliav...@aol.com> wrote:
> You have recommended Python be used along with "Standard python > modules such as matplotlib and numpy", rather than Fortran. It > probably would be more useful for students to have Python + matplotlib > + numpy than just the g95 Fortran 95 compiler installed on the > department computers, but this is not a fair comparison IMO. On Linux, > g95 could be supplemented by numerous useful programs and compiled > libraries, such as gnuplot and gnuplotfortran (for graphics)http://gnuplotfortran.sourceforge.net/, Matran (a wrapper for Lapack > that has much of the Matlab matrix functionality), SLATEC (a general- > purpose library). > > Maybe people could describe the suite of programs they use for > scientific programming. For me on Windows, it is g95, Python, gnuplot, > Excel (for viewing csv input and output files), nmake, and Epsilon (an > Emacs-like editor). I have subroutines to generate gnuplot graphs > easily from Fortran. For me on unix or linux it is g95, gfortran, Sun f95 and Intel ifort (useful to have all 4 when tracking down bugs, either my own [frequent] or in compilers [occasional]), pgplot (for graphics), emacs (for editing), latex (for word processing), Maple (for computer algebra and for numerical programs that won't take much time to run). |
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|